Blame view

scripts/dtc/Makefile 1.2 KB
b24413180   Greg Kroah-Hartman   License cleanup: ...
1
  # SPDX-License-Identifier: GPL-2.0
9fffb55f6   David Gibson   Move dtc and libf...
2
  # scripts/dtc makefile
faabed295   Masahiro Yamada   kbuild: introduce...
3
4
  hostprogs-always-$(CONFIG_DTC)		+= dtc
  hostprogs-always-$(CHECK_DT_BINDING)	+= dtc
9fffb55f6   David Gibson   Move dtc and libf...
5
6
  
  dtc-objs	:= dtc.o flattree.o fstree.o data.o livetree.o treesource.o \
658f29a51   John Bonesio   of/flattree: Upda...
7
  		   srcpos.o checks.o util.o
9fffb55f6   David Gibson   Move dtc and libf...
8
9
10
  dtc-objs	+= dtc-lexer.lex.o dtc-parser.tab.o
  
  # Source files need to get at the userspace version of libfdt_env.h to compile
efe84d408   Uwe Kleine-König   scripts/dtc: only...
11
  HOST_EXTRACFLAGS += -I $(srctree)/$(src)/libfdt
9fffb55f6   David Gibson   Move dtc and libf...
12

067c650c4   Pavel Modilaynen   dtc: Use pkg-conf...
13
  ifeq ($(shell pkg-config --exists yaml-0.1 2>/dev/null && echo yes),)
0903060fe   Masahiro Yamada   kbuild: check lib...
14
  ifneq ($(CHECK_DT_BINDING)$(CHECK_DTBS),)
4f0e3a57d   Rob Herring   kbuild: Add suppo...
15
16
17
  $(error dtc needs libyaml for DT schema validation support. \
  	Install the necessary libyaml development package.)
  endif
f858927fd   Rob Herring   scripts/dtc: Upda...
18
19
20
  HOST_EXTRACFLAGS += -DNO_YAML
  else
  dtc-objs	+= yamltree.o
f8d8b46cd   Masahiro Yamada   scripts/dtc: use ...
21
22
23
  # To include <yaml.h> installed in a non-default path
  HOSTCFLAGS_yamltree.o := $(shell pkg-config --cflags yaml-0.1)
  # To link libyaml installed in a non-default path
067c650c4   Pavel Modilaynen   dtc: Use pkg-conf...
24
  HOSTLDLIBS_dtc	:= $(shell pkg-config yaml-0.1 --libs)
f858927fd   Rob Herring   scripts/dtc: Upda...
25
  endif
e3fd9b538   Masahiro Yamada   scripts/dtc: cons...
26
  # Generated files need one more search path to include headers in source tree
9cc342f6c   Masahiro Yamada   treewide: prefix ...
27
28
  HOSTCFLAGS_dtc-lexer.lex.o := -I $(srctree)/$(src)
  HOSTCFLAGS_dtc-parser.tab.o := -I $(srctree)/$(src)
9fffb55f6   David Gibson   Move dtc and libf...
29
30
  
  # dependencies on generated files need to be listed explicitly
95abef888   Arnaud Lacombe   dtc: migrate pars...
31
  $(obj)/dtc-lexer.lex.o: $(obj)/dtc-parser.tab.h