From 149f511995d263e7596b9a75e85d11e2ff171bf0 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Thu, 20 Aug 2015 08:16:02 +0200 Subject: we need to check if any kernel modules are used, otherwise build breaks --- mk/kernel-build.mk | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'mk') diff --git a/mk/kernel-build.mk b/mk/kernel-build.mk index d26d51e85..14e26fbb3 100644 --- a/mk/kernel-build.mk +++ b/mk/kernel-build.mk @@ -2,9 +2,11 @@ # material, please see the LICENCE file in the top-level directory. include $(ADK_TOPDIR)/rules.mk -include ${ADK_TOPDIR}/mk/kernel-ver.mk +include $(ADK_TOPDIR)/mk/kernel-ver.mk include $(ADK_TOPDIR)/mk/linux.mk -include ${ADK_TOPDIR}/mk/kernel-vars.mk +include $(ADK_TOPDIR)/mk/kernel-vars.mk + +KERNEL_MODULES_USED:=$(shell grep ^ADK_KERNEL $(ADK_TOPDIR)/.config|grep =m) KERNEL_FILE:=$(ADK_TARGET_KERNEL) KERNEL_TARGET:=$(ADK_TARGET_KERNEL) @@ -47,10 +49,12 @@ $(LINUX_DIR)/.config: $(LINUX_DIR)/.prepared $(BUILD_DIR)/.kernelconfig $(LINUX_DIR)/$(KERNEL_FILE): $(LINUX_DIR)/.config $(TRACE) target/$(ADK_TARGET_ARCH)-kernel-compile - ${KERNEL_MAKE_ENV} $(MAKE) -C "${LINUX_DIR}" ${KERNEL_MAKE_OPTS} -j${ADK_MAKE_JOBS} LOCALVERSION="" $(KERNEL_TARGET) modules $(MAKE_TRACE) + ${KERNEL_MAKE_ENV} $(MAKE) -C "${LINUX_DIR}" ${KERNEL_MAKE_OPTS} -j${ADK_MAKE_JOBS} LOCALVERSION="" $(KERNEL_TARGET) $(MAKE_TRACE) touch -c $(LINUX_DIR)/$(KERNEL_FILE) $(LINUX_BUILD_DIR)/modules: $(LINUX_DIR)/$(KERNEL_FILE) + $(TRACE) target/$(ADK_TARGET_ARCH)-kernel-modules-compile + ${KERNEL_MAKE_ENV} $(MAKE) -C "${LINUX_DIR}" ${KERNEL_MAKE_OPTS} -j${ADK_MAKE_JOBS} LOCALVERSION="" modules $(MAKE_TRACE) $(TRACE) target/$(ADK_TARGET_ARCH)-kernel-modules-install rm -rf $(LINUX_BUILD_DIR)/modules ${KERNEL_MAKE_ENV} $(MAKE) -C "${LINUX_DIR}" ${KERNEL_MAKE_OPTS} \ @@ -68,7 +72,11 @@ $(LINUX_BUILD_DIR)/modules: $(LINUX_DIR)/$(KERNEL_FILE) "${PACKAGE_DIR}" prepare: +ifneq ($(KERNEL_MODULES_USED),) compile: $(LINUX_BUILD_DIR)/modules +else +compile: $(LINUX_DIR)/$(KERNEL_FILE) +endif install: compile $(TRACE) target/${ADK_TARGET_ARCH}-modules-install ifeq ($(ADK_TARGET_PACKAGE_IPKG)$(ADK_TARGET_PACKAGE_OPKG),y) -- cgit v1.2.3