build: use KERNEL_MAKE_FLAGS for kernel file compilations
authorKarl Vogel <karl.vogel@gmail.com>
Fri, 13 Oct 2017 09:10:03 +0000 (11:10 +0200)
committerHauke Mehrtens <hauke@hauke-m.de>
Sun, 29 Oct 2017 15:17:05 +0000 (16:17 +0100)
The build system already defines KERNEL_CROSS which defaults to TARGET_CROSS.
Make use of this variable for kernel makefiles.

Signed-off-by: Karl Vogel <karl.vogel@gmail.com>
20 files changed:
package/kernel/acx-mac80211/Makefile
package/kernel/ar7-atm/Makefile
package/kernel/ath10k-ct/Makefile
package/kernel/avila-wdt/Makefile
package/kernel/broadcom-wl/Makefile
package/kernel/button-hotplug/Makefile
package/kernel/gpio-button-hotplug/Makefile
package/kernel/gpio-nct5104d/Makefile
package/kernel/hwmon-gsc/Makefile
package/kernel/i2c-gpio-custom/Makefile
package/kernel/leds-apu2/Makefile
package/kernel/mt76/Makefile
package/kernel/mwlwifi/Makefile
package/kernel/rotary-gpio-custom/Makefile
package/kernel/rtc-rv5c386a/Makefile
package/kernel/spi-gpio-custom/Makefile
package/kernel/w1-gpio-custom/Makefile
package/kernel/wrt55agv2-spidevs/Makefile
package/network/utils/xtables-addons/Makefile
toolchain/kernel-headers/Makefile

index a3d5de2..adca5b7 100644 (file)
@@ -182,8 +182,7 @@ PKG_EXTRA_CFLAGS:= \
 
 define Build/Compile
        $(MAKE) -C "$(LINUX_DIR)" \
-               ARCH="$(LINUX_KARCH)" \
-               CROSS_COMPILE="$(TARGET_CROSS)" \
+               $(KERNEL_MAKE_FLAGS) \
                SUBDIRS="$(PKG_BUILD_DIR)" \
                $(PKG_EXTRA_KCONFIG) \
                EXTRA_CFLAGS="$(PKG_EXTRA_CFLAGS) -DCONFIG_ACX_MAC80211_VERSION=\"KERNEL_VERSION(4,2,0)\"" \
index edec44f..82d6f61 100644 (file)
@@ -80,8 +80,7 @@ endef
 
 define Build/Compile
        $(MAKE) -C "$(LINUX_DIR)" \
-               CROSS_COMPILE="$(TARGET_CROSS)" \
-               ARCH="$(LINUX_KARCH)" \
+               $(KERNEL_MAKE_FLAGS) \
                SUBDIRS="$(PKG_BUILD_DIR)" \
                modules
 endef
index 9b152dd..82d7664 100644 (file)
@@ -79,8 +79,7 @@ endif
 
 define Build/Compile
        +$(MAKE) $(CT_MAKEDEFS) $(PKG_JOBS) -C "$(LINUX_DIR)" \
-               ARCH="$(LINUX_KARCH)" \
-               CROSS_COMPILE="$(TARGET_CROSS)" \
+               $(KERNEL_MAKE_FLAGS) \
                SUBDIRS="$(PKG_BUILD_DIR)/ath10k$(CT_KVER)" \
                NOSTDINC_FLAGS="$(NOSTDINC_FLAGS)" \
                modules
index 94bda9b..a91c933 100644 (file)
@@ -22,8 +22,7 @@ define KernelPackage/avila-wdt
 endef
 
 MAKE_OPTS:= \
-       ARCH="$(LINUX_KARCH)" \
-       CROSS_COMPILE="$(TARGET_CROSS)" \
+       $(KERNEL_MAKE_FLAGS) \
        SUBDIRS="$(PKG_BUILD_DIR)"
 
 define Build/Compile
index fe1c522..d1d0604 100644 (file)
@@ -100,8 +100,7 @@ define Package/nas/description
 endef
 
 MAKE_KMOD := $(MAKE) -C "$(LINUX_DIR)" \
-               CROSS_COMPILE="$(TARGET_CROSS)" \
-               ARCH="$(LINUX_KARCH)" \
+               $(KERNEL_MAKE_FLAGS) \
                PATH="$(TARGET_PATH)" \
                SUBDIRS="$(PKG_BUILD_DIR)/kmod" \
 
index 7b6aacf..2554ae6 100644 (file)
@@ -36,8 +36,7 @@ EXTRA_CFLAGS:= \
        $(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=y,%,$(filter %=y,$(EXTRA_KCONFIG)))) \
 
 MAKE_OPTS:= \
