diff --git a/Makefile b/Makefile index 9b10077..b067b00 100644 --- a/Makefile +++ b/Makefile @@ -484,6 +484,9 @@ barebox-flash-image: $(KBUILD_IMAGE) FORCE $(call if_changed,ln) +barebox-flash-images: $(KBUILD_IMAGE) + @echo $^ > $@ + images: barebox.bin FORCE $(Q)$(MAKE) $(build)=images $@ images/%.s: barebox.bin FORCE @@ -492,7 +495,7 @@ ifdef CONFIG_PBL_MULTI_IMAGES all: barebox.bin images else -all: barebox-flash-image +all: barebox-flash-image barebox-flash-images endif common-$(CONFIG_PBL_IMAGE) += pbl/ diff --git a/images/Makefile b/images/Makefile index a5f589b..6a44511 100644 --- a/images/Makefile +++ b/images/Makefile @@ -121,10 +121,26 @@ 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