[PATCH] Makefile: add support to build dedicated devicetree
Kory Maincent
kory.maincent at bootlin.com
Fri Jul 9 16:38:19 CEST 2021
Add the support to build a dedicated devicetree located in arch/$(ARCH)/dts
This devicetree does not need to be listed in the relevant devicetree
makefile.
Just run the following command to build the foo devicetree placed before
at the right path:
$ make foo.dtb
Signed-off-by: Kory Maincent <kory.maincent at bootlin.com>
---
Makefile | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/Makefile b/Makefile
index 027e31e09e..2ebeaee515 100644
--- a/Makefile
+++ b/Makefile
@@ -1136,6 +1136,12 @@ dtbs: dts/dt.dtb
dts/dt.dtb: u-boot
$(Q)$(MAKE) $(build)=dts dtbs
+ifneq ($(wildcard $(srctree)/arch/$(ARCH)/dts/),)
+dtstree := arch/$(ARCH)/dts
+%.dtb: u-boot
+ $(Q)$(MAKE) $(build)=$(dtstree) $(dtstree)/$@
+endif
+
quiet_cmd_copy = COPY $@
cmd_copy = cp $< $@
--
2.25.1
More information about the U-Boot
mailing list