Blame view
scripts/dtc/Makefile
1.2 KB
b24413180
|
1 |
# SPDX-License-Identifier: GPL-2.0 |
9fffb55f6
|
2 |
# scripts/dtc makefile |
faabed295
|
3 4 |
hostprogs-always-$(CONFIG_DTC) += dtc hostprogs-always-$(CHECK_DT_BINDING) += dtc |
9fffb55f6
|
5 6 |
dtc-objs := dtc.o flattree.o fstree.o data.o livetree.o treesource.o \ |
658f29a51
|
7 |
srcpos.o checks.o util.o |
9fffb55f6
|
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
|
11 |
HOST_EXTRACFLAGS += -I $(srctree)/$(src)/libfdt |
9fffb55f6
|
12 |
|
067c650c4
|
13 |
ifeq ($(shell pkg-config --exists yaml-0.1 2>/dev/null && echo yes),) |
0903060fe
|
14 |
ifneq ($(CHECK_DT_BINDING)$(CHECK_DTBS),) |
4f0e3a57d
|
15 16 17 |
$(error dtc needs libyaml for DT schema validation support. \ Install the necessary libyaml development package.) endif |
f858927fd
|
18 19 20 |
HOST_EXTRACFLAGS += -DNO_YAML else dtc-objs += yamltree.o |
f8d8b46cd
|
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
|
24 |
HOSTLDLIBS_dtc := $(shell pkg-config yaml-0.1 --libs) |
f858927fd
|
25 |
endif |
e3fd9b538
|
26 |
# Generated files need one more search path to include headers in source tree |
9cc342f6c
|
27 28 |
HOSTCFLAGS_dtc-lexer.lex.o := -I $(srctree)/$(src) HOSTCFLAGS_dtc-parser.tab.o := -I $(srctree)/$(src) |
9fffb55f6
|
29 30 |
# dependencies on generated files need to be listed explicitly |
95abef888
|
31 |
$(obj)/dtc-lexer.lex.o: $(obj)/dtc-parser.tab.h |