Skip to content

Commit e3fd9b5

Browse files
committed
scripts/dtc: consolidate include path options in Makefile
It is tedious to specify extra compiler options for every file. HOST_EXTRACFLAGS is useful to add options to all files in a directory. -I$(src)/libfdt is needed for all the files in this directory to include libfdt_env.h etc. from scripts/dtc/libfdt/. On the other hand, -I$(src) is used to include check-in headers from generated C files. Thus, I added it only to dtc-lexer.lex.o and dtc-parser.tab.o . Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Rob Herring <robh@kernel.org>
1 parent ad1d697 commit e3fd9b5

File tree

1 file changed

+4
-14
lines changed

1 file changed

+4
-14
lines changed

scripts/dtc/Makefile

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,11 @@ dtc-objs := dtc.o flattree.o fstree.o data.o livetree.o treesource.o \
99
dtc-objs += dtc-lexer.lex.o dtc-parser.tab.o
1010

1111
# Source files need to get at the userspace version of libfdt_env.h to compile
12+
HOST_EXTRACFLAGS := -I$(src)/libfdt
1213

13-
HOSTCFLAGS_DTC := -I$(src) -I$(src)/libfdt
14-
15-
HOSTCFLAGS_checks.o := $(HOSTCFLAGS_DTC)
16-
HOSTCFLAGS_data.o := $(HOSTCFLAGS_DTC)
17-
HOSTCFLAGS_dtc.o := $(HOSTCFLAGS_DTC)
18-
HOSTCFLAGS_flattree.o := $(HOSTCFLAGS_DTC)
19-
HOSTCFLAGS_fstree.o := $(HOSTCFLAGS_DTC)
20-
HOSTCFLAGS_livetree.o := $(HOSTCFLAGS_DTC)
21-
HOSTCFLAGS_srcpos.o := $(HOSTCFLAGS_DTC)
22-
HOSTCFLAGS_treesource.o := $(HOSTCFLAGS_DTC)
23-
HOSTCFLAGS_util.o := $(HOSTCFLAGS_DTC)
24-
25-
HOSTCFLAGS_dtc-lexer.lex.o := $(HOSTCFLAGS_DTC)
26-
HOSTCFLAGS_dtc-parser.tab.o := $(HOSTCFLAGS_DTC)
14+
# Generated files need one more search path to include headers in source tree
15+
HOSTCFLAGS_dtc-lexer.lex.o := -I$(src)
16+
HOSTCFLAGS_dtc-parser.tab.o := -I$(src)
2717

2818
# dependencies on generated files need to be listed explicitly
2919
$(obj)/dtc-lexer.lex.o: $(obj)/dtc-parser.tab.h

0 commit comments

Comments
 (0)