]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - dts/Makefile
Merge branch 'tx53-bugfix'
[karo-tx-uboot.git] / dts / Makefile
index c47fba787ccb593f11260b33d4c77b7bb135148c..d3122aa3b96eeaa8820300060c958bcb5cf1d6dd 100644 (file)
@@ -9,24 +9,31 @@
 
 DEVICE_TREE ?= $(CONFIG_DEFAULT_DEVICE_TREE:"%"=%)
 ifeq ($(DEVICE_TREE),)
-DEVICE_TREE := notfound
+DEVICE_TREE := unset
 endif
 
-DTS := $(srctree)/board/$(VENDOR)/dts/$(DEVICE_TREE).dts
-
-DTC_FLAGS += -i $(srctree)/arch/$(ARCH)/dts -R 4 -p 0x1000
+ifneq ($(EXT_DTB),)
+DTB := $(EXT_DTB)
+else
+DTB := arch/$(ARCH)/dts/$(DEVICE_TREE).dtb
+endif
 
-$(obj)/dt.dtb: $(DTS) FORCE
-       $(call if_changed_dep,dtc)
+$(obj)/dt.dtb: $(DTB) FORCE
+       $(call if_changed,shipped)
 
 targets += dt.dtb
 
-$(DTS):
-       @echo >&2
-       @echo >&2 "Device Tree Source is not specified."
-       @echo >&2 "Please define 'CONFIG_DEFAULT_DEVICE_TREE'"
-       @echo >&2 "or build with 'DEVICE_TREE=<dts-file-name>' argument"
-       @/bin/false
+$(DTB): arch-dtbs
+       $(Q)test -e $@ || (                                             \
+       echo >&2;                                                       \
+       echo >&2 "Device Tree Source is not correctly specified.";      \
+       echo >&2 "Please define 'CONFIG_DEFAULT_DEVICE_TREE'";          \
+       echo >&2 "or build with 'DEVICE_TREE=<device_tree>' argument";  \
+       echo >&2;                                                       \
+       /bin/false)
+
+arch-dtbs:
+       $(Q)$(MAKE) $(build)=arch/$(ARCH)/dts dtbs
 
 .SECONDARY: $(obj)/dt.dtb.S
 
@@ -36,3 +43,6 @@ dtbs: $(obj)/dt.dtb
        @:
 
 clean-files := dt.dtb.S
+
+# Let clean descend into dts directories
+subdir- += ../arch/arm/dts ../arch/microblaze/dts ../arch/sandbox/dts ../arch/x86/dts