image.mk: reduce code duplication, move prepare to a separate make target
authorFelix Fietkau <nbd@openwrt.org>
Sun, 12 Oct 2014 15:00:07 +0000 (15:00 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Sun, 12 Oct 2014 15:00:07 +0000 (15:00 +0000)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
SVN-Revision: 42873

include/image.mk

index f0ed31a3625ab8bfb3de8227d58291d6beb52e5b..e29bb001d58e7fddaa72be9abf2bd362d528f9ef 100644 (file)
@@ -250,52 +250,35 @@ 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
+    clean: clean-targets
+               $(call Build/Clean)
+
+    image_prepare: compile 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:
-  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: