summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2009-08-27 01:13:19 +0200
committerPhil Sutter <phil@nwl.cc>2009-08-28 23:07:00 +0200
commit0b6742af9d19cc389ed0f0bb08a65e1f84268893 (patch)
tree2a5654d159b1c3ac291d673814f2ed6950d02ac9
parent0a3d29e18ca731cafed7155b73a92a8f2756ca27 (diff)
kernel: simplify ADK_NATIVE test integration
-rw-r--r--mk/kernel-build.mk27
1 files changed, 11 insertions, 16 deletions
diff --git a/mk/kernel-build.mk b/mk/kernel-build.mk
index 04657d906..62c6290b5 100644
--- a/mk/kernel-build.mk
+++ b/mk/kernel-build.mk
@@ -7,6 +7,11 @@ include ${TOPDIR}/mk/buildhlp.mk
KERNEL_IDIR:=$(LINUX_BUILD_DIR)/kernel-ipkg
+KERNEL_MAKE_OPTS:= -C "${LINUX_DIR}" V=1
+ifneq ($(ADK_NATIVE),y)
+KERNEL_MAKE_OPTS+= CROSS_COMPILE="$(KERNEL_CROSS)" ARCH=$(ARCH) CC="$(TARGET_CC)"
+endif
+
$(TOOLCHAIN_BUILD_DIR)/linux-$(KERNEL_VERSION)/.patched:
$(TRACE) target/$(DEVICE)-kernel-patch
$(PATCH) $(TOOLCHAIN_BUILD_DIR)/linux-$(KERNEL_VERSION) ../linux/patches/$(KERNEL_VERSION) *.patch $(MAKE_TRACE)
@@ -23,28 +28,18 @@ $(LINUX_DIR)/.config: $(LINUX_DIR)/.prepared $(BUILD_DIR)/.kernelconfig
$(TRACE) target/$(DEVICE)-kernel-configure
for f in $(TARGETS);do if [ -f $$f ];then rm $$f;fi;done $(MAKE_TRACE)
$(CP) $(BUILD_DIR)/.kernelconfig $(LINUX_DIR)/.config
-ifeq ($(ADK_NATIVE),y)
- echo N | $(MAKE) -C $(LINUX_DIR) oldconfig $(MAKE_TRACE)
- $(MAKE) -C $(LINUX_DIR) V=1 prepare scripts $(MAKE_TRACE)
-else
- echo N | $(MAKE) -C $(LINUX_DIR) CROSS_COMPILE="$(KERNEL_CROSS)" ARCH=$(ARCH) CC="$(TARGET_CC)" oldconfig $(MAKE_TRACE)
- $(MAKE) -C $(LINUX_DIR) V=1 CROSS_COMPILE="$(KERNEL_CROSS)" ARCH=$(ARCH) CC="$(TARGET_CC)" prepare scripts $(MAKE_TRACE)
-endif
+ echo N | $(MAKE) ${KERNEL_MAKE_OPTS} oldconfig $(MAKE_TRACE)
+ $(MAKE) ${KERNEL_MAKE_OPTS} prepare scripts $(MAKE_TRACE)
touch -c $(LINUX_DIR)/.config
$(LINUX_DIR)/vmlinux: $(LINUX_DIR)/.config
$(TRACE) target/$(DEVICE)-kernel-compile
-ifeq ($(ADK_NATIVE),y)
- $(MAKE) -C $(LINUX_DIR) V=1 $(MAKE_TRACE)
+ $(MAKE) ${KERNEL_MAKE_OPTS} $(MAKE_TRACE)
$(TRACE) target/$(DEVICE)-kernel-modules-install
rm -rf $(LINUX_BUILD_DIR)/modules
- $(MAKE) -C "$(LINUX_DIR)" V=1 DEPMOD=true INSTALL_MOD_PATH=$(LINUX_BUILD_DIR)/modules modules_install $(MAKE_TRACE)
-else
- $(MAKE) -C $(LINUX_DIR) V=1 CROSS_COMPILE="$(KERNEL_CROSS)" ARCH=$(ARCH) CC="$(TARGET_CC)" $(MAKE_TRACE)
- $(TRACE) target/$(DEVICE)-kernel-modules-install
- rm -rf $(LINUX_BUILD_DIR)/modules
- $(MAKE) -C "$(LINUX_DIR)" V=1 CROSS_COMPILE="$(KERNEL_CROSS)" ARCH=$(ARCH) DEPMOD=true INSTALL_MOD_PATH=$(LINUX_BUILD_DIR)/modules modules_install $(MAKE_TRACE)
-endif
+ $(MAKE) ${KERNEL_MAKE_OPTS} DEPMOD=true \
+ INSTALL_MOD_PATH=$(LINUX_BUILD_DIR)/modules \
+ modules_install $(MAKE_TRACE)
$(TRACE) target/$(DEVICE)-create-packages
$(MAKE) $(KERNEL_IPKG) $(TARGETS)
touch -c $(LINUX_DIR)/vmlinux