aboutsummaryrefslogtreecommitdiffstats
path: root/include/kernel-defaults.mk
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2016-01-06 18:38:49 +0000
committerFelix Fietkau <nbd@openwrt.org>2016-01-06 18:38:49 +0000
commit4ab26a52ef687a42a318d52440e27d0f5a8d6769 (patch)
tree0c866ef9cc397678a56feabd83a1f80e0e72b729 /include/kernel-defaults.mk
parent947eac1803d631224a9fa6378df3d3409e33be58 (diff)
downloadupstream-4ab26a52ef687a42a318d52440e27d0f5a8d6769.tar.gz
upstream-4ab26a52ef687a42a318d52440e27d0f5a8d6769.tar.bz2
upstream-4ab26a52ef687a42a318d52440e27d0f5a8d6769.zip
build: skip rebuild of kernel images if the source did not change
Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 48145
Diffstat (limited to 'include/kernel-defaults.mk')
-rw-r--r--include/kernel-defaults.mk16
1 files changed, 9 insertions, 7 deletions
diff --git a/include/kernel-defaults.mk b/include/kernel-defaults.mk
index f3b5e421d1..052b2b3a7b 100644
--- a/include/kernel-defaults.mk
+++ b/include/kernel-defaults.mk
@@ -138,13 +138,15 @@ IMAGES_DIR:=../../x86/boot
endif
define Kernel/CopyImage
- $(KERNEL_CROSS)objcopy -O binary $(OBJCOPY_STRIP) -S $(LINUX_DIR)/vmlinux $(LINUX_KERNEL)$(1)
- $(KERNEL_CROSS)objcopy $(OBJCOPY_STRIP) -S $(LINUX_DIR)/vmlinux $(KERNEL_BUILD_DIR)/vmlinux$(1).elf
- $(CP) $(LINUX_DIR)/vmlinux $(KERNEL_BUILD_DIR)/vmlinux.debug
- $(foreach k, \
- $(if $(KERNEL_IMAGES),$(KERNEL_IMAGES),$(filter-out dtbs,$(KERNELNAME))), \
- $(CP) $(LINUX_DIR)/arch/$(LINUX_KARCH)/boot/$(IMAGES_DIR)/$(k) $(KERNEL_BUILD_DIR)/$(k)$(1); \
- )
+ cmp -s $(LINUX_DIR)/vmlinux $(KERNEL_BUILD_DIR)/vmlinux$(1).debug || { \
+ $(KERNEL_CROSS)objcopy -O binary $(OBJCOPY_STRIP) -S $(LINUX_DIR)/vmlinux $(LINUX_KERNEL)$(1); \
+ $(KERNEL_CROSS)objcopy $(OBJCOPY_STRIP) -S $(LINUX_DIR)/vmlinux $(KERNEL_BUILD_DIR)/vmlinux$(1).elf; \
+ $(CP) $(LINUX_DIR)/vmlinux $(KERNEL_BUILD_DIR)/vmlinux$(1).debug; \
+ $(foreach k, \
+ $(if $(KERNEL_IMAGES),$(KERNEL_IMAGES),$(filter-out dtbs,$(KERNELNAME))), \
+ $(CP) $(LINUX_DIR)/arch/$(LINUX_KARCH)/boot/$(IMAGES_DIR)/$(k) $(KERNEL_BUILD_DIR)/$(k)$(1); \
+ ) \
+ }
endef
define Kernel/CompileImage/Default