summaryrefslogtreecommitdiffstats
path: root/images
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2015-11-06 16:10:42 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2015-11-06 16:10:42 +0100
commit1d9295b344a885e5a79de38df28740a1db6f6103 (patch)
treeca427bbf13a04f3480fb398630473bede4ef6463 /images
parent736a74ba7a1c3983105b92a709c263e206fe3913 (diff)
parent6face0e8ab8d97dcc7284a8a5d7ae1f4d134798f (diff)
downloadbarebox-1d9295b344a885e5a79de38df28740a1db6f6103.tar.gz
barebox-1d9295b344a885e5a79de38df28740a1db6f6103.tar.xz
Merge branch 'for-next/misc'
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