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 @@
1# NXP STB2251# NXP STB225
2platform-$(CONFIG_SOC_PNX833X) += pnx833x/2platform-$(CONFIG_SOC_PNX833X) += pnx833x/
3cflags-$(CONFIG_SOC_PNX833X) += -Iarch/mips/include/asm/mach-pnx833x3cflags-$(CONFIG_SOC_PNX833X) += -I $(srctree)/arch/mips/include/asm/mach-pnx833x
4load-$(CONFIG_NXP_STB220) += 0xffffffff800010004load-$(CONFIG_NXP_STB220) += 0xffffffff80001000
5load-$(CONFIG_NXP_STB225) += 0xffffffff800010005load-$(CONFIG_NXP_STB225) += 0xffffffff80001000
arch/powerpc/Makefile+1−1
@@ -211,7 +211,7 @@ endif · 210 unmodified lines
211 211
212asinstr := $(call as-instr,lis 9$(comma)foo@high,-DHAVE_AS_ATHIGH=1)212asinstr := $(call as-instr,lis 9$(comma)foo@high,-DHAVE_AS_ATHIGH=1)
213 213
214KBUILD_CPPFLAGS += -Iarch/$(ARCH) $(asinstr)214KBUILD_CPPFLAGS += -I $(srctree)/arch/$(ARCH) $(asinstr)
215KBUILD_AFLAGS += $(AFLAGS-y)215KBUILD_AFLAGS += $(AFLAGS-y)
216KBUILD_CFLAGS += $(call cc-option,-msoft-float)216KBUILD_CFLAGS += $(call cc-option,-msoft-float)
217KBUILD_CFLAGS += -pipe $(CFLAGS-y)217KBUILD_CFLAGS += -pipe $(CFLAGS-y)
arch/sh/Makefile+2−2
@@ -191,8 +191,8 @@ cpuincdir-y += cpu-common # Must be last · 190 unmodified lines
191drivers-y += arch/sh/drivers/191drivers-y += arch/sh/drivers/
192drivers-$(CONFIG_OPROFILE) += arch/sh/oprofile/192drivers-$(CONFIG_OPROFILE) += arch/sh/oprofile/
193 193
194cflags-y += $(foreach d, $(cpuincdir-y), -Iarch/sh/include/$(d)) \194cflags-y += $(foreach d, $(cpuincdir-y), -I $(srctree)/arch/sh/include/$(d)) \
195 $(foreach d, $(machdir-y), -Iarch/sh/include/$(d))195 $(foreach d, $(machdir-y), -I $(srctree)/arch/sh/include/$(d))
196 196
197KBUILD_CFLAGS += -pipe $(cflags-y)197KBUILD_CFLAGS += -pipe $(cflags-y)
198KBUILD_CPPFLAGS += $(cflags-y)198KBUILD_CPPFLAGS += $(cflags-y)
arch/x86/kernel/Makefile+1−1
@@ -42,7 +42,7 @@ endif · 41 unmodified lines
42# non-deterministic coverage.42# non-deterministic coverage.
43KCOV_INSTRUMENT := n43KCOV_INSTRUMENT := n
44 44
45CFLAGS_irq.o := -I$(src)/../include/asm/trace45CFLAGS_irq.o := -I $(srctree)/$(src)/../include/asm/trace
46 46
47obj-y := process_$(BITS).o signal.o47obj-y := process_$(BITS).o signal.o
48obj-$(CONFIG_COMPAT) += signal_compat.o48obj-$(CONFIG_COMPAT) += signal_compat.o
arch/x86/mm/Makefile+1−1
@@ -21,7 +21,7 @@ CFLAGS_physaddr.o := $(nostackp) · 20 unmodified lines
21CFLAGS_setup_nx.o := $(nostackp)21CFLAGS_setup_nx.o := $(nostackp)
22CFLAGS_mem_encrypt_identity.o := $(nostackp)22CFLAGS_mem_encrypt_identity.o := $(nostackp)
23 23
24CFLAGS_fault.o := -I$(src)/../include/asm/trace24CFLAGS_fault.o := -I $(srctree)/$(src)/../include/asm/trace
25 25
26obj-$(CONFIG_X86_PAT) += pat_rbtree.o26obj-$(CONFIG_X86_PAT) += pat_rbtree.o
27 27
arch/xtensa/boot/lib/Makefile+1−1
@@ -7,7 +7,7 @@ zlib := inffast.c inflate.c inftrees.c · 6 unmodified lines
7 7
8lib-y += $(zlib:.c=.o) zmem.o8lib-y += $(zlib:.c=.o) zmem.o
9 9
10ccflags-y := -Ilib/zlib_inflate10ccflags-y := -I $(srctree)/lib/zlib_inflate
11ifdef CONFIG_FUNCTION_TRACER11ifdef CONFIG_FUNCTION_TRACER
12CFLAGS_REMOVE_inflate.o = -pg12CFLAGS_REMOVE_inflate.o = -pg
13CFLAGS_REMOVE_zmem.o = -pg13CFLAGS_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
23obj-$(CONFIG_INTEL_ISH_FIRMWARE_DOWNLOADER) += intel-ishtp-loader.o23obj-$(CONFIG_INTEL_ISH_FIRMWARE_DOWNLOADER) += intel-ishtp-loader.o
24intel-ishtp-loader-objs += ishtp-fw-loader.o24intel-ishtp-loader-objs += ishtp-fw-loader.o
25 25
26ccflags-y += -Idrivers/hid/intel-ish-hid/ishtp26ccflags-y += -I $(srctree)/$(src)/ishtp
drivers/net/ethernet/chelsio/libcxgb/Makefile+1−1
@@ -1,4 +1,4 @@
1ccflags-y := -Idrivers/net/ethernet/chelsio/cxgb41ccflags-y := -I $(srctree)/$(src)/../cxgb4
2 2
3obj-$(CONFIG_CHELSIO_LIB) += libcxgb.o3obj-$(CONFIG_CHELSIO_LIB) += libcxgb.o
4 4
drivers/target/iscsi/cxgbit/Makefile+3−3
@@ -1,7 +1,7 @@
1# SPDX-License-Identifier: GPL-2.01# SPDX-License-Identifier: GPL-2.0
2ccflags-y := -Idrivers/net/ethernet/chelsio/cxgb42ccflags-y := -I $(srctree)/drivers/net/ethernet/chelsio/cxgb4
3ccflags-y += -Idrivers/net/ethernet/chelsio/libcxgb3ccflags-y += -I $(srctree)/drivers/net/ethernet/chelsio/libcxgb
4ccflags-y += -Idrivers/target/iscsi4ccflags-y += -I $(srctree)/drivers/target/iscsi
5 5
6obj-$(CONFIG_ISCSI_TARGET_CXGB4) += cxgbit.o6obj-$(CONFIG_ISCSI_TARGET_CXGB4) += cxgbit.o
7 7
drivers/usb/storage/Makefile+1−1
@@ -6,7 +6,7 @@ · 5 unmodified lines
6# Rewritten to use lists instead of if-statements.6# Rewritten to use lists instead of if-statements.
7#7#
8 8
9ccflags-y := -Idrivers/scsi9ccflags-y := -I $(srctree)/drivers/scsi
10 10
11obj-$(CONFIG_USB_UAS) += uas.o11obj-$(CONFIG_USB_UAS) += uas.o
12obj-$(CONFIG_USB_STORAGE) += usb-storage.o12obj-$(CONFIG_USB_STORAGE) += usb-storage.o
fs/ocfs2/dlm/Makefile+1−2
@@ -1,7 +1,6 @@
1ccflags-y := -I$(src)/..1ccflags-y := -I $(srctree)/$(src)/..
2 2
3obj-$(CONFIG_OCFS2_FS_O2CB) += ocfs2_dlm.o3obj-$(CONFIG_OCFS2_FS_O2CB) += ocfs2_dlm.o
4 4
5ocfs2_dlm-objs := dlmdomain.o dlmdebug.o dlmthread.o dlmrecovery.o \5ocfs2_dlm-objs := dlmdomain.o dlmdebug.o dlmthread.o dlmrecovery.o \
6 dlmmaster.o dlmast.o dlmconvert.o dlmlock.o dlmunlock.o6 dlmmaster.o dlmast.o dlmconvert.o dlmlock.o dlmunlock.o
7
fs/ocfs2/dlmfs/Makefile+1−1
@@ -1,4 +1,4 @@
1ccflags-y := -I$(src)/..1ccflags-y := -I $(srctree)/$(src)/..
2 2
3obj-$(CONFIG_OCFS2_FS) += ocfs2_dlmfs.o3obj-$(CONFIG_OCFS2_FS) += ocfs2_dlmfs.o
4 4
fs/xfs/Makefile+2−2
@@ -4,8 +4,8 @@ · 3 unmodified lines
4# All Rights Reserved.4# All Rights Reserved.
5#5#
6 6
7ccflags-y += -I$(src) # needed for trace events7ccflags-y += -I $(srctree)/$(src) # needed for trace events
8ccflags-y += -I$(src)/libxfs8ccflags-y += -I $(srctree)/$(src)/libxfs
9 9
10ccflags-$(CONFIG_XFS_DEBUG) += -g10ccflags-$(CONFIG_XFS_DEBUG) += -g
11 11
net/bpfilter/Makefile+1−1
@@ -5,7 +5,7 @@ · 4 unmodified lines
5 5
6hostprogs-y := bpfilter_umh6hostprogs-y := bpfilter_umh
7bpfilter_umh-objs := main.o7bpfilter_umh-objs := main.o
8KBUILD_HOSTCFLAGS += -Itools/include/ -Itools/include/uapi8KBUILD_HOSTCFLAGS += -I $(srctree)/tools/include/ -I $(srctree)/tools/include/uapi
9HOSTCC := $(CC)9HOSTCC := $(CC)
10 10
11ifeq ($(CONFIG_BPFILTER_UMH), y)11ifeq ($(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
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