Makefile 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. ifneq ($(EXT_DTB),)
  13. DTB := $(EXT_DTB)
  14. else
  15. DTB := arch/$(ARCH)/dts/$(DEVICE_TREE).dtb
  16. endif
  17. $(obj)/dt.dtb: $(DTB) FORCE
  18. $(call if_changed,shipped)
  19. targets += dt.dtb
  20. $(DTB): arch-dtbs
  21. $(Q)test -e $@ || ( \
  22. echo >&2; \
  23. echo >&2 "Device Tree Source is not correctly specified."; \
  24. echo >&2 "Please define 'CONFIG_DEFAULT_DEVICE_TREE'"; \
  25. echo >&2 "or build with 'DEVICE_TREE=<device_tree>' argument"; \
  26. echo >&2; \
  27. /bin/false)
  28. arch-dtbs:
  29. $(Q)$(MAKE) $(build)=arch/$(ARCH)/dts dtbs
  30. .SECONDARY: $(obj)/dt.dtb.S
  31. obj-$(CONFIG_OF_EMBED) := dt.dtb.o
  32. dtbs: $(obj)/dt.dtb
  33. @:
  34. clean-files := dt.dtb.S
  35. # Let clean descend into dts directories
  36. subdir- += ../arch/arm/dts ../arch/microblaze/dts ../arch/mips/dts ../arch/sandbox/dts ../arch/x86/dts