kernel: Make use of KERNEL_MAKE
authorHauke Mehrtens <hauke@hauke-m.de>
Wed, 14 Dec 2022 21:34:19 +0000 (22:34 +0100)
committerHauke Mehrtens <hauke@hauke-m.de>
Sat, 17 Dec 2022 19:12:31 +0000 (20:12 +0100)
Make use of KERNEL_MAKE in kernel packages were easily possible.
This moves some more code to common places and reduces the number of
lines.

It is defined like this:
KERNEL_MAKE = $(MAKE) $(KERNEL_MAKEOPTS)
KERNEL_MAKEOPTS = -C $(LINUX_DIR) $(KERNEL_MAKE_FLAGS)

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
package/kernel/ath10k-ct/Makefile
package/kernel/broadcom-wl/Makefile
package/kernel/gpio-button-hotplug/Makefile
package/kernel/gpio-nct5104d/Makefile
package/kernel/hwmon-gsc/Makefile
package/kernel/lantiq/ltq-vectoring/Makefile
package/kernel/mt76/Makefile
package/kernel/mwlwifi/Makefile
package/kernel/rtc-rv5c386a/Makefile
package/kernel/rtl8812au-ct/Makefile

index 0c1334cc46e68514a0efc614ddd11a0ef603c06b..2a8c0a421c63bd9d75cd34dcd25563264a2ce40f 100644 (file)
@@ -111,8 +111,7 @@ ifneq ($(findstring c,$(OPENWRT_VERBOSE)),)
 endif
 
 define Build/Compile
-       +$(MAKE) $(CT_MAKEDEFS) $(PKG_JOBS) -C "$(LINUX_DIR)" \
-               $(KERNEL_MAKE_FLAGS) \
+       +$(KERNEL_MAKE) $(CT_MAKEDEFS) $(PKG_JOBS) \
                M="$(PKG_BUILD_DIR)/ath10k$(CT_KVER)" \
                NOSTDINC_FLAGS="$(NOSTDINC_FLAGS)" \
                modules
index dec5bcb98d2ba7836502e854a915f3dde5cf667d..137e547bee7844f8ba7cdeed30964c5bd8f5b25a 100644 (file)
@@ -99,8 +99,7 @@ define Package/nas/description
  proprietary Broadcom wl driver.
 endef
 
-MAKE_KMOD := $(MAKE) -C "$(LINUX_DIR)" \
-               $(KERNEL_MAKE_FLAGS) \
+MAKE_KMOD := $(KERNEL_MAKE) \
                PATH="$(TARGET_PATH)" \
                M="$(PKG_BUILD_DIR)/kmod" \
 
index 09f9c00e990f553e38e0e3406e90ae360d67d250..7ca6195a03ecff149c68ddc6920224bc8116a72e 100644 (file)
@@ -32,14 +32,8 @@ define KernelPackage/gpio-button-hotplug/description
  an overkill for OpenWrt simple needs.
 endef
 
-MAKE_OPTS:= \
-       $(KERNEL_MAKE_FLAGS) \
-       M="$(PKG_BUILD_DIR)"
-
 define Build/Compile
-       $(MAKE) -C "$(LINUX_DIR)" \
-               $(MAKE_OPTS) \
-               modules
+       $(KERNEL_MAKE) M="$(PKG_BUILD_DIR)" modules
 endef
 
 $(eval $(call KernelPackage,gpio-button-hotplug))
index e85639c94afef5260896544a0a065a23f98b2ca3..72b1d58e62ece21d97bfc5afa976364287af6bc3 100644 (file)
@@ -36,15 +36,11 @@ EXTRA_CFLAGS:= \
        $(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=m,%,$(filter %=m,$(EXTRA_KCONFIG)))) \
        $(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=y,%,$(filter %=y,$(EXTRA_KCONFIG)))) \
 
-MAKE_OPTS:= \
-       $(KERNEL_MAKE_FLAGS) \
-       M="$(PKG_BUILD_DIR)" \
-       EXTRA_CFLAGS="$(EXTRA_CFLAGS)" \
-       $(EXTRA_KCONFIG)
-
 define Build/Compile
