2017-11-01 15:07:57 +01:00
|
|
|
# SPDX-License-Identifier: GPL-2.0
|
2009-04-30 15:25:53 +10:00
|
|
|
# scripts/dtc makefile
|
|
|
|
|
|
2018-01-10 15:19:37 -06:00
|
|
|
hostprogs-$(CONFIG_DTC) := dtc
|
2009-04-30 15:25:53 +10:00
|
|
|
always := $(hostprogs-y)
|
|
|
|
|
|
|
|
|
|
dtc-objs := dtc.o flattree.o fstree.o data.o livetree.o treesource.o \
|
2010-11-17 15:28:20 -08:00
|
|
|
srcpos.o checks.o util.o
|
2009-04-30 15:25:53 +10:00
|
|
|
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
|
2019-05-13 15:22:16 +09:00
|
|
|
HOST_EXTRACFLAGS := -I $(srctree)/$(src)/libfdt
|
2009-04-30 15:25:53 +10:00
|
|
|
|
2018-09-13 08:59:25 -05:00
|
|
|
ifeq ($(wildcard /usr/include/yaml.h),)
|
2018-09-06 13:26:07 -05:00
|
|
|
ifneq ($(CHECK_DTBS),)
|
|
|
|
|
$(error dtc needs libyaml for DT schema validation support. \
|
|
|
|
|
Install the necessary libyaml development package.)
|
|
|
|
|
endif
|
2018-09-13 08:59:25 -05:00
|
|
|
HOST_EXTRACFLAGS += -DNO_YAML
|
|
|
|
|
else
|
|
|
|
|
dtc-objs += yamltree.o
|
|
|
|
|
HOSTLDLIBS_dtc := -lyaml
|
|
|
|
|
endif
|
|
|
|
|
|
2018-07-04 10:59:23 +09:00
|
|
|
# Generated files need one more search path to include headers in source tree
|
2019-05-13 15:22:16 +09:00
|
|
|
HOSTCFLAGS_dtc-lexer.lex.o := -I $(srctree)/$(src)
|
|
|
|
|
HOSTCFLAGS_dtc-parser.tab.o := -I $(srctree)/$(src)
|
2009-04-30 15:25:53 +10:00
|
|
|
|
|
|
|
|
# dependencies on generated files need to be listed explicitly
|
2011-05-23 03:17:20 -04:00
|
|
|
$(obj)/dtc-lexer.lex.o: $(obj)/dtc-parser.tab.h
|