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 a3d5de231668155c14bf944a116844f1555b3040..adca5b742a640ab0d971afa8fe1ec8fb577e6320 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 edec44f969f19b20a12febfbc3711fcb2deb9a10..82d6f61a7d0215fc28bc4bc9ff808eaaa3b97265 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 9b152dd2857e9a523b72a41c627a6de75bbece13..82d7664b76e1fd143b2e7373bb05a3fddb64ae2b 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 94bda9b8d5aab06a985ac68850a48abffefd1dc4..a91c93374c1e5798370d0fd489b8e28f729ea79d 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 fe1c5228fa5b4bf3f8cdf090747c3d49e3075ba1..d1d060451900d4a38f3ba6fe72ac6e051667ed21 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 7b6aacfbf9be1a537f6e23a6ed591254d787597a..2554ae61dd94d6770b6c2ea86217334a73597270 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 8f836a841a1eef1971e2868a06f696200e9941b6..216d23b76d7d2ec9f860c7c81ebbb0552470838d 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 b43291e5a4f25a2199af7ff9ac2c4006a9d6fb2d..33352388cff63d9db25db52b36d1d6c0a1a04982 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 1892e027ca4b74d2abd2c79091f8b1aa746f30c4..3888a2f17e7a0ee72f2bd3543cd1122e60c03c2c 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 fb3f3bf17e043feea0909fa603105a85e3236511..d1123cc3fb529c541bb59d71dc61c1529c3a1009 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 bab2315b075904c51ea28686f467528d68379526..08aca1750f66b224051d8fcd5345d795ff4234a7 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 6214f371210aef389066976bc7f5745d0dd9b638..5d672034de4a7f3b30001400af52c5722907297a 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 e28d5542f01d520d0081dafd9514e8d658f3f6e7..e1d80a8e4b507bd0b5ab2e0440a6efca97f73223 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 e1cf7ff1dedf9c83567ad5cbe735507ce50b82e8..f75856736523d6372bb66f16bbf2ad8ccda11928 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 e9709820707ac5903c0f0920670f37023602160c..a268ad508cfe3b5ab2f6509442da6f4f6f525615 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 e6d692db443c5afa0591a1bed1053ec3d9c566a6..19aef20ed2f7338fa2d995206c8062075b2f00df 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 67fdc7d15e20d02714306d92652458e828594716..1008cf9736f65977f98f393b685aab951d56c89e 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 169f6b4da1a43812be2be086fad30bb18dd3cf58..d80c1e570b483848d2c09e0391453f88492af12e 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 a1415fc18bbc7a862399b4863ebf6f387a519c83..b1e134e0e68c27e23dbca108a321b9aa66fe3f65 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 1bf5598d6fd6287fb3d660d6faf311f017508e32..e374e706e1dae6714da8defd349de3635a0545b2 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