aboutsummaryrefslogtreecommitdiffstats
path: root/include/kernel.mk
diff options
context:
space:
mode:
Diffstat (limited to 'include/kernel.mk')
-rw-r--r--include/kernel.mk29
1 files changed, 29 insertions, 0 deletions
diff --git a/include/kernel.mk b/include/kernel.mk
index 9c01d5f2c8..effece2869 100644
--- a/include/kernel.mk
+++ b/include/kernel.mk
@@ -87,6 +87,35 @@ else
LINUX_KARCH := $(ARCH)
endif
+KERNEL_MAKE = $(MAKE) $(KERNEL_MAKEOPTS)
+
+KERNEL_MAKE_FLAGS := \
+ 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)) \
+ KERNELRELEASE=$(LINUX_VERSION) \
+ cmd_syscalls=
+
+ifeq ($(call qstrip,$(CONFIG_EXTERNAL_KERNEL_TREE))$(call qstrip,$(CONFIG_KERNEL_GIT_CLONE_URI)),)
+ KERNEL_MAKEOPTS += \
+ KERNELRELEASE=$(LINUX_VERSION)
+endif
+
+KERNEL_MAKEOPTS := -C $(LINUX_DIR) $(KERNEL_MAKE_FLAGS)
+
+ifdef CONFIG_USE_SPARSE
+ KERNEL_MAKEOPTS += C=1 CHECK=$(STAGING_DIR_HOST)/bin/sparse
+endif
+
define KernelPackage/Defaults
FILES:=
AUTOLOAD:=