kbuild: fix a bug in regeneration of linker scripts
In some use cases, SPL linker script was not updated even when
it should be.
For instance,
$ make tricoder_config all
[ build complete ]
... modify include/configs/tricoder.h
$ make
spl/u-boot-spl.lds should be updated in this case, but it wasn't.
To fix this problem, linker scripts generation should be handled
by $(call if_changed_dep,...) rather than by $(call if_changed,...).
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Reported-by: Andreas Bießmann <andreas.devel@googlemail.com>
Tested-by: Andreas Bießmann <andreas.devel@googlemail.com>
diff --git a/Makefile b/Makefile
index b807e5c..b2937e9 100644
--- a/Makefile
+++ b/Makefile
@@ -1053,11 +1053,11 @@
# ---------------------------------------------------------------------------
quiet_cmd_cpp_lds = LDS $@
-cmd_cpp_lds = $(CPP) $(cpp_flags) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ \
- -x assembler-with-cpp -P -o $@ $<
+cmd_cpp_lds = $(CPP) -Wp,-MD,$(depfile) $(cpp_flags) $(LDPPFLAGS) -ansi \
+ -D__ASSEMBLY__ -x assembler-with-cpp -P -o $@ $<
u-boot.lds: $(LDSCRIPT) prepare FORCE
- $(call if_changed,cpp_lds)
+ $(call if_changed_dep,cpp_lds)
PHONY += nand_spl
nand_spl: prepare