-       ARCH="$(LINUX_KARCH)" \
-       CROSS_COMPILE="$(TARGET_CROSS)" \
+       $(KERNEL_MAKE_FLAGS) \
        SUBDIRS="$(PKG_BUILD_DIR)" \
        EXTRA_CFLAGS="$(EXTRA_CFLAGS)" \
        $(EXTRA_KCONFIG)
index 8f836a8..216d23b 100644 (file)
@@ -33,8 +33,7 @@ define KernelPackage/gpio-button-hotplug/description
 endef
 
 MAKE_OPTS:= \
-       ARCH="$(LINUX_KARCH)" \
-       CROSS_COMPILE="$(TARGET_CROSS)" \
+       $(KERNEL_MAKE_FLAGS) \
        SUBDIRS="$(PKG_BUILD_DIR)"
 
 define Build/Compile
index b43291e..3335238 100644 (file)
@@ -37,8 +37,7 @@ EXTRA_CFLAGS:= \
        $(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=y,%,$(filter %=y,$(EXTRA_KCONFIG)))) \
 
 MAKE_OPTS:= \
-       ARCH="$(LINUX_KARCH)" \
-       CROSS_COMPILE="$(TARGET_CROSS)" \
+       $(KERNEL_MAKE_FLAGS) \
        SUBDIRS="$(PKG_BUILD_DIR)" \
        EXTRA_CFLAGS="$(EXTRA_CFLAGS)" \
        $(EXTRA_KCONFIG)
index 1892e02..3888a2f 100644 (file)
@@ -20,8 +20,7 @@ endef
 
 define Build/Compile
        $(MAKE) -C "$(LINUX_DIR)" \
-               CROSS_COMPILE="$(TARGET_CROSS)" \
-               ARCH="$(LINUX_KARCH)" \
+               $(KERNEL_MAKE_FLAGS) \
                SUBDIRS="$(PKG_BUILD_DIR)" \
                EXTRA_CFLAGS="$(BUILDFLAGS)" \
                modules
index fb3f3bf..d1123cc 100644 (file)
@@ -33,8 +33,7 @@ EXTRA_CFLAGS:= \
        $(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=y,%,$(filter %=y,$(EXTRA_KCONFIG)))) \
 
 MAKE_OPTS:= \
-       ARCH="$(LINUX_KARCH)" \
-       CROSS_COMPILE="$(TARGET_CROSS)" \
+       $(KERNEL_MAKE_FLAGS) \
        SUBDIRS="$(PKG_BUILD_DIR)" \
        EXTRA_CFLAGS="$(EXTRA_CFLAGS)" \
        $(EXTRA_KCONFIG)
index bab2315..08aca17 100644 (file)
@@ -37,8 +37,7 @@ EXTRA_CFLAGS:= \
        $(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=y,%,$(filter %=y,$(EXTRA_KCONFIG)))) \
 
 MAKE_OPTS:= \
-       ARCH="$(LINUX_KARCH)" \
-       CROSS_COMPILE="$(TARGET_CROSS)" \
+       $(KERNEL_MAKE_FLAGS) \
        SUBDIRS="$(PKG_BUILD_DIR)" \
        EXTRA_CFLAGS="$(EXTRA_CFLAGS)" \
        $(EXTRA_KCONFIG)
index 6214f37..5d67203 100644 (file)
@@ -74,8 +74,7 @@ endif
 
 define Build/Compile
        +$(MAKE) $(PKG_JOBS) -C "$(LINUX_DIR)" \
-               ARCH="$(LINUX_KARCH)" \
-               CROSS_COMPILE="$(TARGET_CROSS)" \
+               $(KERNEL_MAKE_FLAGS) \
                SUBDIRS="$(PKG_BUILD_DIR)" \
                NOSTDINC_FLAGS="$(NOSTDINC_FLAGS)" \
                modules
index e28d554..e1d80a8 100644 (file)
@@ -43,8 +43,7 @@ NOSTDINC_FLAGS = \
 
 define Build/Compile
        +$(MAKE) $(PKG_JOBS) -C "$(LINUX_DIR)" \
-               ARCH="$(LINUX_KARCH)" \
-               CROSS_COMPILE="$(TARGET_CROSS)" \
+               $(KERNEL_MAKE_FLAGS) \
                SUBDIRS="$(PKG_BUILD_DIR)" \
                NOSTDINC_FLAGS="$(NOSTDINC_FLAGS)" \
                modules
index e1cf7ff..f758567 100644 (file)
@@ -33,8 +33,7 @@ EXTRA_CFLAGS:= \
        $(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=y,%,$(filter %=y,$(EXTRA_KCONFIG)))) \
 
 MAKE_OPTS:= \