-        $(MAKE) -C "$(LINUX_DIR)" \
-               $(MAKE_OPTS) \
+        $(KERNEL_MAKE) \
+               M="$(PKG_BUILD_DIR)" \
+               EXTRA_CFLAGS="$(EXTRA_CFLAGS)" \
+               $(EXTRA_KCONFIG) \
                modules
 endef
 
index 34c33dc581ff0023becc39b133f538476e43c31d..cd7d4efb1079ffba05083b7f5842a74565f364fd 100644 (file)
@@ -19,8 +19,7 @@ define KernelPackage/hwmon-gsc/description
 endef
 
 define Build/Compile
-       $(MAKE) -C "$(LINUX_DIR)" \
-               $(KERNEL_MAKE_FLAGS) \
+       $(KERNEL_MAKE) \
                M="$(PKG_BUILD_DIR)" \
                EXTRA_CFLAGS="$(BUILDFLAGS)" \
                modules
index b7b1b83a078a3b63e1d07f5c3a0d019397864fa2..335cfaa1d5f8f13a3a0060db49c55fea77f8c36c 100644 (file)
@@ -51,8 +51,7 @@ define Build/Configure
 endef
 
 define Build/Compile
-       +$(MAKE) $(PKG_JOBS) -C "$(LINUX_DIR)" \
-               $(KERNEL_MAKE_FLAGS) \
+       +$(KERNEL_MAKE) $(PKG_JOBS) \
                M="$(PKG_BUILD_DIR)/$(MAKE_PATH)" \
                modules
 endef
index a086fed1f93fbfeedbe8e8ce18c9f021301b597a..c71c7c52dedf9fae31c241def0089319de1bf2f5 100644 (file)
@@ -379,8 +379,7 @@ ifdef CONFIG_PACKAGE_kmod-mt7921e
 endif
 
 define Build/Compile
-       +$(MAKE) $(PKG_JOBS) -C "$(LINUX_DIR)" \
-               $(KERNEL_MAKE_FLAGS) \
+       +$(KERNEL_MAKE) $(PKG_JOBS) \
                $(PKG_MAKE_FLAGS) \
                M="$(PKG_BUILD_DIR)" \
                NOSTDINC_FLAGS="$(NOSTDINC_FLAGS)" \
index bb472b2a54a5fcdba642223ee748a841a9fb3ee6..c806f917aaa1ca78fb8e8975b4ff40a17935b16e 100644 (file)
@@ -45,8 +45,7 @@ NOSTDINC_FLAGS := \
        -Wno-unused-result
 
 define Build/Compile
-       +$(MAKE) $(PKG_JOBS) -C "$(LINUX_DIR)" \
-               $(KERNEL_MAKE_FLAGS) \
+       +$(KERNEL_MAKE) $(PKG_JOBS) \
                M="$(PKG_BUILD_DIR)" \
                NOSTDINC_FLAGS="$(NOSTDINC_FLAGS)" \
                modules
index 0cca78548a2016fd4200a04f5c6c570fe23f999d..7c18942ffec375fb8798a8c9c97c8c3654d05fcb 100644 (file)
@@ -22,8 +22,7 @@ define KernelPackage/rtc-rv5c386a
 endef
 
 define Build/Compile
-       $(MAKE) -C "$(LINUX_DIR)" \
-               $(KERNEL_MAKE_FLAGS) \
+       $(KERNEL_MAKE) \
                M="$(PKG_BUILD_DIR)" \
                EXTRA_CFLAGS="$(BUILDFLAGS)" \
                modules
index eb2aaa6bf5052dc6e86bfff8f343abef9cc0b403..c8dd417067304ebca6fd7ad0d9adf42aa01684f7 100644 (file)
@@ -44,8 +44,7 @@ NOSTDINC_FLAGS := \
 NOSTDINC_FLAGS+=-DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT -DBUILD_OPENWRT
 
 define Build/Compile
-       +$(MAKE) $(PKG_JOBS) -C "$(LINUX_DIR)" \
-               $(KERNEL_MAKE_FLAGS) \
+       +$(KERNEL_MAKE) $(PKG_JOBS) \
                M="$(PKG_BUILD_DIR)" \
                NOSTDINC_FLAGS="$(NOSTDINC_FLAGS)" \
                modules