diff mbox

[U-Boot,v2,5/7] kbuild: fix a bug of the u-boot-spl link rule

Message ID 1414081846-10815-6-git-send-email-yamada.m@jp.panasonic.com
State Accepted
Delegated to: Tom Rini
Headers show

Commit Message

Masahiro Yamada Oct. 23, 2014, 4:30 p.m. UTC
cmd_u-boot-spl includes $(PLATFORM_LIBS) which changes
when CONFIG_USE_PRIVATE_GCC is updated.  The u-boot-spl image
should be re-linked if any prerequisite is newer than it
or the command line has changed.
$(call, if_changed,...) should be used instead of $(call cmd,...).

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
---

Changes in v2: None

 scripts/Makefile.spl | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Tom Rini Oct. 23, 2014, 5:57 p.m. UTC | #1
On Fri, Oct 24, 2014 at 01:30:44AM +0900, Masahiro Yamada wrote:

> cmd_u-boot-spl includes $(PLATFORM_LIBS) which changes
> when CONFIG_USE_PRIVATE_GCC is updated.  The u-boot-spl image
> should be re-linked if any prerequisite is newer than it
> or the command line has changed.
> $(call, if_changed,...) should be used instead of $(call cmd,...).
> 
> Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>

Applied to u-boot/master, thanks!
diff mbox

Patch

diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl
index 88c01d1..7afe437 100644
--- a/scripts/Makefile.spl
+++ b/scripts/Makefile.spl
@@ -216,13 +216,13 @@  $(obj)/sunxi-spl.bin: $(obj)/$(SPL_BIN).bin
 endif
 
 quiet_cmd_u-boot-spl = LD      $@
-      cmd_u-boot-spl = cd $(obj) && $(LD) $(LDFLAGS) $(LDFLAGS_$(@F)) \
+      cmd_u-boot-spl = (cd $(obj) && $(LD) $(LDFLAGS) $(LDFLAGS_$(@F)) \
 		       $(patsubst $(obj)/%,%,$(u-boot-spl-init)) --start-group \
 		       $(patsubst $(obj)/%,%,$(u-boot-spl-main)) --end-group \
-		       $(PLATFORM_LIBS) -Map $(SPL_BIN).map -o $(SPL_BIN)
+		       $(PLATFORM_LIBS) -Map $(SPL_BIN).map -o $(SPL_BIN))
 
-$(obj)/$(SPL_BIN): $(u-boot-spl-init) $(u-boot-spl-main) $(obj)/u-boot-spl.lds
-	$(call cmd,u-boot-spl)
+$(obj)/$(SPL_BIN): $(u-boot-spl-init) $(u-boot-spl-main) $(obj)/u-boot-spl.lds FORCE
+	$(call if_changed,u-boot-spl)
 
 $(sort $(u-boot-spl-init) $(u-boot-spl-main)): $(u-boot-spl-dirs) ;