build: skip rebuild of kernel images if the source did not change
Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 48145
This commit is contained in:
parent
947eac1803
commit
4ab26a52ef
2 changed files with 15 additions and 15 deletions
|
@ -357,7 +357,7 @@ endef
|
||||||
|
|
||||||
define Build/kernel-bin
|
define Build/kernel-bin
|
||||||
rm -f $@
|
rm -f $@
|
||||||
cp $^ $@
|
cp $< $@
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Build/patch-cmdline
|
define Build/patch-cmdline
|
||||||
|
@ -444,6 +444,7 @@ define Device/Init
|
||||||
KERNEL_INITRAMFS_NAME = $$(KERNEL_NAME)-initramfs
|
KERNEL_INITRAMFS_NAME = $$(KERNEL_NAME)-initramfs
|
||||||
KERNEL_INSTALL :=
|
KERNEL_INSTALL :=
|
||||||
KERNEL_NAME := vmlinux
|
KERNEL_NAME := vmlinux
|
||||||
|
KERNEL_DEPENDS :=
|
||||||
KERNEL_SIZE :=
|
KERNEL_SIZE :=
|
||||||
|
|
||||||
FILESYSTEMS := $(TARGET_FILESYSTEMS)
|
FILESYSTEMS := $(TARGET_FILESYSTEMS)
|
||||||
|
@ -468,11 +469,11 @@ define Device/Build/initramfs
|
||||||
$(call Device/Export,$(KDIR)/tmp/$$(KERNEL_INITRAMFS_IMAGE),$(1))
|
$(call Device/Export,$(KDIR)/tmp/$$(KERNEL_INITRAMFS_IMAGE),$(1))
|
||||||
$$(_TARGET): $(BIN_DIR)/$$(KERNEL_INITRAMFS_IMAGE)
|
$$(_TARGET): $(BIN_DIR)/$$(KERNEL_INITRAMFS_IMAGE)
|
||||||
|
|
||||||
$(KDIR)/$$(KERNEL_INITRAMFS_NAME): image_prepare
|
$(KDIR)/$$(KERNEL_INITRAMFS_NAME):: image_prepare
|
||||||
$(BIN_DIR)/$$(KERNEL_INITRAMFS_IMAGE): $(KDIR)/tmp/$$(KERNEL_INITRAMFS_IMAGE)
|
$(BIN_DIR)/$$(KERNEL_INITRAMFS_IMAGE): $(KDIR)/tmp/$$(KERNEL_INITRAMFS_IMAGE)
|
||||||
cp $$^ $$@
|
cp $$^ $$@
|
||||||
|
|
||||||
$(KDIR)/tmp/$$(KERNEL_INITRAMFS_IMAGE): $(KDIR)/$$(KERNEL_INITRAMFS_NAME)
|
$(KDIR)/tmp/$$(KERNEL_INITRAMFS_IMAGE): $(KDIR)/$$(KERNEL_INITRAMFS_NAME) $(CURDIR)/Makefile $$(KERNEL_DEPENDS)
|
||||||
@rm -f $$@
|
@rm -f $$@
|
||||||
$$(call concat_cmd,$$(KERNEL_INITRAMFS))
|
$$(call concat_cmd,$$(KERNEL_INITRAMFS))
|
||||||
endef
|
endef
|
||||||
|
@ -495,7 +496,7 @@ endef
|
||||||
|
|
||||||
define Device/Build/kernel
|
define Device/Build/kernel
|
||||||
_KERNEL_IMAGES += $(KDIR)/$$(KERNEL_NAME)
|
_KERNEL_IMAGES += $(KDIR)/$$(KERNEL_NAME)
|
||||||
$(KDIR)/$$(KERNEL_NAME): image_prepare
|
$(KDIR)/$$(KERNEL_NAME):: image_prepare
|
||||||
$$(_TARGET): $$(if $$(KERNEL_INSTALL),$(BIN_DIR)/$$(KERNEL_IMAGE))
|
$$(_TARGET): $$(if $$(KERNEL_INSTALL),$(BIN_DIR)/$$(KERNEL_IMAGE))
|
||||||
$(call Device/Export,$(KDIR)/$$(KERNEL_IMAGE),$(1))
|
$(call Device/Export,$(KDIR)/$$(KERNEL_IMAGE),$(1))
|
||||||
$(BIN_DIR)/$$(KERNEL_IMAGE): $(KDIR)/$$(KERNEL_IMAGE)
|
$(BIN_DIR)/$$(KERNEL_IMAGE): $(KDIR)/$$(KERNEL_IMAGE)
|
||||||
|
@ -504,7 +505,7 @@ define Device/Build/kernel
|
||||||
ifdef CONFIG_IB
|
ifdef CONFIG_IB
|
||||||
install: $(KDIR)/$$(KERNEL_IMAGE)
|
install: $(KDIR)/$$(KERNEL_IMAGE)
|
||||||
endif
|
endif
|
||||||
$(KDIR)/$$(KERNEL_IMAGE): $(KDIR)/$$(KERNEL_NAME)
|
$(KDIR)/$$(KERNEL_IMAGE): $(KDIR)/$$(KERNEL_NAME) $(CURDIR)/Makefile $$(KERNEL_DEPENDS)
|
||||||
@rm -f $$@
|
@rm -f $$@
|
||||||
$$(call concat_cmd,$$(KERNEL))
|
$$(call concat_cmd,$$(KERNEL))
|
||||||
$$(if $$(KERNEL_SIZE),$$(call Device/Build/check_size,$$(KERNEL_SIZE)))
|
$$(if $$(KERNEL_SIZE),$$(call Device/Build/check_size,$$(KERNEL_SIZE)))
|
||||||
|
@ -581,9 +582,6 @@ define BuildImage
|
||||||
$(foreach device,$(TARGET_DEVICES),$(call Device,$(device)))
|
$(foreach device,$(TARGET_DEVICES),$(call Device,$(device)))
|
||||||
$(foreach fs,$(TARGET_FILESYSTEMS) $(fs-subtypes-y),$(call BuildImage/mkfs,$(fs)))
|
$(foreach fs,$(TARGET_FILESYSTEMS) $(fs-subtypes-y),$(call BuildImage/mkfs,$(fs)))
|
||||||
|
|
||||||
$$(sort $$(_KERNEL_IMAGES)):
|
|
||||||
@touch $$@
|
|
||||||
|
|
||||||
install: kernel_prepare
|
install: kernel_prepare
|
||||||
$(foreach fs,$(TARGET_FILESYSTEMS),
|
$(foreach fs,$(TARGET_FILESYSTEMS),
|
||||||
$(call Image/Build,$(fs))
|
$(call Image/Build,$(fs))
|
||||||
|
|
|
@ -138,13 +138,15 @@ IMAGES_DIR:=../../x86/boot
|
||||||
endif
|
endif
|
||||||
|
|
||||||
define Kernel/CopyImage
|
define Kernel/CopyImage
|
||||||
$(KERNEL_CROSS)objcopy -O binary $(OBJCOPY_STRIP) -S $(LINUX_DIR)/vmlinux $(LINUX_KERNEL)$(1)
|
cmp -s $(LINUX_DIR)/vmlinux $(KERNEL_BUILD_DIR)/vmlinux$(1).debug || { \
|
||||||
$(KERNEL_CROSS)objcopy $(OBJCOPY_STRIP) -S $(LINUX_DIR)/vmlinux $(KERNEL_BUILD_DIR)/vmlinux$(1).elf
|
$(KERNEL_CROSS)objcopy -O binary $(OBJCOPY_STRIP) -S $(LINUX_DIR)/vmlinux $(LINUX_KERNEL)$(1); \
|
||||||
$(CP) $(LINUX_DIR)/vmlinux $(KERNEL_BUILD_DIR)/vmlinux.debug
|
$(KERNEL_CROSS)objcopy $(OBJCOPY_STRIP) -S $(LINUX_DIR)/vmlinux $(KERNEL_BUILD_DIR)/vmlinux$(1).elf; \
|
||||||
$(foreach k, \
|
$(CP) $(LINUX_DIR)/vmlinux $(KERNEL_BUILD_DIR)/vmlinux$(1).debug; \
|
||||||
$(if $(KERNEL_IMAGES),$(KERNEL_IMAGES),$(filter-out dtbs,$(KERNELNAME))), \
|
$(foreach k, \
|
||||||
$(CP) $(LINUX_DIR)/arch/$(LINUX_KARCH)/boot/$(IMAGES_DIR)/$(k) $(KERNEL_BUILD_DIR)/$(k)$(1); \
|
$(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
|
endef
|
||||||
|
|
||||||
define Kernel/CompileImage/Default
|
define Kernel/CompileImage/Default
|
||||||
|
|
Loading…
Reference in a new issue