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

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

SVN-Revision: 42873
v19.07.3_mercusys_ac12_duma
Felix Fietkau 10 years ago
parent 9d242ae89c
commit 71617f21a5

@ -250,52 +250,35 @@ define BuildImage
download: download:
prepare: prepare:
compile:
clean:
image_prepare:
ifeq ($(IB),) ifeq ($(IB),)
compile: compile-targets FORCE compile: compile-targets FORCE
$(call Build/Compile) $(call Build/Compile)
else
compile:
endif
ifeq ($(IB),) clean: clean-targets
install: compile install-targets FORCE $(call Build/Clean)
image_prepare: compile FORCE
$(call Image/Prepare) $(call Image/Prepare)
$(call Image/mkfs/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 endif
ifeq ($(IB),) install: image_prepare install-targets FORCE
clean: clean-targets $(call Image/BuildKernel)
$(call Build/Clean) $(if $(CONFIG_TARGET_ROOTFS_INITRAMFS),$(call Image/BuildKernel/Initramfs))
else $(call Image/InstallKernel)
clean: $(call Image/mkfs/cpiogz)
endif $(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: compile-targets:
install-targets: install-targets:

Loading…
Cancel
Save