xref: /kernel/linux/linux-6.6/scripts/dtc/Makefile (revision 62306a36)
162306a36Sopenharmony_ci# SPDX-License-Identifier: GPL-2.0
262306a36Sopenharmony_ci# scripts/dtc makefile
362306a36Sopenharmony_ci
462306a36Sopenharmony_ci# *** Also keep .gitignore in sync when changing ***
562306a36Sopenharmony_cihostprogs-always-$(CONFIG_DTC)		+= dtc fdtoverlay
662306a36Sopenharmony_cihostprogs-always-$(CHECK_DT_BINDING)	+= dtc
762306a36Sopenharmony_ci
862306a36Sopenharmony_cidtc-objs	:= dtc.o flattree.o fstree.o data.o livetree.o treesource.o \
962306a36Sopenharmony_ci		   srcpos.o checks.o util.o
1062306a36Sopenharmony_cidtc-objs	+= dtc-lexer.lex.o dtc-parser.tab.o
1162306a36Sopenharmony_ci
1262306a36Sopenharmony_ci# The upstream project builds libfdt as a separate library.  We are choosing to
1362306a36Sopenharmony_ci# instead directly link the libfdt object files into fdtoverlay.
1462306a36Sopenharmony_cilibfdt-objs	:= fdt.o fdt_ro.o fdt_wip.o fdt_sw.o fdt_rw.o fdt_strerror.o fdt_empty_tree.o fdt_addresses.o fdt_overlay.o
1562306a36Sopenharmony_cilibfdt		= $(addprefix libfdt/,$(libfdt-objs))
1662306a36Sopenharmony_cifdtoverlay-objs	:= $(libfdt) fdtoverlay.o util.o
1762306a36Sopenharmony_ci
1862306a36Sopenharmony_ci# Source files need to get at the userspace version of libfdt_env.h to compile
1962306a36Sopenharmony_ciHOST_EXTRACFLAGS += -I $(srctree)/$(src)/libfdt
2062306a36Sopenharmony_ciHOST_EXTRACFLAGS += -DNO_YAML
2162306a36Sopenharmony_ci
2262306a36Sopenharmony_ci# Generated files need one more search path to include headers in source tree
2362306a36Sopenharmony_ciHOSTCFLAGS_dtc-lexer.lex.o := -I $(srctree)/$(src)
2462306a36Sopenharmony_ciHOSTCFLAGS_dtc-parser.tab.o := -I $(srctree)/$(src)
2562306a36Sopenharmony_ci
2662306a36Sopenharmony_ci# dependencies on generated files need to be listed explicitly
2762306a36Sopenharmony_ci$(obj)/dtc-lexer.lex.o: $(obj)/dtc-parser.tab.h
28