kbuild: refactor more IMX image rules
authorMasahiro Yamada <yamada.m@jp.panasonic.com>
Mon, 24 Feb 2014 02:12:21 +0000 (11:12 +0900)
committerTom Rini <trini@ti.com>
Tue, 25 Feb 2014 16:01:29 +0000 (11:01 -0500)
This commit avoids generating ./SPL twice.
  - Fist time descending to spl/
  - Second time as a prerequisite of u-boot-with-spl.imx,
    u-boot-with-nand-spl.imx.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Makefile
arch/arm/config.mk
arch/arm/cpu/arm1136/config.mk
arch/arm/cpu/arm926ejs/config.mk
arch/arm/cpu/armv7/config.mk
spl/Makefile

index dc04870e832a299642834166d1ef06382ce2de27..131159235e7f850ab4c753409b285b907635414e 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -839,7 +839,10 @@ OBJCOPYFLAGS_u-boot-with-tpl.bin = -I binary -O binary \
 tpl/u-boot-with-tpl.bin: tpl/u-boot-tpl.bin u-boot.bin FORCE
        $(call if_changed,pad_cat)
 
-u-boot-with-spl.imx u-boot-with-nand-spl.imx: spl/u-boot-spl.bin u-boot.bin
+SPL: spl/u-boot-spl.bin FORCE
+       $(Q)$(MAKE) $(build)=arch/arm/imx-common $@
+
+u-boot-with-spl.imx u-boot-with-nand-spl.imx: SPL u-boot.bin FORCE
        $(Q)$(MAKE) $(build)=arch/arm/imx-common $@
 
 MKIMAGEFLAGS_u-boot.ubl = -n $(UBL_CONFIG) -T ublimage -e $(CONFIG_SYS_TEXT_BASE)
index 8a65c34b861fd9c2d1cf7692b2f7ca42968e19b0..17b7408835b574a08e965b12dd680a8135a4bb24 100644 (file)
@@ -112,3 +112,13 @@ OBJCOPYFLAGS += -j .text -j .rodata -j .data -j .u_boot_list -j .rela.dyn
 else
 OBJCOPYFLAGS += -j .text -j .rodata -j .hash -j .data -j .got.plt -j .u_boot_list -j .rel.dyn
 endif
+
+ifneq ($(CONFIG_IMX_CONFIG),)
+ifdef CONFIG_SPL
+ifndef CONFIG_SPL_BUILD
+ALL-y += SPL
+endif
+else
+ALL-y += u-boot.imx
+endif
+endif
index 91b0ef31bc00ec21368a7ddf8890bb79099a29b4..a82c6cec9c4d3338b1ee1056d781cb3237cad9bb 100644 (file)
@@ -7,13 +7,3 @@
 
 # Make ARMv5 to allow more compilers to work, even though its v6.
 PLATFORM_CPPFLAGS += -march=armv5
-
-ifneq ($(CONFIG_IMX_CONFIG),)
-ifdef CONFIG_SPL
-ifdef CONFIG_SPL_BUILD
-ALL-y  += SPL
-endif
-else
-ALL-y  += u-boot.imx
-endif
-endif
index 918cdec1d141550ca5d42ef8740f9c0a053ddfc3..bdb3da183e8d09c8a80890bf737fbed5af0c18ab 100644 (file)
@@ -6,13 +6,3 @@
 #
 
 PLATFORM_CPPFLAGS += -march=armv5te
-
-ifneq ($(CONFIG_IMX_CONFIG),)
-ifdef CONFIG_SPL
-ifdef CONFIG_SPL_BUILD
-ALL-y  += SPL
-endif
-else
-ALL-y  += u-boot.imx
-endif
-endif
index 852f83c91133f19686613027cb4a9b824830edee..247b7a522a6ae3f4dcb49b328a23454dc16cf2d0 100644 (file)
@@ -13,13 +13,3 @@ PLATFORM_CPPFLAGS += $(PF_CPPFLAGS_ARMV7)
 # SEE README.arm-unaligned-accesses
 PF_NO_UNALIGNED := $(call cc-option, -mno-unaligned-access,)
 PLATFORM_NO_UNALIGNED := $(PF_NO_UNALIGNED)
-
-ifneq ($(CONFIG_IMX_CONFIG),)
-ifdef CONFIG_SPL
-ifdef CONFIG_SPL_BUILD
-ALL-y  += SPL
-endif
-else
-ALL-y  += u-boot.imx
-endif
-endif
index 1d68c03e07fb74c5b115d9929050de862e8e99bb..346d0aa253ff769caea662402cfa5cc4c24f799a 100644 (file)
@@ -180,9 +180,6 @@ MKIMAGEFLAGS_MLO.byteswap = -T omapimage -n byteswap -a $(CONFIG_SPL_TEXT_BASE)
 MLO MLO.byteswap: $(obj)/u-boot-spl.bin
        $(call if_changed,mkimage)
 
-SPL: $(obj)/u-boot-spl.bin
-       $(Q)$(MAKE) $(build)=arch/arm/imx-common $@
-
 ALL-y  += $(obj)/$(SPL_BIN).bin
 
 ifdef CONFIG_SAMSUNG