image.mk: reduce code duplication, move prepare to a separate make target

Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 42873
owl
Felix Fietkau 2014-10-12 15:00:07 +00:00
parent 9d242ae89c
commit 71617f21a5
1 changed files with 21 additions and 38 deletions

View File

@ -250,53 +250,36 @@ define BuildImage
download:
prepare:
compile:
clean:
image_prepare:
ifeq ($(IB),)
compile: compile-targets FORCE
$(call Build/Compile)
else
compile:
endif
ifeq ($(IB),)
install: compile install-targets FORCE
$(call Image/Prepare)
$(call Image/mkfs/prepare)
$(call Image/BuildKernel)
$(if $(CONFIG_TARGET_ROOTFS_INITRAMFS),$(call Image/BuildKernel/Initramfs))
$(call Image/InstallKernel)
$(call Image/mkfs/cpiogz)
$(call Image/mkfs/targz)
$(call Image/mkfs/ext4)
$(call Image/mkfs/iso)
$(call Image/mkfs/jffs2)
$(call Image/mkfs/jffs2_nand)
$(call Image/mkfs/squashfs)
$(call Image/mkfs/ubifs)
$(call Image/Checksum)
else
install: compile install-targets
$(call Image/BuildKernel)
$(if $(CONFIG_TARGET_ROOTFS_INITRAMFS),$(call Image/BuildKernel/Initramfs))
$(call Image/InstallKernel)
$(call Image/mkfs/cpiogz)
$(call Image/mkfs/targz)
$(call Image/mkfs/ext4)
$(call Image/mkfs/iso)
$(call Image/mkfs/jffs2)
$(call Image/mkfs/jffs2_nand)
$(call Image/mkfs/squashfs)
$(call Image/mkfs/ubifs)
$(call Image/Checksum)
endif
ifeq ($(IB),)
clean: clean-targets
$(call Build/Clean)
else
clean:
image_prepare: compile FORCE
$(call Image/Prepare)
$(call Image/mkfs/prepare)
endif
install: image_prepare install-targets FORCE
$(call Image/BuildKernel)
$(if $(CONFIG_TARGET_ROOTFS_INITRAMFS),$(call Image/BuildKernel/Initramfs))
$(call Image/InstallKernel)
$(call Image/mkfs/cpiogz)
$(call Image/mkfs/targz)
$(call Image/mkfs/ext4)
$(call Image/mkfs/iso)
$(call Image/mkfs/jffs2)
$(call Image/mkfs/jffs2_nand)
$(call Image/mkfs/squashfs)
$(call Image/mkfs/ubifs)
$(call Image/Checksum)
compile-targets:
install-targets:
clean-targets: