xref: /openbmc/linux/scripts/dtc/Makefile (revision b2441318)
1b2441318SGreg Kroah-Hartman# SPDX-License-Identifier: GPL-2.0
29fffb55fSDavid Gibson# scripts/dtc makefile
39fffb55fSDavid Gibson
49fffb55fSDavid Gibsonhostprogs-y	:= dtc
59fffb55fSDavid Gibsonalways		:= $(hostprogs-y)
69fffb55fSDavid Gibson
79fffb55fSDavid Gibsondtc-objs	:= dtc.o flattree.o fstree.o data.o livetree.o treesource.o \
8658f29a5SJohn Bonesio		   srcpos.o checks.o util.o
99fffb55fSDavid Gibsondtc-objs	+= dtc-lexer.lex.o dtc-parser.tab.o
109fffb55fSDavid Gibson
119fffb55fSDavid Gibson# Source files need to get at the userspace version of libfdt_env.h to compile
129fffb55fSDavid Gibson
139fffb55fSDavid GibsonHOSTCFLAGS_DTC := -I$(src) -I$(src)/libfdt
149fffb55fSDavid Gibson
159fffb55fSDavid GibsonHOSTCFLAGS_checks.o := $(HOSTCFLAGS_DTC)
169fffb55fSDavid GibsonHOSTCFLAGS_data.o := $(HOSTCFLAGS_DTC)
179fffb55fSDavid GibsonHOSTCFLAGS_dtc.o := $(HOSTCFLAGS_DTC)
189fffb55fSDavid GibsonHOSTCFLAGS_flattree.o := $(HOSTCFLAGS_DTC)
199fffb55fSDavid GibsonHOSTCFLAGS_fstree.o := $(HOSTCFLAGS_DTC)
209fffb55fSDavid GibsonHOSTCFLAGS_livetree.o := $(HOSTCFLAGS_DTC)
219fffb55fSDavid GibsonHOSTCFLAGS_srcpos.o := $(HOSTCFLAGS_DTC)
229fffb55fSDavid GibsonHOSTCFLAGS_treesource.o := $(HOSTCFLAGS_DTC)
23658f29a5SJohn BonesioHOSTCFLAGS_util.o := $(HOSTCFLAGS_DTC)
249fffb55fSDavid Gibson
259fffb55fSDavid GibsonHOSTCFLAGS_dtc-lexer.lex.o := $(HOSTCFLAGS_DTC)
269fffb55fSDavid GibsonHOSTCFLAGS_dtc-parser.tab.o := $(HOSTCFLAGS_DTC)
279fffb55fSDavid Gibson
289fffb55fSDavid Gibson# dependencies on generated files need to be listed explicitly
2995abef88SArnaud Lacombe$(obj)/dtc-lexer.lex.o: $(obj)/dtc-parser.tab.h
309fffb55fSDavid Gibson
314f3be1cfSMagnus Damm# generated files need to be cleaned explicitly
324f3be1cfSMagnus Dammclean-files	:= dtc-lexer.lex.c dtc-parser.tab.c dtc-parser.tab.h
33