build: Use filechk rules to create and update u-boot.lds
authorJon Loeliger <jon.loeliger@oracle.com>
Tue, 15 Apr 2014 21:09:37 +0000 (16:09 -0500)
committerTom Rini <trini@ti.com>
Fri, 18 Apr 2014 20:14:16 +0000 (16:14 -0400)
Prior to this patch, the top-level linker script u-boot.lds
used a simple $(call if_changed) check when generated.
That mechanism misses cases where a possible include file
change induces a change in the u-boot.lds too.

This patch converts it to a stronger check using ($call filechk)
that will also notice differences in file contents and
will catch changes due to pre-processing as well.

Signed-off-by: Jon Loeliger <jon.loeliger@oracle.com>
Makefile

index 01918690407736320645b8ef9d91a32ebae60800..6aaf1169c55af172477b7f701437696233bb339d 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1093,12 +1093,13 @@ depend dep:
        @echo '*** Warning: make $@ is unnecessary now.'
 
 # ---------------------------------------------------------------------------
-quiet_cmd_cpp_lds = LDS     $@
-cmd_cpp_lds = $(CPP) -Wp,-MD,$(depfile) $(cpp_flags) $(LDPPFLAGS) -ansi \
-               -D__ASSEMBLY__ -x assembler-with-cpp -P -o $@ $<
+define filechk_ubootlds
+       ($(CPP) -Wp,-MD,$(depfile) $(cpp_flags) $(LDPPFLAGS) -ansi \
+               -D__ASSEMBLY__ -x assembler-with-cpp -P -o - -)
+endef
 
 u-boot.lds: $(LDSCRIPT) prepare FORCE
-       $(call if_changed_dep,cpp_lds)
+       $(call filechk,ubootlds)
 
 PHONY += nand_spl
 nand_spl: prepare