From: Hauke Mehrtens Date: Wed, 14 Dec 2022 21:34:19 +0000 (+0100) Subject: kernel: Make use of KERNEL_MAKE X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=243a7256c154a912d9716d98dc33e9b0dc856cb5;p=openwrt%2Fstaging%2Fsvanheule.git kernel: Make use of KERNEL_MAKE 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 --- diff --git a/package/kernel/ath10k-ct/Makefile b/package/kernel/ath10k-ct/Makefile index 0c1334cc46..2a8c0a421c 100644 --- a/package/kernel/ath10k-ct/Makefile +++ b/package/kernel/ath10k-ct/Makefile @@ -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 diff --git a/package/kernel/broadcom-wl/Makefile b/package/kernel/broadcom-wl/Makefile index dec5bcb98d..137e547bee 100644 --- a/package/kernel/broadcom-wl/Makefile +++ b/package/kernel/broadcom-wl/Makefile @@ -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" \ diff --git a/package/kernel/gpio-button-hotplug/Makefile b/package/kernel/gpio-button-hotplug/Makefile index 09f9c00e99..7ca6195a03 100644 --- a/package/kernel/gpio-button-hotplug/Makefile +++ b/package/kernel/gpio-button-hotplug/Makefile @@ -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)) diff --git a/package/kernel/gpio-nct5104d/Makefile b/package/kernel/gpio-nct5104d/Makefile index e85639c94a..72b1d58e62 100644 --- a/package/kernel/gpio-nct5104d/Makefile +++ b/package/kernel/gpio-nct5104d/Makefile @@ -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 diff --git a/package/kernel/hwmon-gsc/Makefile b/package/kernel/hwmon-gsc/Makefile index 34c33dc581..cd7d4efb10 100644 --- a/package/kernel/hwmon-gsc/Makefile +++ b/package/kernel/hwmon-gsc/Makefile @@ -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 diff --git a/package/kernel/lantiq/ltq-vectoring/Makefile b/package/kernel/lantiq/ltq-vectoring/Makefile index b7b1b83a07..335cfaa1d5 100644 --- a/package/kernel/lantiq/ltq-vectoring/Makefile +++ b/package/kernel/lantiq/ltq-vectoring/Makefile @@ -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 diff --git a/package/kernel/mt76/Makefile b/package/kernel/mt76/Makefile index a086fed1f9..c71c7c52de 100644 --- a/package/kernel/mt76/Makefile +++ b/package/kernel/mt76/Makefile @@ -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)" \ diff --git a/package/kernel/mwlwifi/Makefile b/package/kernel/mwlwifi/Makefile index bb472b2a54..c806f917aa 100644 --- a/package/kernel/mwlwifi/Makefile +++ b/package/kernel/mwlwifi/Makefile @@ -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 diff --git a/package/kernel/rtc-rv5c386a/Makefile b/package/kernel/rtc-rv5c386a/Makefile index 0cca78548a..7c18942ffe 100644 --- a/package/kernel/rtc-rv5c386a/Makefile +++ b/package/kernel/rtc-rv5c386a/Makefile @@ -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 diff --git a/package/kernel/rtl8812au-ct/Makefile b/package/kernel/rtl8812au-ct/Makefile index eb2aaa6bf5..c8dd417067 100644 --- a/package/kernel/rtl8812au-ct/Makefile +++ b/package/kernel/rtl8812au-ct/Makefile @@ -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