Create dependency makefile by makefile rule

Message ID
State New
Headers show

Commit Message

Nikolaus Schulz March 31, 2017, 2:49 p.m.
Creating the emmc image requires creating the bct file and the
bootloader image first.  These dependencies are written to a makefile
snippet that is created by the script.  But that
script is only invoked when the rule that creates the emmc image is run,
which is too late for creating the dependencies makefile.

Add a rule to that tells make how to create the dependencies
makefile; with that in place, make automatically makes the dependency
makefile before executing any other rules.

Signed-off-by: Nikolaus Schulz <>
 build/ | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)


diff --git a/build/ b/build/
index 0e1c766..37550bd 100644
--- a/build/
+++ b/build/
@@ -21,13 +21,14 @@  bcts: $(bcts)
 images: $(images)
 image_deps := $(addprefix .,$(addsuffix .d,$(images)))
+$(image_deps): .%.d : %.cfg
+	../../../build/ $< $(@:.%.d=%) $@
 -include $(image_deps)
 %.bct: %.bct.cfg
 	cbootimage -gbct -$(soc) $< $@
 %.img: %.img.cfg
-	../../../build/ $< $@ .$@.d
 	cbootimage -$(soc) $< $@
 %.simg: %.img $(skb)