summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2006-10-19 06:20:55 +0000
committerFelix Fietkau <nbd@openwrt.org>2006-10-19 06:20:55 +0000
commit2665d7f09e8f1b23744fd19243b2747f654e4656 (patch)
tree76e80a9a7acecc3dd2b4c9129323a3311284745f
parentae439d6682f238bcff9c23a88aabc7b3689c0db5 (diff)
downloadmtk-20170518-2665d7f09e8f1b23744fd19243b2747f654e4656.zip
mtk-20170518-2665d7f09e8f1b23744fd19243b2747f654e4656.tar.gz
mtk-20170518-2665d7f09e8f1b23744fd19243b2747f654e4656.tar.bz2
cleanup/rewrite of the kernel build process
SVN-Revision: 5226
-rw-r--r--include/kernel-build.mk182
-rw-r--r--include/kernel.mk9
-rw-r--r--target/linux/Makefile1
-rw-r--r--target/linux/ar531x-2.4/Makefile9
-rw-r--r--target/linux/ar7-2.4/Makefile9
-rw-r--r--target/linux/aruba-2.6/Makefile9
-rw-r--r--target/linux/au1000-2.6/Makefile14
-rw-r--r--target/linux/brcm-2.4/Makefile9
-rw-r--r--target/linux/brcm-2.6/Makefile9
-rw-r--r--target/linux/brcm63xx-2.6/Makefile10
-rw-r--r--target/linux/magicbox-2.6/Makefile9
-rw-r--r--target/linux/rb532-2.6/Makefile9
-rw-r--r--target/linux/rdc-2.6/Makefile8
-rw-r--r--target/linux/sibyte-2.6/Makefile9
-rw-r--r--target/linux/uml-2.6/Makefile8
-rw-r--r--target/linux/x86-2.6/Makefile8
-rw-r--r--target/linux/xscale-2.6/Makefile8
17 files changed, 137 insertions, 183 deletions
diff --git a/include/kernel-build.mk b/include/kernel-build.mk
index 04c3c7f..8420c83 100644
--- a/include/kernel-build.mk
+++ b/include/kernel-build.mk
@@ -10,11 +10,13 @@ include $(INCLUDE_DIR)/host.mk
include $(INCLUDE_DIR)/kernel.mk
LINUX_SOURCE:=linux-$(LINUX_VERSION).tar.bz2
-LINUX_SITE=http://www.us.kernel.org/pub/linux/kernel/v$(KERNEL) \
+LINUX_SITE:=http://www.us.kernel.org/pub/linux/kernel/v$(KERNEL) \
http://www.us.kernel.org/pub/linux/kernel/v$(KERNEL) \
http://www.kernel.org/pub/linux/kernel/v$(KERNEL) \
http://www.de.kernel.org/pub/linux/kernel/v$(KERNEL)
+LINUX_CONFIG:=./config
+
ifneq (,$(findstring uml,$(BOARD)))
LINUX_KARCH:=um
else
@@ -36,93 +38,139 @@ ifneq (,$(findstring ppc,$(BOARD)))
endif
-$(DL_DIR)/$(LINUX_SOURCE):
- -mkdir -p $(DL_DIR)
- $(SCRIPT_DIR)/download.pl $(DL_DIR) $(LINUX_SOURCE) $(LINUX_KERNEL_MD5SUM) $(LINUX_SITE)
-
-$(LINUX_DIR)/.unpacked: $(DL_DIR)/$(LINUX_SOURCE)
- -mkdir -p $(KERNEL_BUILD_DIR)
+define Kernel/Prepare/Default
bzcat $(DL_DIR)/$(LINUX_SOURCE) | tar -C $(KERNEL_BUILD_DIR) $(TAR_OPTIONS)
- touch $@
+ [ -d ../generic-$(KERNEL)/patches ] && $(PATCH) $(LINUX_DIR) ../generic-$(KERNEL)/patches
+ [ -d ./patches ] && $(PATCH) $(LINUX_DIR) ./patches
+endef
+define Kernel/Prepare
+ $(call Kernel/Prepare/Default)
+endef
-ifeq ($(KERNEL),2.4)
-$(LINUX_DIR)/.configured: $(LINUX_DIR)/.patched $(LINUX_DIR)/.config
+
+define Kernel/Configure/2.4
$(SED) "s,\-mcpu=,\-mtune=,g;" $(LINUX_DIR)/arch/mips/Makefile
$(MAKE) -C $(LINUX_DIR) CROSS_COMPILE="$(KERNEL_CROSS)" CC="$(KERNEL_CC)" ARCH=$(LINUX_KARCH) oldconfig include/linux/compile.h include/linux/version.h
- touch $@
-
-$(LINUX_DIR)/.depend_done: $(LINUX_DIR)/.configured
$(MAKE) -C $(LINUX_DIR) CROSS_COMPILE="$(KERNEL_CROSS)" ARCH=$(LINUX_KARCH) dep
- touch $@
-
-$(LINUX_DIR)/vmlinux: $(LINUX_DIR)/.depend_done
-else
-$(LINUX_DIR)/.configured: $(LINUX_DIR)/.patched
+endef
+define Kernel/Configure/2.6
$(MAKE) -C $(LINUX_DIR) CROSS_COMPILE="$(KERNEL_CROSS)" CC="$(KERNEL_CC)" ARCH=$(LINUX_KARCH) oldconfig prepare scripts
- touch $@
-endif
+endef
+define Kernel/Configure/Default
+ @$(CP) $(LINUX_CONFIG) $(LINUX_DIR)/.config
+ $(call Kernel/Configure/$(KERNEL))
+endef
+define Kernel/Configure
+ $(call Kernel/Configure/Default)
+endef
-ramdisk-config: $(LINUX_DIR)/.configured FORCE
- mv $(LINUX_DIR)/.config $(LINUX_DIR)/.config.old
- grep -v INITRAMFS $(LINUX_DIR)/.config.old > $(LINUX_DIR)/.config
-ifeq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),y)
- echo 'CONFIG_INITRAMFS_SOURCE="../../root"' >> $(LINUX_DIR)/.config
- echo 'CONFIG_INITRAMFS_ROOT_UID=0' >> $(LINUX_DIR)/.config
- echo 'CONFIG_INITRAMFS_ROOT_GID=0' >> $(LINUX_DIR)/.config
- mkdir -p $(BUILD_DIR)/root/etc/init.d
- $(CP) ../generic-2.6/files/init $(BUILD_DIR)/root/
-else
- rm -f $(BUILD_DIR)/root/init $(BUILD_DIR)/root/etc/init.d/S00initramfs
- echo 'CONFIG_INITRAMFS_SOURCE=""' >> $(LINUX_DIR)/.config
-endif
-$(LINUX_DIR)/vmlinux: ramdisk-config
+define Kernel/CompileModules/Default
+ $(MAKE) -j$(CONFIG_JLEVEL) -C "$(LINUX_DIR)" CROSS_COMPILE="$(KERNEL_CROSS)" CC="$(KERNEL_CC)" ARCH=$(LINUX_KARCH) modules
+ $(MAKE) -C "$(LINUX_DIR)" CROSS_COMPILE="$(KERNEL_CROSS)" CC="$(KERNEL_CC)" ARCH=$(LINUX_KARCH) DEPMOD=true INSTALL_MOD_PATH=$(KERNEL_BUILD_DIR)/modules modules_install
+endef
+define Kernel/CompileModules
+ $(call Kernel/CompileModules/Default)
+endef
+
+
+ifeq ($(KERNEL),2.6)
+ ifeq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),y)
+ define Kernel/SetInitramfs
+ mv $(LINUX_DIR)/.config $(LINUX_DIR)/.config.old
+ grep -v INITRAMFS $(LINUX_DIR)/.config.old > $(LINUX_DIR)/.config
+ echo 'CONFIG_INITRAMFS_SOURCE="../../root"' >> $(LINUX_DIR)/.config
+ echo 'CONFIG_INITRAMFS_ROOT_UID=0' >> $(LINUX_DIR)/.config
+ echo 'CONFIG_INITRAMFS_ROOT_GID=0' >> $(LINUX_DIR)/.config
+ mkdir -p $(BUILD_DIR)/root/etc/init.d
+ $(CP) ../generic-2.6/files/init $(BUILD_DIR)/root/
+ endef
+ else
+ define Kernel/SetInitramfs
+ mv $(LINUX_DIR)/.config $(LINUX_DIR)/.config.old
+ grep -v INITRAMFS $(LINUX_DIR)/.config.old > $(LINUX_DIR)/.config
+ rm -f $(BUILD_DIR)/root/init $(BUILD_DIR)/root/etc/init.d/S00initramfs
+ echo 'CONFIG_INITRAMFS_SOURCE=""' >> $(LINUX_DIR)/.config
+ endef
+ endif
+endif
+define Kernel/CompileImage/Default
+ $(call Kernel/SetInitramfs)
$(MAKE) -j$(CONFIG_JLEVEL) -C $(LINUX_DIR) CROSS_COMPILE="$(KERNEL_CROSS)" CC="$(KERNEL_CC)" ARCH=$(LINUX_KARCH) $(KERNELNAME)
+ $(KERNEL_CROSS)objcopy -O binary -R .reginfo -R .note -R .comment -R .mdebug -S $(LINUX_DIR)/vmlinux $(LINUX_KERNEL)
+endef
+define Kernel/CompileImage
+ $(call Kernel/CompileImage/Default)
+endef
-$(LINUX_KERNEL): $(LINUX_DIR)/vmlinux
- $(KERNEL_CROSS)objcopy -O binary -R .reginfo -R .note -R .comment -R .mdebug -S $< $@
- touch -c $(LINUX_KERNEL)
+define Kernel/Clean/Default
+ rm -f $(LINUX_DIR)/.linux-compile
+ rm -f $(KERNEL_BUILD_DIR)/linux-$(LINUX_VERSION)/.configured
+ rm -f $(LINUX_KERNEL)
+ $(MAKE) -C $(KERNEL_BUILD_DIR)/linux-$(LINUX_VERSION) clean
+endef
-$(LINUX_DIR)/.modules_done: $(LINUX_DIR)/.config
- rm -rf $(KERNEL_BUILD_DIR)/modules
- $(MAKE) -j$(CONFIG_JLEVEL) -C "$(LINUX_DIR)" CROSS_COMPILE="$(KERNEL_CROSS)" CC="$(KERNEL_CC)" ARCH=$(LINUX_KARCH) modules
- $(MAKE) -C "$(LINUX_DIR)" CROSS_COMPILE="$(KERNEL_CROSS)" CC="$(KERNEL_CC)" ARCH=$(LINUX_KARCH) DEPMOD=true INSTALL_MOD_PATH=$(KERNEL_BUILD_DIR)/modules modules_install
- touch $(LINUX_DIR)/.modules_done
+define Kernel/Clean
+ $(call Kernel/Clean/Default)
+endef
+
+define BuildKernel
+ ifneq ($(LINUX_SITE),)
+ $(DL_DIR)/$(LINUX_SOURCE):
+ -mkdir -p $(DL_DIR)
+ $(SCRIPT_DIR)/download.pl $(DL_DIR) $(LINUX_SOURCE) $(LINUX_KERNEL_MD5SUM) $(LINUX_SITE)
+ endif
+
+ $(LINUX_DIR)/.prepared: $(DL_DIR)/$(LINUX_SOURCE)
+ -rm -rf $(KERNEL_BUILD_DIR)
+ -mkdir -p $(KERNEL_BUILD_DIR)
+ $(call Kernel/Prepare)
+ touch $$@
+
+ $(LINUX_DIR)/.configured: $(LINUX_DIR)/.prepared $(LINUX_CONFIG)
+ $(call Kernel/Configure)
+ touch $$@
-$(LINUX_DIR)/.linux-compile: $(LINUX_DIR)/.modules_done
+ $(LINUX_DIR)/.modules: $(LINUX_DIR)/.configured
+ rm -rf $(KERNEL_BUILD_DIR)/modules
@rm -f $(BUILD_DIR)/linux
ln -sf $(KERNEL_BUILD_DIR)/linux-$(LINUX_VERSION) $(BUILD_DIR)/linux
- touch $@
+ $(call Kernel/CompileModules)
+ touch $$@
-$(TOPDIR)/.kernel.mk: $(TOPDIR)/target/linux/$(BOARD)-$(KERNEL)/Makefile
- echo "CONFIG_BOARD:=$(BOARD)" > $@
- echo "CONFIG_KERNEL:=$(KERNEL)" >> $@
- echo "CONFIG_LINUX_VERSION:=$(LINUX_VERSION)" >> $@
- echo "CONFIG_LINUX_RELEASE:=$(LINUX_RELEASE)" >> $@
- echo "CONFIG_LINUX_KARCH:=$(LINUX_KARCH)" >> $@
+ $(LINUX_DIR)/.image: $(LINUX_DIR)/.configured FORCE
+ $(call Kernel/CompileImage)
+ touch $$@
+
+ mostlyclean: FORCE
+ $(call Kernel/Clean)
-download: $(DL_DIR)/$(LINUX_SOURCE)
-prepare: $(LINUX_DIR)/.configured
- @mkdir -p $(LINUX_DIR)
+ define BuildKernel
+ endef
+endef
-compile: prepare $(LINUX_DIR)/.linux-compile
-install: compile $(LINUX_KERNEL)
-mostlyclean: FORCE
- rm -f $(LINUX_DIR)/.linux-compile
- rm -f $(KERNEL_BUILD_DIR)/linux-$(LINUX_VERSION)/.modules_done
- rm -f $(KERNEL_BUILD_DIR)/linux-$(LINUX_VERSION)/.drivers-unpacked
- $(MAKE) -C $(KERNEL_BUILD_DIR)/linux-$(LINUX_VERSION) clean
- rm -f $(LINUX_KERNEL)
+download: $(DL_DIR)/$(LINUX_SOURCE)
+prepare: $(LINUX_DIR)/.configured $(TOPDIR)/.kernel.mk
+compile: $(LINUX_DIR)/.modules
+install: $(LINUX_DIR)/.image
+
+clean: FORCE
+ rm -f $(STAMP_DIR)/.linux-compile
+ rm -rf $(KERNEL_BUILD_DIR)
rebuild: FORCE
- -$(MAKE) mostlyclean
- if [ -f $(LINUX_KERNEL) ]; then \
+ @$(MAKE) mostlyclean
+ @if [ -f $(LINUX_KERNEL) ]; then \
$(MAKE) clean; \
fi
- $(MAKE) compile $(MAKE_TRACE)
+ @$(MAKE) compile
+
+$(TOPDIR)/.kernel.mk: Makefile
+ echo "CONFIG_BOARD:=$(BOARD)" > $@
+ echo "CONFIG_KERNEL:=$(KERNEL)" >> $@
+ echo "CONFIG_LINUX_VERSION:=$(LINUX_VERSION)" >> $@
+ echo "CONFIG_LINUX_RELEASE:=$(LINUX_RELEASE)" >> $@
+ echo "CONFIG_LINUX_KARCH:=$(LINUX_KARCH)" >> $@
-clean: FORCE
- rm -f $(STAMP_DIR)/.linux-compile
- rm -rf $(KERNEL_BUILD_DIR)
diff --git a/include/kernel.mk b/include/kernel.mk
index 42c9cdf..1ab85d4 100644
--- a/include/kernel.mk
+++ b/include/kernel.mk
@@ -18,12 +18,11 @@ else
LINUX_VERSION:=$(CONFIG_LINUX_VERSION)
LINUX_RELEASE:=$(CONFIG_LINUX_RELEASE)
LINUX_KARCH:=$(CONFIG_LINUX_KARCH)
- else
- # oops, old .kernel.config; rebuild it (hiding the misleading errors this produces)
- $(warning rebuilding .kernel.mk)
- $(TOPDIR)/.kernel.mk: FORCE
+ else
ifneq ($(KERNEL_BUILD),1)
- $(TOPDIR)/.kernel.mk:
+ # oops, old .kernel.config; rebuild it (hiding the misleading errors this produces)
+ $(warning rebuilding .kernel.mk)
+ $(TOPDIR)/.kernel.mk: FORCE
@$(MAKE) -C $(TOPDIR)/target/linux/$(BOARD)-$(KERNEL) $@ &>/dev/null
endif
endif
diff --git a/target/linux/Makefile b/target/linux/Makefile
index 8682fc2..2a9cf7d 100644
--- a/target/linux/Makefile
+++ b/target/linux/Makefile
@@ -11,7 +11,6 @@ download:
$(MAKE) -C $(BOARD)-$(KERNEL) download
prepare:
- rm -f $(TOPDIR)/.kernel.mk
$(MAKE) -C $(BOARD)-$(KERNEL) prepare
compile:
diff --git a/target/linux/ar531x-2.4/Makefile b/target/linux/ar531x-2.4/Makefile
index 14b73f8..e15eb09 100644
--- a/target/linux/ar531x-2.4/Makefile
+++ b/target/linux/ar531x-2.4/Makefile
@@ -10,12 +10,5 @@ LINUX_VERSION:=2.4.32
LINUX_RELEASE:=1
LINUX_KERNEL_MD5SUM:=38f4d0830e95a20f4bfed17622d5557c
-include ./config
include $(INCLUDE_DIR)/kernel-build.mk
-
-$(LINUX_DIR)/.patched: $(LINUX_DIR)/.unpacked
- [ -d ../generic-$(KERNEL)/patches ] && $(PATCH) $(LINUX_DIR) ../generic-$(KERNEL)/patches
- [ -d ./patches ] && $(PATCH) $(LINUX_DIR) ./patches
- @$(CP) config $(LINUX_DIR)/.config
- touch $@
-
+$(eval $(call BuildKernel))
diff --git a/target/linux/ar7-2.4/Makefile b/target/linux/ar7-2.4/Makefile
index b220b4c..e15eb09 100644
--- a/target/linux/ar7-2.4/Makefile
+++ b/target/linux/ar7-2.4/Makefile
@@ -10,12 +10,5 @@ LINUX_VERSION:=2.4.32
LINUX_RELEASE:=1
LINUX_KERNEL_MD5SUM:=38f4d0830e95a20f4bfed17622d5557c
-include ./config
include $(INCLUDE_DIR)/kernel-build.mk
-
-$(LINUX_DIR)/.patched: $(LINUX_DIR)/.unpacked
- [ -d ../generic-$(KERNEL)/patches ] && $(PATCH) $(LINUX_DIR) ../generic-$(KERNEL)/patches
- [ -d ./patches ] && $(PATCH) $(LINUX_DIR) ./patches
- @$(CP) config $(LINUX_DIR)/.config
- touch $@
-
+$(eval $(call BuildKernel))
diff --git a/target/linux/aruba-2.6/Makefile b/target/linux/aruba-2.6/Makefile
index b10715a..323eb2c 100644
--- a/target/linux/aruba-2.6/Makefile
+++ b/target/linux/aruba-2.6/Makefile
@@ -10,12 +10,5 @@ LINUX_VERSION:=2.6.17
LINUX_RELEASE:=1
LINUX_KERNEL_MD5SUM:=37ddefe96625502161f075b9d907f21e
-include ./config
include $(INCLUDE_DIR)/kernel-build.mk
-
-$(LINUX_DIR)/.patched: $(LINUX_DIR)/.unpacked
- [ -d ../generic-$(KERNEL)/patches ] && $(PATCH) $(LINUX_DIR) ../generic-$(KERNEL)/patches $(MAKE_TRACE)
- [ -d ./patches ] && $(PATCH) $(LINUX_DIR) ./patches $(MAKE_TRACE)
- @$(CP) config $(LINUX_DIR)/.config
- touch $@
-
+$(eval $(call BuildKernel))
diff --git a/target/linux/au1000-2.6/Makefile b/target/linux/au1000-2.6/Makefile
index ca85b73..62d9acb 100644
--- a/target/linux/au1000-2.6/Makefile
+++ b/target/linux/au1000-2.6/Makefile
@@ -10,17 +10,13 @@ LINUX_VERSION:=2.6.17
LINUX_RELEASE:=1
LINUX_KERNEL_MD5SUM:=37ddefe96625502161f075b9d907f21e
-include ./config
include $(INCLUDE_DIR)/kernel-build.mk
-$(LINUX_DIR)/.patched: $(LINUX_DIR)/.unpacked
- [ -d ../generic-$(KERNEL)/patches ] && $(PATCH) $(LINUX_DIR) ../generic-$(KERNEL)/patches
- [ -d ./patches ] && $(PATCH) $(LINUX_DIR) ./patches
- @$(CP) config $(LINUX_DIR)/.config
- touch $@
-
-$(LINUX_BUILD_DIR)/zImage.flash.srec: $(LINUX_DIR)/vmlinux
+define Kernel/BuildImage
+ $(call Kernel/BuildImage/Default)
$(CP) $(LINUX_DIR)/arch/mips/boot/compressed/images/zImage.flash.srec $(LINUX_DIR)/zImage.flash.srec
$(CP) $(LINUX_DIR)/arch/mips/boot/compressed/images/zImage.srec $(LINUX_DIR)/zImage.srec
+endef
+
+$(eval $(call BuildKernel))
-compile: $(LINUX_BUILD_DIR)/zImage.flash.srec
diff --git a/target/linux/brcm-2.4/Makefile b/target/linux/brcm-2.4/Makefile
index 14b73f8..e15eb09 100644
--- a/target/linux/brcm-2.4/Makefile
+++ b/target/linux/brcm-2.4/Makefile
@@ -10,12 +10,5 @@ LINUX_VERSION:=2.4.32
LINUX_RELEASE:=1
LINUX_KERNEL_MD5SUM:=38f4d0830e95a20f4bfed17622d5557c
-include ./config
include $(INCLUDE_DIR)/kernel-build.mk
-
-$(LINUX_DIR)/.patched: $(LINUX_DIR)/.unpacked
- [ -d ../generic-$(KERNEL)/patches ] && $(PATCH) $(LINUX_DIR) ../generic-$(KERNEL)/patches
- [ -d ./patches ] && $(PATCH) $(LINUX_DIR) ./patches
- @$(CP) config $(LINUX_DIR)/.config
- touch $@
-
+$(eval $(call BuildKernel))
diff --git a/target/linux/brcm-2.6/Makefile b/target/linux/brcm-2.6/Makefile
index 178a2a7..b2e53bb 100644
--- a/target/linux/brcm-2.6/Makefile
+++ b/target/linux/brcm-2.6/Makefile
@@ -10,13 +10,6 @@ LINUX_VERSION:=2.6.17
LINUX_RELEASE:=1
LINUX_KERNEL_MD5SUM:=37ddefe96625502161f075b9d907f21e
-include ./config
include $(INCLUDE_DIR)/kernel-build.mk
-
-$(LINUX_DIR)/.patched: $(LINUX_DIR)/.unpacked
- [ -d ../generic-$(KERNEL)/patches ] && $(PATCH) $(LINUX_DIR) ../generic-$(KERNEL)/patches $(MAKE_TRACE)
- [ -d ./patches ] && $(PATCH) $(LINUX_DIR) ./patches $(MAKE_TRACE)
- @$(CP) config $(LINUX_DIR)/.config
- touch $@
-
+$(eval $(call BuildKernel))
diff --git a/target/linux/brcm63xx-2.6/Makefile b/target/linux/brcm63xx-2.6/Makefile
index 178a2a7..323eb2c 100644
--- a/target/linux/brcm63xx-2.6/Makefile
+++ b/target/linux/brcm63xx-2.6/Makefile
@@ -10,13 +10,5 @@ LINUX_VERSION:=2.6.17
LINUX_RELEASE:=1
LINUX_KERNEL_MD5SUM:=37ddefe96625502161f075b9d907f21e
-include ./config
include $(INCLUDE_DIR)/kernel-build.mk
-
-
-$(LINUX_DIR)/.patched: $(LINUX_DIR)/.unpacked
- [ -d ../generic-$(KERNEL)/patches ] && $(PATCH) $(LINUX_DIR) ../generic-$(KERNEL)/patches $(MAKE_TRACE)
- [ -d ./patches ] && $(PATCH) $(LINUX_DIR) ./patches $(MAKE_TRACE)
- @$(CP) config $(LINUX_DIR)/.config
- touch $@
-
+$(eval $(call BuildKernel))
diff --git a/target/linux/magicbox-2.6/Makefile b/target/linux/magicbox-2.6/Makefile
index b10715a..323eb2c 100644
--- a/target/linux/magicbox-2.6/Makefile
+++ b/target/linux/magicbox-2.6/Makefile
@@ -10,12 +10,5 @@ LINUX_VERSION:=2.6.17
LINUX_RELEASE:=1
LINUX_KERNEL_MD5SUM:=37ddefe96625502161f075b9d907f21e
-include ./config
include $(INCLUDE_DIR)/kernel-build.mk
-
-$(LINUX_DIR)/.patched: $(LINUX_DIR)/.unpacked
- [ -d ../generic-$(KERNEL)/patches ] && $(PATCH) $(LINUX_DIR) ../generic-$(KERNEL)/patches $(MAKE_TRACE)
- [ -d ./patches ] && $(PATCH) $(LINUX_DIR) ./patches $(MAKE_TRACE)
- @$(CP) config $(LINUX_DIR)/.config
- touch $@
-
+$(eval $(call BuildKernel))
diff --git a/target/linux/rb532-2.6/Makefile b/target/linux/rb532-2.6/Makefile
index 4daa728..323eb2c 100644
--- a/target/linux/rb532-2.6/Makefile
+++ b/target/linux/rb532-2.6/Makefile
@@ -10,12 +10,5 @@ LINUX_VERSION:=2.6.17
LINUX_RELEASE:=1
LINUX_KERNEL_MD5SUM:=37ddefe96625502161f075b9d907f21e
-include ./config
include $(INCLUDE_DIR)/kernel-build.mk
-
-$(LINUX_DIR)/.patched: $(LINUX_DIR)/.unpacked
- [ -d ../generic-$(KERNEL)/patches ] && $(PATCH) $(LINUX_DIR) ../generic-$(KERNEL)/patches
- [ -d ./patches ] && $(PATCH) $(LINUX_DIR) ./patches
- @$(CP) config $(LINUX_DIR)/.config
- touch $@
-
+$(eval $(call BuildKernel))
diff --git a/target/linux/rdc-2.6/Makefile b/target/linux/rdc-2.6/Makefile
index 5dc19cf..323eb2c 100644
--- a/target/linux/rdc-2.6/Makefile
+++ b/target/linux/rdc-2.6/Makefile
@@ -10,11 +10,5 @@ LINUX_VERSION:=2.6.17
LINUX_RELEASE:=1
LINUX_KERNEL_MD5SUM:=37ddefe96625502161f075b9d907f21e
-include ./config
include $(INCLUDE_DIR)/kernel-build.mk
-
-$(LINUX_DIR)/.patched: $(LINUX_DIR)/.unpacked
- [ -d ../generic-$(KERNEL)/patches ] && $(PATCH) $(LINUX_DIR) ../generic-$(KERNEL)/patches
- [ -d ./patches ] && $(PATCH) $(LINUX_DIR) ./patches
- @$(CP) config $(LINUX_DIR)/.config
- touch $@
+$(eval $(call BuildKernel))
diff --git a/target/linux/sibyte-2.6/Makefile b/target/linux/sibyte-2.6/Makefile
index 4daa728..323eb2c 100644
--- a/target/linux/sibyte-2.6/Makefile
+++ b/target/linux/sibyte-2.6/Makefile
@@ -10,12 +10,5 @@ LINUX_VERSION:=2.6.17
LINUX_RELEASE:=1
LINUX_KERNEL_MD5SUM:=37ddefe96625502161f075b9d907f21e
-include ./config
include $(INCLUDE_DIR)/kernel-build.mk
-
-$(LINUX_DIR)/.patched: $(LINUX_DIR)/.unpacked
- [ -d ../generic-$(KERNEL)/patches ] && $(PATCH) $(LINUX_DIR) ../generic-$(KERNEL)/patches
- [ -d ./patches ] && $(PATCH) $(LINUX_DIR) ./patches
- @$(CP) config $(LINUX_DIR)/.config
- touch $@
-
+$(eval $(call BuildKernel))
diff --git a/target/linux/uml-2.6/Makefile b/target/linux/uml-2.6/Makefile
index 5dc19cf..323eb2c 100644
--- a/target/linux/uml-2.6/Makefile
+++ b/target/linux/uml-2.6/Makefile
@@ -10,11 +10,5 @@ LINUX_VERSION:=2.6.17
LINUX_RELEASE:=1
LINUX_KERNEL_MD5SUM:=37ddefe96625502161f075b9d907f21e
-include ./config
include $(INCLUDE_DIR)/kernel-build.mk
-
-$(LINUX_DIR)/.patched: $(LINUX_DIR)/.unpacked
- [ -d ../generic-$(KERNEL)/patches ] && $(PATCH) $(LINUX_DIR) ../generic-$(KERNEL)/patches
- [ -d ./patches ] && $(PATCH) $(LINUX_DIR) ./patches
- @$(CP) config $(LINUX_DIR)/.config
- touch $@
+$(eval $(call BuildKernel))
diff --git a/target/linux/x86-2.6/Makefile b/target/linux/x86-2.6/Makefile
index 5dc19cf..323eb2c 100644
--- a/target/linux/x86-2.6/Makefile
+++ b/target/linux/x86-2.6/Makefile
@@ -10,11 +10,5 @@ LINUX_VERSION:=2.6.17
LINUX_RELEASE:=1
LINUX_KERNEL_MD5SUM:=37ddefe96625502161f075b9d907f21e
-include ./config
include $(INCLUDE_DIR)/kernel-build.mk
-
-$(LINUX_DIR)/.patched: $(LINUX_DIR)/.unpacked
- [ -d ../generic-$(KERNEL)/patches ] && $(PATCH) $(LINUX_DIR) ../generic-$(KERNEL)/patches
- [ -d ./patches ] && $(PATCH) $(LINUX_DIR) ./patches
- @$(CP) config $(LINUX_DIR)/.config
- touch $@
+$(eval $(call BuildKernel))
diff --git a/target/linux/xscale-2.6/Makefile b/target/linux/xscale-2.6/Makefile
index 5dc19cf..323eb2c 100644
--- a/target/linux/xscale-2.6/Makefile
+++ b/target/linux/xscale-2.6/Makefile
@@ -10,11 +10,5 @@ LINUX_VERSION:=2.6.17
LINUX_RELEASE:=1
LINUX_KERNEL_MD5SUM:=37ddefe96625502161f075b9d907f21e
-include ./config
include $(INCLUDE_DIR)/kernel-build.mk
-
-$(LINUX_DIR)/.patched: $(LINUX_DIR)/.unpacked
- [ -d ../generic-$(KERNEL)/patches ] && $(PATCH) $(LINUX_DIR) ../generic-$(KERNEL)/patches
- [ -d ./patches ] && $(PATCH) $(LINUX_DIR) ./patches
- @$(CP) config $(LINUX_DIR)/.config
- touch $@
+$(eval $(call BuildKernel))