summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2013-06-23 11:32:31 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2013-07-01 10:13:12 +0200
commit2078438662a5343cb32eb799daf9de7693c63def (patch)
tree5668de780b832e4a90c4daad2ba32f8154186682 /Makefile
parent82915c3a6a54238ba031de41ce569a13ebbed382 (diff)
downloadbarebox-2078438662a5343cb32eb799daf9de7693c63def.tar.gz
barebox-2078438662a5343cb32eb799daf9de7693c63def.tar.xz
Add multi images support
This adds the make infrastructure to build multiple SoC or board specific images from a single barebox binary. The basic idea is that we no longer have a single pbl, but instead multiple pbls, one per image if necessary. Each pbl is defined by its entry function so that each pbl can do exactly what a given board needs. Additionally the pbls together with a self extracting barebox binary can be encapsulated in specific image formats. squashed in build fixes from Lucas Stach for make version >= 3.82: Split Multimage Makefile rule in explicit and implicit parts Fixes build with make version >=3.82 Frome the make 3.82 NEWS file: * WARNING: Backward-incompatibility! In previous versions of make it was acceptable to list one or more explicit targets followed by one or more pattern targets in the same rule and it worked "as expected". However, this was not documented as acceptable and if you listed any explicit targets AFTER the pattern targets, the entire rule would be mis-parsed. This release removes this ability completely: make will generate an error message if you mix explicit and pattern targets in the same rule. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Lucas Stach <dev@lynxeye.de>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile10
1 files changed, 10 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 54d2475b5a..150271f5aa 100644
--- a/Makefile
+++ b/Makefile
@@ -481,7 +481,16 @@ export KBUILD_BINARY ?= barebox.bin
barebox-flash-image: $(KBUILD_IMAGE) FORCE
$(call if_changed,ln)
+images: barebox.bin FORCE
+ $(Q)$(MAKE) $(build)=images $@
+images/%.s: barebox.bin FORCE
+ $(Q)$(MAKE) $(build)=images $@
+
+ifdef CONFIG_PBL_MULTI_IMAGES
+all: $(KBUILD_DTBS) barebox.bin images
+else
all: barebox-flash-image $(KBUILD_DTBS)
+endif
common-$(CONFIG_PBL_IMAGE) += pbl/
@@ -987,6 +996,7 @@ clean-dirs := $(addprefix _clean_,$(srctree) $(barebox-alldirs))
PHONY += $(clean-dirs) clean archclean
$(clean-dirs):
+ $(Q)$(MAKE) $(clean)=images
$(Q)$(MAKE) $(clean)=$(patsubst _clean_%,%,$@)
clean: archclean $(clean-dirs)