blob: 056d5da6c4779e5a2eeb074600764bb81e0c7aab [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001# SPDX-License-Identifier: GPL-2.0
David Gibson9fffb552009-04-30 15:25:53 +10002# scripts/dtc makefile
3
Rob Herring37c8a5f2018-01-10 15:19:37 -06004hostprogs-$(CONFIG_DTC) := dtc
David Gibson9fffb552009-04-30 15:25:53 +10005always := $(hostprogs-y)
6
7dtc-objs := dtc.o flattree.o fstree.o data.o livetree.o treesource.o \
John Bonesio658f29a2010-11-17 15:28:20 -08008 srcpos.o checks.o util.o
David Gibson9fffb552009-04-30 15:25:53 +10009dtc-objs += dtc-lexer.lex.o dtc-parser.tab.o
10
11# Source files need to get at the userspace version of libfdt_env.h to compile
Masahiro Yamadae3fd9b52018-07-04 10:59:23 +090012HOST_EXTRACFLAGS := -I$(src)/libfdt
David Gibson9fffb552009-04-30 15:25:53 +100013
Rob Herringf8589272018-09-13 08:59:25 -050014ifeq ($(wildcard /usr/include/yaml.h),)
15HOST_EXTRACFLAGS += -DNO_YAML
16else
17dtc-objs += yamltree.o
18HOSTLDLIBS_dtc := -lyaml
19endif
20
Masahiro Yamadae3fd9b52018-07-04 10:59:23 +090021# Generated files need one more search path to include headers in source tree
22HOSTCFLAGS_dtc-lexer.lex.o := -I$(src)
23HOSTCFLAGS_dtc-parser.tab.o := -I$(src)
David Gibson9fffb552009-04-30 15:25:53 +100024
25# dependencies on generated files need to be listed explicitly
Arnaud Lacombe95abef82011-05-23 03:17:20 -040026$(obj)/dtc-lexer.lex.o: $(obj)/dtc-parser.tab.h