History

treewide: prefix header search paths with $(srctree)/

Currently, the Kbuild core manipulates header search paths in a crazy way [1]. To fix this mess, I want all Makefiles to add explicit $(srctree)/ to the search paths in the srctree. Some Makefiles are already written in that way, but not all. The goal of this work is to make the notation consistent, and finally get rid of the gross hacks. Having whitespaces after -I does not matter since commit 48f6e3cf5bc6 ("kbuild: do not drop -I without parameter"). [1]: https://patchwork.kernel.org/patch/9632347/

Masahiro Yamada committed 7 years ago

Commit 9cc342f1 parent 14340de17 files · +25 −26Browse files

Showing the changes to scripts (3 of 17 files). Show all

Unified · Split

3 files
  1. scripts/dtc/Makefile +3 −3
  2. scripts/genksyms/Makefile +2 −2
  3. scripts/kconfig/Makefile +2 −2
scripts/dtc/Makefile+3−3
@@ -9,7 +9,7 @@ dtc-objs := dtc.o flattree.o fstree.o data.o livetree.o treesource.o \ · 8 unmodified lines
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
12+HOST_EXTRACFLAGS := -I $(srctree)/$(src)/libfdt
1313
1414 ifeq ($(wildcard /usr/include/yaml.h),)
1515 ifneq ($(CHECK_DTBS),)
@@ -23,8 +23,8 @@ HOSTLDLIBS_dtc := -lyaml · 7 unmodified lines
2323 endif
2424
2525 # Generated files need one more search path to include headers in source tree
26−HOSTCFLAGS_dtc-lexer.lex.o := -I$(src)
27−HOSTCFLAGS_dtc-parser.tab.o := -I$(src)
26+HOSTCFLAGS_dtc-lexer.lex.o := -I $(srctree)/$(src)
27+HOSTCFLAGS_dtc-parser.tab.o := -I $(srctree)/$(src)
2828
2929 # dependencies on generated files need to be listed explicitly
3030 $(obj)/dtc-lexer.lex.o: $(obj)/dtc-parser.tab.h
scripts/genksyms/Makefile+2−2
@@ -31,8 +31,8 @@ $(obj)/parse.tab.h: $(src)/parse.y FORCE · 30 unmodified lines
3131 endif
3232
3333 # -I needed for generated C source (shipped source)
34−HOSTCFLAGS_parse.tab.o := -I$(src)
35−HOSTCFLAGS_lex.lex.o := -I$(src)
34+HOSTCFLAGS_parse.tab.o := -I $(srctree)/$(src)
35+HOSTCFLAGS_lex.lex.o := -I $(srctree)/$(src)
3636
3737 # dependencies on generated files need to be listed explicitly
3838 $(obj)/lex.lex.o: $(obj)/parse.tab.h
scripts/kconfig/Makefile+2−2
@@ -147,8 +147,8 @@ common-objs := confdata.o expr.o lexer.lex.o parser.tab.o preprocess.o \ · 146 unmodified lines
147147 symbol.o
148148
149149 $(obj)/lexer.lex.o: $(obj)/parser.tab.h
150−HOSTCFLAGS_lexer.lex.o := -I$(src)
151−HOSTCFLAGS_parser.tab.o := -I$(src)
150+HOSTCFLAGS_lexer.lex.o := -I $(srctree)/$(src)
151+HOSTCFLAGS_parser.tab.o := -I $(srctree)/$(src)
152152
153153 # conf: Used for defconfig, oldconfig and related targets
154154 hostprogs-y += conf