summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2020-09-16 17:19:51 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2020-10-07 10:47:41 +0200
commitde87f0a2bef0542caac50415523f1ce85b61e9d6 (patch)
tree64120a742f7e1685791c4b3aa9437e1aff163e9e /Makefile
parentf3f91f06e2ad37b4af4de6c67a4396aa40857f0b (diff)
downloadbarebox-de87f0a2bef0542caac50415523f1ce85b61e9d6.tar.gz
barebox-de87f0a2bef0542caac50415523f1ce85b61e9d6.tar.xz
kbuild: add dtbs target for building all dtbs of an ARCH
As described in the documentation, upstream device trees extended by barebox should take care to cause compile errors, not runtime errors, when the paths they extend disappear. This way, breakage can be easily detected when synchronizing the dts/ directory and fixed right then. Make this process easier by providing a dtbs target that builds all device trees available in arch/$(SRCARCH)/dts/. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile20
1 files changed, 20 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index bf3266e977..86fb669dea 100644
--- a/Makefile
+++ b/Makefile
@@ -1003,6 +1003,22 @@ include/generated/utsrelease.h: include/config/kernel.release FORCE
$(call filechk,utsrelease.h)
# ---------------------------------------------------------------------------
+# Devicetree files
+
+ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/dts/),)
+dtstree := arch/$(SRCARCH)/dts
+endif
+
+ifneq ($(dtstree),)
+
+PHONY += dtbs
+all_dtbs += $(patsubst $(srctree)/%.dts,$(objtree)/%.dtb,$(wildcard $(srctree)/$(dtstree)/*.dts))
+targets += $(all_dtbs)
+dtbs: $(all_dtbs)
+
+endif
+
+# ---------------------------------------------------------------------------
# Modules
ifdef CONFIG_MODULES
@@ -1177,6 +1193,10 @@ help:
@$(if $(archhelp),$(archhelp),\
echo ' No architecture specific help defined for $(SRCARCH)')
@echo ''
+ @$(if $(dtstree), \
+ echo ' Devicetree:'; \
+ echo ' * dtbs - Build device tree blobs for all boards'; \
+ echo '')
@$(if $(boards), \
$(foreach b, $(boards), \
printf " %-24s - Build for %s\\n" $(b) $(subst _defconfig,,$(b));) \