[U-Boot] [PATCH v2 13/15] kbuild: refactor more IMX image rules

Masahiro Yamada yamada.m at jp.panasonic.com
Mon Feb 24 03:12:21 CET 2014


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 at jp.panasonic.com>
---

Changes in v2: None

 Makefile                         |  5 ++++-
 arch/arm/config.mk               | 10 ++++++++++
 arch/arm/cpu/arm1136/config.mk   | 10 ----------
 arch/arm/cpu/arm926ejs/config.mk | 10 ----------
 arch/arm/cpu/armv7/config.mk     | 10 ----------
 spl/Makefile                     |  3 ---
 6 files changed, 14 insertions(+), 34 deletions(-)

diff --git a/Makefile b/Makefile
index dc04870..1311592 100644
--- 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)
diff --git a/arch/arm/config.mk b/arch/arm/config.mk
index 8a65c34..17b7408 100644
--- a/arch/arm/config.mk
+++ b/arch/arm/config.mk
@@ -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
diff --git a/arch/arm/cpu/arm1136/config.mk b/arch/arm/cpu/arm1136/config.mk
index 91b0ef3..a82c6ce 100644
--- a/arch/arm/cpu/arm1136/config.mk
+++ b/arch/arm/cpu/arm1136/config.mk
@@ -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
diff --git a/arch/arm/cpu/arm926ejs/config.mk b/arch/arm/cpu/arm926ejs/config.mk
index 918cdec..bdb3da1 100644
--- a/arch/arm/cpu/arm926ejs/config.mk
+++ b/arch/arm/cpu/arm926ejs/config.mk
@@ -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
diff --git a/arch/arm/cpu/armv7/config.mk b/arch/arm/cpu/armv7/config.mk
index 852f83c..247b7a5 100644
--- a/arch/arm/cpu/armv7/config.mk
+++ b/arch/arm/cpu/armv7/config.mk
@@ -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
diff --git a/spl/Makefile b/spl/Makefile
index 919c3b4..da1c3c0 100644
--- a/spl/Makefile
+++ b/spl/Makefile
@@ -179,9 +179,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
-- 
1.8.3.2



More information about the U-Boot mailing list