diff options
author | Felix Fietkau <nbd@nbd.name> | 2017-03-16 09:53:30 +0100 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2017-06-07 18:31:10 +0200 |
commit | 0aed054becb2143952bfb77cb64e23c83ce79dfd (patch) | |
tree | 44c15a3fd584809e0aba379b1734ff0a425613b6 /include/kernel-defaults.mk | |
parent | 00639586fd7892de41fa786bb48aaec4ed4b6e6a (diff) | |
download | openwrt-0aed054becb2143952bfb77cb64e23c83ce79dfd.tar.gz openwrt-0aed054becb2143952bfb77cb64e23c83ce79dfd.tar.bz2 openwrt-0aed054becb2143952bfb77cb64e23c83ce79dfd.zip |
build: add KERNEL_MAKE and KERNEL_MAKE_FLAGS variables and move to kernel.mk
This allows packages to use kernel make options without the forced
-C $(LINUX_DIR). It also makes it more clear that it to be called from
kernel module packages directly.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'include/kernel-defaults.mk')
-rw-r--r-- | include/kernel-defaults.mk | 33 |
1 files changed, 4 insertions, 29 deletions
diff --git a/include/kernel-defaults.mk b/include/kernel-defaults.mk index bca1f1eeee..8a3e2be0eb 100644 --- a/include/kernel-defaults.mk +++ b/include/kernel-defaults.mk @@ -11,27 +11,6 @@ ifneq ($(SOURCE_DATE_EPOCH),) endif endif -KERNEL_MAKEOPTS := -C $(LINUX_DIR) \ - HOSTCFLAGS="$(HOST_CFLAGS) -Wall -Wmissing-prototypes -Wstrict-prototypes" \ - CROSS_COMPILE="$(KERNEL_CROSS)" \ - ARCH="$(LINUX_KARCH)" \ - KBUILD_HAVE_NLS=no \ - KBUILD_BUILD_USER="$(call qstrip,$(CONFIG_KERNEL_BUILD_USER))" \ - KBUILD_BUILD_HOST="$(call qstrip,$(CONFIG_KERNEL_BUILD_DOMAIN))" \ - KBUILD_BUILD_TIMESTAMP="$(KBUILD_BUILD_TIMESTAMP)" \ - KBUILD_BUILD_VERSION="0" \ - HOST_LOADLIBES="-L$(STAGING_DIR_HOST)/lib" \ - CONFIG_SHELL="$(BASH)" \ - $(if $(findstring c,$(OPENWRT_VERBOSE)),V=1,V='') \ - $(if $(PKG_BUILD_ID),LDFLAGS_MODULE=--build-id=0x$(PKG_BUILD_ID)) \ - cmd_syscalls= - - -ifeq ($(call qstrip,$(CONFIG_EXTERNAL_KERNEL_TREE))$(call qstrip,$(CONFIG_KERNEL_GIT_CLONE_URI)),) - KERNEL_MAKEOPTS += \ - KERNELRELEASE=$(LINUX_VERSION) -endif - ifdef CONFIG_STRIP_KERNEL_EXPORTS KERNEL_MAKEOPTS += \ EXTRA_LDSFLAGS="-I$(KERNEL_BUILD_DIR) -include symtab.h" @@ -43,10 +22,6 @@ ifneq (,$(KERNEL_CC)) KERNEL_MAKEOPTS += CC="$(KERNEL_CC)" endif -ifdef CONFIG_USE_SPARSE - KERNEL_MAKEOPTS += C=1 CHECK=$(STAGING_DIR_HOST)/bin/sparse -endif - export HOST_EXTRACFLAGS=-I$(STAGING_DIR_HOST)/include # defined in quilt.mk @@ -127,7 +102,7 @@ define Kernel/Configure/Default cp $(LINUX_DIR)/.config.set $(LINUX_DIR)/.config; \ cp $(LINUX_DIR)/.config.set $(LINUX_DIR)/.config.prev; \ } - $(_SINGLE) [ -d $(LINUX_DIR)/user_headers ] || $(MAKE) $(KERNEL_MAKEOPTS) INSTALL_HDR_PATH=$(LINUX_DIR)/user_headers headers_install + $(_SINGLE) [ -d $(LINUX_DIR)/user_headers ] || $(KERNEL_MAKE) INSTALL_HDR_PATH=$(LINUX_DIR)/user_headers headers_install grep '=[ym]' $(LINUX_DIR)/.config.set | LC_ALL=C sort | mkhash md5 > $(LINUX_DIR)/.vermagic endef @@ -137,7 +112,7 @@ endef define Kernel/CompileModules/Default rm -f $(LINUX_DIR)/vmlinux $(LINUX_DIR)/System.map - +$(MAKE) $(KERNEL_MAKEOPTS) modules + +$(KERNEL_MAKE) modules endef OBJCOPY_STRIP = -R .reginfo -R .notes -R .note -R .comment -R .mdebug -R .note.gnu.build-id @@ -161,7 +136,7 @@ endef define Kernel/CompileImage/Default rm -f $(TARGET_DIR)/init - +$(MAKE) $(KERNEL_MAKEOPTS) $(if $(KERNELNAME),$(KERNELNAME),all) modules + +$(KERNEL_MAKE) $(if $(KERNELNAME),$(KERNELNAME),all) modules $(call Kernel/CopyImage) endef @@ -170,7 +145,7 @@ define Kernel/CompileImage/Initramfs $(call Kernel/Configure/Initramfs) $(CP) $(GENERIC_PLATFORM_DIR)/other-files/init $(TARGET_DIR)/init rm -rf $(KERNEL_BUILD_DIR)/linux-$(LINUX_VERSION)/usr/initramfs_data.cpio* - +$(MAKE) $(KERNEL_MAKEOPTS) $(if $(KERNELNAME),$(KERNELNAME),all) modules + +$(KERNEL_MAKE) $(if $(KERNELNAME),$(KERNELNAME),all) modules $(call Kernel/CopyImage,-initramfs) endef else |