Makefile 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #
  2. # Copyright (c) 2011 The Chromium OS Authors.
  3. #
  4. # SPDX-License-Identifier: GPL-2.0+
  5. #
  6. # This Makefile builds the internal U-Boot fdt if CONFIG_OF_CONTROL is
  7. # enabled. See doc/README.fdt-control for more details.
  8. DEVICE_TREE ?= $(CONFIG_DEFAULT_DEVICE_TREE:"%"=%)
  9. ifeq ($(DEVICE_TREE),)
  10. DEVICE_TREE := unset
  11. endif
  12. ARCH_PATH := arch/$(ARCH)/dts
  13. dtb_depends := arch-dtbs
  14. ifneq ($(EXT_DTB),)
  15. DTB := $(EXT_DTB)
  16. else
  17. DTB := $(ARCH_PATH)/$(DEVICE_TREE).dtb
  18. dtb_depends += $(DTB:.dtb=.dts)
  19. endif
  20. $(obj)/dt.dtb: $(DTB) FORCE
  21. $(call if_changed,shipped)
  22. targets += dt.dtb
  23. $(DTB): $(dtb_depends)
  24. ifeq ($(EXT_DTB),)
  25. $(Q)$(MAKE) $(build)=$(ARCH_PATH) $@
  26. endif
  27. $(Q)test -e $@ || ( \
  28. echo >&2; \
  29. echo >&2 "Device Tree Source is not correctly specified."; \
  30. echo >&2 "Please define 'CONFIG_DEFAULT_DEVICE_TREE'"; \
  31. echo >&2 "or build with 'DEVICE_TREE=<device_tree>' argument"; \
  32. echo >&2; \
  33. /bin/false)
  34. arch-dtbs:
  35. $(Q)$(MAKE) $(build)=$(ARCH_PATH) dtbs
  36. .SECONDARY: $(obj)/dt.dtb.S
  37. obj-$(CONFIG_OF_EMBED) := dt.dtb.o
  38. dtbs: $(obj)/dt.dtb
  39. @:
  40. clean-files := dt.dtb.S
  41. # Let clean descend into dts directories
  42. subdir- += ../arch/arm/dts ../arch/microblaze/dts ../arch/mips/dts ../arch/sandbox/dts ../arch/x86/dts