/scripts/dtc/Makefile

http://github.com/mirrors/linux · Makefile · 31 lines · 20 code · 6 blank · 5 comment · 2 complexity · ef381795c375429ae90125b55306035f MD5 · raw file

  1. # SPDX-License-Identifier: GPL-2.0
  2. # scripts/dtc makefile
  3. hostprogs := dtc
  4. always-$(CONFIG_DTC) += $(hostprogs)
  5. always-$(CHECK_DT_BINDING) += $(hostprogs)
  6. dtc-objs := dtc.o flattree.o fstree.o data.o livetree.o treesource.o \
  7. srcpos.o checks.o util.o
  8. dtc-objs += dtc-lexer.lex.o dtc-parser.tab.o
  9. # Source files need to get at the userspace version of libfdt_env.h to compile
  10. HOST_EXTRACFLAGS := -I $(srctree)/$(src)/libfdt
  11. ifeq ($(shell pkg-config --exists yaml-0.1 2>/dev/null && echo yes),)
  12. ifneq ($(CHECK_DT_BINDING)$(CHECK_DTBS),)
  13. $(error dtc needs libyaml for DT schema validation support. \
  14. Install the necessary libyaml development package.)
  15. endif
  16. HOST_EXTRACFLAGS += -DNO_YAML
  17. else
  18. dtc-objs += yamltree.o
  19. HOSTLDLIBS_dtc := $(shell pkg-config yaml-0.1 --libs)
  20. endif
  21. # Generated files need one more search path to include headers in source tree
  22. HOSTCFLAGS_dtc-lexer.lex.o := -I $(srctree)/$(src)
  23. HOSTCFLAGS_dtc-parser.tab.o := -I $(srctree)/$(src)
  24. # dependencies on generated files need to be listed explicitly
  25. $(obj)/dtc-lexer.lex.o: $(obj)/dtc-parser.tab.h