summaryrefslogtreecommitdiffstats
path: root/images
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2019-12-09 15:11:14 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2019-12-11 09:26:48 +0100
commit09ac94a036e8caea648771798890c25f67d8df3c (patch)
treef20aad2070c8bd75ab947e6db39d746e30a6b881 /images
parentbeec04590b85af55e9a5cc36ef575eead818a75f (diff)
downloadbarebox-09ac94a036e8caea648771798890c25f67d8df3c.tar.gz
barebox-09ac94a036e8caea648771798890c25f67d8df3c.tar.xz
ARM: i.MX: rebuild .imximg if DCD table in .imxcfg changes
So far changing the DCD table didn't trigger a rerun of the i.MX image utility. To fix this, we need to have the DCD table as prerequisite to the .imximg rule. The file name is contained in $(CFG_$(@F)), but can't be used directly because $@ (and by extension @F) has no value when first expanded in the read-in phase. If we expand a second time during the target-update phase however, we would get the correct value. GNU make provides .SECONDEXPANSION to expand all following prerequisites a second time. Use it to have changes to the DCD table rebuild the image. Because we are now using imx_image_rule to generate the target, we must escape each $ one more time to arrive at $$$$(CFG_$$$$(@F)). In the final step, we replace $$$$(@F) with %.imximg, so we support the rules not ending in .imximg as well. Dependency file generation is still broken however and changed to headers included in DCD tables won't be caught, but this functionality can be fixed in a separate patch. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'images')
-rw-r--r--images/Makefile.imx4
1 files changed, 2 insertions, 2 deletions
diff --git a/images/Makefile.imx b/images/Makefile.imx
index 2d00229f43..24d3536d36 100644
--- a/images/Makefile.imx
+++ b/images/Makefile.imx
@@ -23,9 +23,10 @@ endef
# %.imximg - convert into i.MX image
# ----------------------------------------------------------------
+.SECONDEXPANSION:
define imx_image_rule
$(eval
-$$(obj)/%.$(strip $(1)): $$(obj)/% FORCE
+$$(obj)/%.$(strip $(1)): $$(obj)/% $$$$(CFG_%.imximg) FORCE
$$(call if_changed,imx_image,$$(CFG_$$(patsubst %.$(strip $(1)),%.imximg,$$(@F))),$(strip $(2)))
)
endef
@@ -38,7 +39,6 @@ $(call imx_image_rule,usimximg, -u -s)
$(call imx_image_rule,esimximg, -e -s)
$(call imx_image_rule,esimximg.dek, -e -s)
-.SECONDEXPANSION:
$(obj)/%.img.dek: $(obj)/$$(FILE_$$(@F))
$(Q)if [ -z $(FILE_$(@F)) ]; then echo "FILE_$(@F) empty!"; false; fi
$(call if_changed,shipped)