-       ARCH="$(LINUX_KARCH)" \
-       CROSS_COMPILE="$(TARGET_CROSS)" \
+       $(KERNEL_MAKE_FLAGS) \
        SUBDIRS="$(PKG_BUILD_DIR)" \
        EXTRA_CFLAGS="$(EXTRA_CFLAGS)" \
        $(EXTRA_KCONFIG)
index e970982..a268ad5 100644 (file)
@@ -23,8 +23,7 @@ endef
 
 define Build/Compile
        $(MAKE) -C "$(LINUX_DIR)" \
-               CROSS_COMPILE="$(TARGET_CROSS)" \
-               ARCH="$(LINUX_KARCH)" \
+               $(KERNEL_MAKE_FLAGS) \
                SUBDIRS="$(PKG_BUILD_DIR)" \
                EXTRA_CFLAGS="$(BUILDFLAGS)" \
                modules
index e6d692d..19aef20 100644 (file)
@@ -33,8 +33,7 @@ EXTRA_CFLAGS:= \
        $(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=y,%,$(filter %=y,$(EXTRA_KCONFIG)))) \
 
 MAKE_OPTS:= \
-       ARCH="$(LINUX_KARCH)" \
-       CROSS_COMPILE="$(TARGET_CROSS)" \
+       $(KERNEL_MAKE_FLAGS) \
        SUBDIRS="$(PKG_BUILD_DIR)" \
        EXTRA_CFLAGS="$(EXTRA_CFLAGS)" \
        $(EXTRA_KCONFIG)
index 67fdc7d..1008cf9 100644 (file)
@@ -33,8 +33,7 @@ EXTRA_CFLAGS:= \
        $(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=y,%,$(filter %=y,$(EXTRA_KCONFIG))))
 
 MAKE_OPTS:= \
-       ARCH="$(LINUX_KARCH)" \
-       CROSS_COMPILE="$(TARGET_CROSS)" \
+       $(KERNEL_MAKE_FLAGS) \
        SUBDIRS="$(PKG_BUILD_DIR)" \
        EXTRA_CFLAGS="$(EXTRA_CFLAGS)" \
        $(EXTRA_KCONFIG)
index 169f6b4..d80c1e5 100644 (file)
@@ -25,8 +25,7 @@ define KernelPackage/wrt55agv2-spidevs/description
 endef
 
 MAKE_OPTS:= \
-       ARCH="$(LINUX_KARCH)" \
-       CROSS_COMPILE="$(TARGET_CROSS)" \
+       $(KERNEL_MAKE_FLAGS) \
        SUBDIRS="$(PKG_BUILD_DIR)"
 
 define Build/Compile
index a1415fc..b1e134e 100644 (file)
@@ -43,8 +43,7 @@ CONFIGURE_ARGS+= \
 
 define Build/Compile
        +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
-               ARCH="$(LINUX_KARCH)" \
-               CROSS_COMPILE="$(TARGET_CROSS)" \
+               $(KERNEL_MAKE_FLAGS) \
                DESTDIR="$(PKG_INSTALL_DIR)" \
                DEPMOD="/bin/true" \
                all
@@ -52,8 +51,7 @@ endef
 
 define Build/Install
        $(MAKE) -C $(PKG_BUILD_DIR) \
-               ARCH="$(LINUX_KARCH)" \
-               CROSS_COMPILE="$(TARGET_CROSS)" \
+               $(KERNEL_MAKE_FLAGS) \
                DESTDIR="$(PKG_INSTALL_DIR)" \
                DEPMOD="/bin/true" \
                install
index 1bf5598..e374e70 100644 (file)
@@ -36,13 +36,9 @@ HOST_EXTRACFLAGS=
 LINUX_HAS_HEADERS_INSTALL:=y
 
 KMAKE := $(MAKE) -C $(HOST_BUILD_DIR) \
-       HOSTCFLAGS="$(HOST_CFLAGS) -Wall -Wmissing-prototypes -Wstrict-prototypes" \
-       ARCH=$(LINUX_KARCH) \
+       $(KERNEL_MAKE_FLAGS) \
        CC="$(KERNEL_CC)" \
-       CFLAGS="$(TARGET_CFLAGS)" \
-       CROSS_COMPILE=$(TARGET_CROSS) \
-       KBUILD_HAVE_NLS=no \
-       CONFIG_SHELL=$(BASH)
+       CFLAGS="$(TARGET_CFLAGS)"
 
 define Host/Configure/all
        mkdir -p $(BUILD_DIR_TOOLCHAIN)/linux-dev