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
9dtc-objs += dtc-lexer.lex.o dtc-parser.tab.o9dtc-objs += dtc-lexer.lex.o dtc-parser.tab.o
10 10
11# Source files need to get at the userspace version of libfdt_env.h to compile11# Source files need to get at the userspace version of libfdt_env.h to compile
12HOST_EXTRACFLAGS := -I$(src)/libfdt12HOST_EXTRACFLAGS := -I $(srctree)/$(src)/libfdt
13 13
14ifeq ($(wildcard /usr/include/yaml.h),)14ifeq ($(wildcard /usr/include/yaml.h),)
15ifneq ($(CHECK_DTBS),)15ifneq ($(CHECK_DTBS),)
@@ -23,8 +23,8 @@ HOSTLDLIBS_dtc := -lyaml · 7 unmodified lines
23endif23endif
24 24
25# Generated files need one more search path to include headers in source tree25# Generated files need one more search path to include headers in source tree
26HOSTCFLAGS_dtc-lexer.lex.o := -I$(src)26HOSTCFLAGS_dtc-lexer.lex.o := -I $(srctree)/$(src)
27HOSTCFLAGS_dtc-parser.tab.o := -I$(src)27HOSTCFLAGS_dtc-parser.tab.o := -I $(srctree)/$(src)
28 28
29# dependencies on generated files need to be listed explicitly29# dependencies on generated files need to be listed explicitly
30$(obj)/dtc-lexer.lex.o: $(obj)/dtc-parser.tab.h30$(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
31endif31endif
32 32
33# -I needed for generated C source (shipped source)33# -I needed for generated C source (shipped source)
34HOSTCFLAGS_parse.tab.o := -I$(src)34HOSTCFLAGS_parse.tab.o := -I $(srctree)/$(src)
35HOSTCFLAGS_lex.lex.o := -I$(src)35HOSTCFLAGS_lex.lex.o := -I $(srctree)/$(src)
36 36
37# dependencies on generated files need to be listed explicitly37# dependencies on generated files need to be listed explicitly
38$(obj)/lex.lex.o: $(obj)/parse.tab.h38$(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
147 symbol.o147 symbol.o
148 148
149$(obj)/lexer.lex.o: $(obj)/parser.tab.h149$(obj)/lexer.lex.o: $(obj)/parser.tab.h
150HOSTCFLAGS_lexer.lex.o := -I$(src)150HOSTCFLAGS_lexer.lex.o := -I $(srctree)/$(src)
151HOSTCFLAGS_parser.tab.o := -I$(src)151HOSTCFLAGS_parser.tab.o := -I $(srctree)/$(src)
152 152
153# conf: Used for defconfig, oldconfig and related targets153# conf: Used for defconfig, oldconfig and related targets
154hostprogs-y += conf154hostprogs-y += conf