summaryrefslogtreecommitdiffstats
path: root/images
diff options
context:
space:
mode:
authorTrent Piepho <tpiepho@kymetacorp.com>2015-10-26 20:55:30 +0000
committerSascha Hauer <s.hauer@pengutronix.de>2015-10-27 16:52:40 +0100
commit550cf79c216a67efdb23e15a9501db8b4c3347a1 (patch)
tree330fded996e5b3d0977b5d5a264039ba90747523 /images
parentad0aadfda3d09067ec2440b93decfd009001477f (diff)
downloadbarebox-550cf79c216a67efdb23e15a9501db8b4c3347a1.tar.gz
barebox-550cf79c216a67efdb23e15a9501db8b4c3347a1.tar.xz
Make list of flash images and fix link all single image cases
Create a new file named 'barebox-flash-images' in the top level output directory that lists each image generated, one per line. Paths will be relative to the top level output directory. This works if multiple images are generated as well as for a single image. Also update the existing barebox-flash-image symlink to point to the image in all cases where there is a single image generated. If multiple images are generated, it will point to the non-existent file 'multi-image-build'. Signed-off-by: Trent Piepho <tpiepho@kymetacorp.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'images')
-rw-r--r--images/Makefile18
1 files changed, 17 insertions, 1 deletions
diff --git a/images/Makefile b/images/Makefile
index a5f589b303..6a44511215 100644
--- a/images/Makefile
+++ b/images/Makefile
@@ -121,10 +121,26 @@ targets += $(foreach m, $(image-y), $(FILE_$(m)))
SECONDARY: $(addprefix $(obj)/,$(targets))
-images: $(addprefix $(obj)/, $(image-y)) FORCE
+# Images with full paths
+image-y-path := $(addprefix $(obj)/,$(image-y))
+# File will have a list of images generated
+flash-list := $(obj)/../barebox-flash-images
+# Symlink, which will point to non-existent 'multi-image-build' if there are
+# multiple images
+flash-link := $(obj)/../barebox-flash-image
+link-dest := $(if $(filter 1,$(words $(image-y))),$(image-y-path),multi-image-build)
+multi-image-build:
+
+images: $(image-y-path) $(flash-link) $(flash-list) FORCE
@echo "images built:"
@for i in $(image-y); do echo $$i; done
+$(flash-link): $(link-dest) FORCE
+ $(call if_changed,ln)
+
+$(flash-list): $(image-y-path)
+ @for i in $^; do echo $$i; done > $@
+
clean-files := *.pbl *.pblb *.pblx *.map start_*.imximg *.img barebox.z start_*.kwbimg \
start_*.kwbuartimg *.socfpgaimg *.mlo *.t20img *.t20img.cfg *.t30img \
*.t30img.cfg *.t124img *.t124img.cfg *.mlospi *.mlo *.mxsbs *.mxssd