kbuild: fix a bug in regeneration of linker scripts
[oweals/u-boot.git] / spl / Makefile
index 9f5dbf4f3bfbf70523ccd24ab7b9c0c92f5d93f9..6fec2522a8c90f3598237f46b7592a0fef8ab206 100644 (file)
@@ -231,11 +231,11 @@ $(u-boot-spl-dirs):
        $(Q)$(MAKE) $(build)=$@
 
 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 $@ $<
 
 $(obj)/u-boot-spl.lds: $(LDSCRIPT) FORCE
-       $(call if_changed,cpp_lds)
+       $(call if_changed_dep,cpp_lds)
 
 # read all saved command lines