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

Unified · Split

17 files
  1. arch/mips/pnx833x/Platform +1 −1
  2. arch/powerpc/Makefile +1 −1
  3. arch/sh/Makefile +2 −2
  4. arch/x86/kernel/Makefile +1 −1
  5. arch/x86/mm/Makefile +1 −1
  6. arch/xtensa/boot/lib/Makefile +1 −1
  7. drivers/hid/intel-ish-hid/Makefile +1 −1
  8. drivers/net/ethernet/chelsio/libcxgb/Makefile +1 −1
  9. drivers/target/iscsi/cxgbit/Makefile +3 −3
  10. drivers/usb/storage/Makefile +1 −1
  11. fs/ocfs2/dlm/Makefile +1 −2
  12. fs/ocfs2/dlmfs/Makefile +1 −1
  13. fs/xfs/Makefile +2 −2
  14. net/bpfilter/Makefile +1 −1
  15. scripts/dtc/Makefile +3 −3
  16. scripts/genksyms/Makefile +2 −2
  17. scripts/kconfig/Makefile +2 −2
arch/mips/pnx833x/Platform+1−1
@@ -1,5 +1,5 @@
11 # NXP STB225
22 platform-$(CONFIG_SOC_PNX833X) += pnx833x/
3−cflags-$(CONFIG_SOC_PNX833X) += -Iarch/mips/include/asm/mach-pnx833x
3+cflags-$(CONFIG_SOC_PNX833X) += -I $(srctree)/arch/mips/include/asm/mach-pnx833x
44 load-$(CONFIG_NXP_STB220) += 0xffffffff80001000
55 load-$(CONFIG_NXP_STB225) += 0xffffffff80001000
arch/powerpc/Makefile+1−1
@@ -211,7 +211,7 @@ endif · 210 unmodified lines
211211
212212 asinstr := $(call as-instr,lis 9$(comma)foo@high,-DHAVE_AS_ATHIGH=1)
213213
214−KBUILD_CPPFLAGS += -Iarch/$(ARCH) $(asinstr)
214+KBUILD_CPPFLAGS += -I $(srctree)/arch/$(ARCH) $(asinstr)
215215 KBUILD_AFLAGS += $(AFLAGS-y)
216216 KBUILD_CFLAGS += $(call cc-option,-msoft-float)
217217 KBUILD_CFLAGS += -pipe $(CFLAGS-y)
arch/sh/Makefile+2−2
@@ -191,8 +191,8 @@ cpuincdir-y += cpu-common # Must be last · 190 unmodified lines
191191 drivers-y += arch/sh/drivers/
192192 drivers-$(CONFIG_OPROFILE) += arch/sh/oprofile/
193193
194−cflags-y += $(foreach d, $(cpuincdir-y), -Iarch/sh/include/$(d)) \
195− $(foreach d, $(machdir-y), -Iarch/sh/include/$(d))
194+cflags-y += $(foreach d, $(cpuincdir-y), -I $(srctree)/arch/sh/include/$(d)) \
195+ $(foreach d, $(machdir-y), -I $(srctree)/arch/sh/include/$(d))
196196
197197 KBUILD_CFLAGS += -pipe $(cflags-y)
198198 KBUILD_CPPFLAGS += $(cflags-y)
arch/x86/kernel/Makefile+1−1
@@ -42,7 +42,7 @@ endif · 41 unmodified lines
4242 # non-deterministic coverage.
4343 KCOV_INSTRUMENT := n
4444
45−CFLAGS_irq.o := -I$(src)/../include/asm/trace
45+CFLAGS_irq.o := -I $(srctree)/$(src)/../include/asm/trace
4646
4747 obj-y := process_$(BITS).o signal.o
4848 obj-$(CONFIG_COMPAT) += signal_compat.o
arch/x86/mm/Makefile+1−1
@@ -21,7 +21,7 @@ CFLAGS_physaddr.o := $(nostackp) · 20 unmodified lines
2121 CFLAGS_setup_nx.o := $(nostackp)
2222 CFLAGS_mem_encrypt_identity.o := $(nostackp)
2323
24−CFLAGS_fault.o := -I$(src)/../include/asm/trace
24+CFLAGS_fault.o := -I $(srctree)/$(src)/../include/asm/trace
2525
2626 obj-$(CONFIG_X86_PAT) += pat_rbtree.o
2727
arch/xtensa/boot/lib/Makefile+1−1
@@ -7,7 +7,7 @@ zlib := inffast.c inflate.c inftrees.c · 6 unmodified lines
77
88 lib-y += $(zlib:.c=.o) zmem.o
99
10−ccflags-y := -Ilib/zlib_inflate
10+ccflags-y := -I $(srctree)/lib/zlib_inflate
1111 ifdef CONFIG_FUNCTION_TRACER
1212 CFLAGS_REMOVE_inflate.o = -pg
1313 CFLAGS_REMOVE_zmem.o = -pg
drivers/hid/intel-ish-hid/Makefile+1−1
@@ -23,4 +23,4 @@ intel-ishtp-hid-objs += ishtp-hid-client.o · 22 unmodified lines
2323 obj-$(CONFIG_INTEL_ISH_FIRMWARE_DOWNLOADER) += intel-ishtp-loader.o
2424 intel-ishtp-loader-objs += ishtp-fw-loader.o
2525
26−ccflags-y += -Idrivers/hid/intel-ish-hid/ishtp
26+ccflags-y += -I $(srctree)/$(src)/ishtp
drivers/net/ethernet/chelsio/libcxgb/Makefile+1−1
@@ -1,4 +1,4 @@
1−ccflags-y := -Idrivers/net/ethernet/chelsio/cxgb4
1+ccflags-y := -I $(srctree)/$(src)/../cxgb4
22
33 obj-$(CONFIG_CHELSIO_LIB) += libcxgb.o
44
drivers/target/iscsi/cxgbit/Makefile+3−3
@@ -1,7 +1,7 @@
11 # SPDX-License-Identifier: GPL-2.0
2−ccflags-y := -Idrivers/net/ethernet/chelsio/cxgb4
3−ccflags-y += -Idrivers/net/ethernet/chelsio/libcxgb
4−ccflags-y += -Idrivers/target/iscsi
2+ccflags-y := -I $(srctree)/drivers/net/ethernet/chelsio/cxgb4
3+ccflags-y += -I $(srctree)/drivers/net/ethernet/chelsio/libcxgb
4+ccflags-y += -I $(srctree)/drivers/target/iscsi
55
66 obj-$(CONFIG_ISCSI_TARGET_CXGB4) += cxgbit.o
77
drivers/usb/storage/Makefile+1−1
@@ -6,7 +6,7 @@ · 5 unmodified lines
66 # Rewritten to use lists instead of if-statements.
77 #
88
9−ccflags-y := -Idrivers/scsi
9+ccflags-y := -I $(srctree)/drivers/scsi
1010
1111 obj-$(CONFIG_USB_UAS) += uas.o
1212 obj-$(CONFIG_USB_STORAGE) += usb-storage.o
fs/ocfs2/dlm/Makefile+1−2
@@ -1,7 +1,6 @@
1−ccflags-y := -I$(src)/..
1+ccflags-y := -I $(srctree)/$(src)/..
22
33 obj-$(CONFIG_OCFS2_FS_O2CB) += ocfs2_dlm.o
44
55 ocfs2_dlm-objs := dlmdomain.o dlmdebug.o dlmthread.o dlmrecovery.o \
66 dlmmaster.o dlmast.o dlmconvert.o dlmlock.o dlmunlock.o
7−
fs/ocfs2/dlmfs/Makefile+1−1
@@ -1,4 +1,4 @@
1−ccflags-y := -I$(src)/..
1+ccflags-y := -I $(srctree)/$(src)/..
22
33 obj-$(CONFIG_OCFS2_FS) += ocfs2_dlmfs.o
44
fs/xfs/Makefile+2−2
@@ -4,8 +4,8 @@ · 3 unmodified lines
44 # All Rights Reserved.
55 #
66
7−ccflags-y += -I$(src) # needed for trace events
8−ccflags-y += -I$(src)/libxfs
7+ccflags-y += -I $(srctree)/$(src) # needed for trace events
8+ccflags-y += -I $(srctree)/$(src)/libxfs
99
1010 ccflags-$(CONFIG_XFS_DEBUG) += -g
1111
net/bpfilter/Makefile+1−1
@@ -5,7 +5,7 @@ · 4 unmodified lines
55
66 hostprogs-y := bpfilter_umh
77 bpfilter_umh-objs := main.o
8−KBUILD_HOSTCFLAGS += -Itools/include/ -Itools/include/uapi
8+KBUILD_HOSTCFLAGS += -I $(srctree)/tools/include/ -I $(srctree)/tools/include/uapi
99 HOSTCC := $(CC)
1010
1111 ifeq ($(CONFIG_BPFILTER_UMH), y)
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