Skip to contentSkip to conversation

Makefile: add support to build dedicated devicetree

PATCH Superseded Kory Maincent 1 participant 1 message Jul 9, 2021 Kbuild

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Makefile: add support to build dedicated devicetree

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
---
 Makefile | 6 ++++++
 1 file changed, 6 insertions(+)
Makefile +6 -0
index 027e31e09e..2ebeaee515 100644
@@ -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 $< $@
 
Signature · 1 line
2.25.1