summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2019-05-13 02:22:16 -0400
committerMasahiro Yamada <yamada.masahiro@socionext.com>2019-05-17 22:49:57 -0400
commit9cc342f6c4a06ea613ddef1bcaa25409260aec63 (patch)
tree4ff056e8db10185fbaaa78375f43f67ac2899af1
parent14340de506c9aa08baa9540ee6250c9d978c16b7 (diff)
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/ Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
-rw-r--r--arch/mips/pnx833x/Platform2
-rw-r--r--arch/powerpc/Makefile2
-rw-r--r--arch/sh/Makefile4
-rw-r--r--arch/x86/kernel/Makefile2
-rw-r--r--arch/x86/mm/Makefile2
-rw-r--r--arch/xtensa/boot/lib/Makefile2
-rw-r--r--drivers/hid/intel-ish-hid/Makefile2
-rw-r--r--drivers/net/ethernet/chelsio/libcxgb/Makefile2
-rw-r--r--drivers/target/iscsi/cxgbit/Makefile6
-rw-r--r--drivers/usb/storage/Makefile2
-rw-r--r--fs/ocfs2/dlm/Makefile3
-rw-r--r--fs/ocfs2/dlmfs/Makefile2
-rw-r--r--fs/xfs/Makefile4
-rw-r--r--net/bpfilter/Makefile2
-rw-r--r--scripts/dtc/Makefile6
-rw-r--r--scripts/genksyms/Makefile4
-rw-r--r--scripts/kconfig/Makefile4
17 files changed, 25 insertions, 26 deletions
diff --git a/arch/mips/pnx833x/Platform b/arch/mips/pnx833x/Platform
index 794526caab12..6b1a847d593f 100644
--- a/arch/mips/pnx833x/Platform
+++ b/arch/mips/pnx833x/Platform
@@ -1,5 +1,5 @@
1# NXP STB225 1# NXP STB225
2platform-$(CONFIG_SOC_PNX833X) += pnx833x/ 2platform-$(CONFIG_SOC_PNX833X) += pnx833x/
3cflags-$(CONFIG_SOC_PNX833X) += -Iarch/mips/include/asm/mach-pnx833x 3cflags-$(CONFIG_SOC_PNX833X) += -I $(srctree)/arch/mips/include/asm/mach-pnx833x
4load-$(CONFIG_NXP_STB220) += 0xffffffff80001000 4load-$(CONFIG_NXP_STB220) += 0xffffffff80001000
5load-$(CONFIG_NXP_STB225) += 0xffffffff80001000 5load-$(CONFIG_NXP_STB225) += 0xffffffff80001000
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
index 258ea6b2f2e7..c345b79414a9 100644
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -211,7 +211,7 @@ endif
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)
diff --git a/arch/sh/Makefile b/arch/sh/Makefile
index 4009bef62fe9..b4a86f27e048 100644
--- a/arch/sh/Makefile
+++ b/arch/sh/Makefile
@@ -191,8 +191,8 @@ cpuincdir-y += cpu-common # Must be last
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)
diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile
index 00b7e27bc2b7..ce1b5cc360a2 100644
--- a/arch/x86/kernel/Makefile
+++ b/arch/x86/kernel/Makefile
@@ -42,7 +42,7 @@ endif
42# non-deterministic coverage. 42# non-deterministic coverage.
43KCOV_INSTRUMENT := n 43KCOV_INSTRUMENT := n
44 44
45CFLAGS_irq.o := -I$(src)/../include/asm/trace 45CFLAGS_irq.o := -I $(srctree)/$(src)/../include/asm/trace
46 46
47obj-y := process_$(BITS).o signal.o 47obj-y := process_$(BITS).o signal.o
48obj-$(CONFIG_COMPAT) += signal_compat.o 48obj-$(CONFIG_COMPAT) += signal_compat.o
diff --git a/arch/x86/mm/Makefile b/arch/x86/mm/Makefile
index 4b101dd6e52f..84373dc9b341 100644
--- a/arch/x86/mm/Makefile
+++ b/arch/x86/mm/Makefile
@@ -21,7 +21,7 @@ CFLAGS_physaddr.o := $(nostackp)
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/trace 24CFLAGS_fault.o := -I $(srctree)/$(src)/../include/asm/trace
25 25
26obj-$(CONFIG_X86_PAT) += pat_rbtree.o 26obj-$(CONFIG_X86_PAT) += pat_rbtree.o
27 27
diff --git a/arch/xtensa/boot/lib/Makefile b/arch/xtensa/boot/lib/Makefile
index 355127faade1..e3d717c7bfa1 100644
--- a/arch/xtensa/boot/lib/Makefile
+++ b/arch/xtensa/boot/lib/Makefile
@@ -7,7 +7,7 @@ zlib := inffast.c inflate.c inftrees.c
7 7
8lib-y += $(zlib:.c=.o) zmem.o 8lib-y += $(zlib:.c=.o) zmem.o
9 9
10ccflags-y := -Ilib/zlib_inflate 10ccflags-y := -I $(srctree)/lib/zlib_inflate
11ifdef CONFIG_FUNCTION_TRACER 11ifdef CONFIG_FUNCTION_TRACER
12CFLAGS_REMOVE_inflate.o = -pg 12CFLAGS_REMOVE_inflate.o = -pg
13CFLAGS_REMOVE_zmem.o = -pg 13CFLAGS_REMOVE_zmem.o = -pg
diff --git a/drivers/hid/intel-ish-hid/Makefile b/drivers/hid/intel-ish-hid/Makefile
index 2de97e4b7740..f0a82b1c7cb9 100644
--- a/drivers/hid/intel-ish-hid/Makefile
+++ b/drivers/hid/intel-ish-hid/Makefile
@@ -23,4 +23,4 @@ intel-ishtp-hid-objs += ishtp-hid-client.o
23obj-$(CONFIG_INTEL_ISH_FIRMWARE_DOWNLOADER) += intel-ishtp-loader.o 23obj-$(CONFIG_INTEL_ISH_FIRMWARE_DOWNLOADER) += intel-ishtp-loader.o
24intel-ishtp-loader-objs += ishtp-fw-loader.o 24intel-ishtp-loader-objs += ishtp-fw-loader.o
25 25
26ccflags-y += -Idrivers/hid/intel-ish-hid/ishtp 26ccflags-y += -I $(srctree)/$(src)/ishtp
diff --git a/drivers/net/ethernet/chelsio/libcxgb/Makefile b/drivers/net/ethernet/chelsio/libcxgb/Makefile
index 2534e30a1560..441913b5221e 100644
--- a/drivers/net/ethernet/chelsio/libcxgb/Makefile
+++ b/drivers/net/ethernet/chelsio/libcxgb/Makefile
@@ -1,4 +1,4 @@
1ccflags-y := -Idrivers/net/ethernet/chelsio/cxgb4 1ccflags-y := -I $(srctree)/$(src)/../cxgb4
2 2
3obj-$(CONFIG_CHELSIO_LIB) += libcxgb.o 3obj-$(CONFIG_CHELSIO_LIB) += libcxgb.o
4 4
diff --git a/drivers/target/iscsi/cxgbit/Makefile b/drivers/target/iscsi/cxgbit/Makefile
index d16aaae7ba2a..0dcaf2006f78 100644
--- a/drivers/target/iscsi/cxgbit/Makefile
+++ b/drivers/target/iscsi/cxgbit/Makefile
@@ -1,7 +1,7 @@
1# SPDX-License-Identifier: GPL-2.0 1# SPDX-License-Identifier: GPL-2.0
2ccflags-y := -Idrivers/net/ethernet/chelsio/cxgb4 2ccflags-y := -I $(srctree)/drivers/net/ethernet/chelsio/cxgb4
3ccflags-y += -Idrivers/net/ethernet/chelsio/libcxgb 3ccflags-y += -I $(srctree)/drivers/net/ethernet/chelsio/libcxgb
4ccflags-y += -Idrivers/target/iscsi 4ccflags-y += -I $(srctree)/drivers/target/iscsi
5 5
6obj-$(CONFIG_ISCSI_TARGET_CXGB4) += cxgbit.o 6obj-$(CONFIG_ISCSI_TARGET_CXGB4) += cxgbit.o
7 7
diff --git a/drivers/usb/storage/Makefile b/drivers/usb/storage/Makefile
index c5126a4cd954..a67ddcbb4e24 100644
--- a/drivers/usb/storage/Makefile
+++ b/drivers/usb/storage/Makefile
@@ -6,7 +6,7 @@
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/scsi 9ccflags-y := -I $(srctree)/drivers/scsi
10 10
11obj-$(CONFIG_USB_UAS) += uas.o 11obj-$(CONFIG_USB_UAS) += uas.o
12obj-$(CONFIG_USB_STORAGE) += usb-storage.o 12obj-$(CONFIG_USB_STORAGE) += usb-storage.o
diff --git a/fs/ocfs2/dlm/Makefile b/fs/ocfs2/dlm/Makefile
index ef2854422a6e..3d4041f0431e 100644
--- a/fs/ocfs2/dlm/Makefile
+++ b/fs/ocfs2/dlm/Makefile
@@ -1,7 +1,6 @@
1ccflags-y := -I$(src)/.. 1ccflags-y := -I $(srctree)/$(src)/..
2 2
3obj-$(CONFIG_OCFS2_FS_O2CB) += ocfs2_dlm.o 3obj-$(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.o 6 dlmmaster.o dlmast.o dlmconvert.o dlmlock.o dlmunlock.o
7
diff --git a/fs/ocfs2/dlmfs/Makefile b/fs/ocfs2/dlmfs/Makefile
index 33431a0296a3..0a0b93d940fe 100644
--- a/fs/ocfs2/dlmfs/Makefile
+++ b/fs/ocfs2/dlmfs/Makefile
@@ -1,4 +1,4 @@
1ccflags-y := -I$(src)/.. 1ccflags-y := -I $(srctree)/$(src)/..
2 2
3obj-$(CONFIG_OCFS2_FS) += ocfs2_dlmfs.o 3obj-$(CONFIG_OCFS2_FS) += ocfs2_dlmfs.o
4 4
diff --git a/fs/xfs/Makefile b/fs/xfs/Makefile
index 1dfc6df2e2bd..91831975363b 100644
--- a/fs/xfs/Makefile
+++ b/fs/xfs/Makefile
@@ -4,8 +4,8 @@
4# All Rights Reserved. 4# All Rights Reserved.
5# 5#
6 6
7ccflags-y += -I$(src) # needed for trace events 7ccflags-y += -I $(srctree)/$(src) # needed for trace events
8ccflags-y += -I$(src)/libxfs 8ccflags-y += -I $(srctree)/$(src)/libxfs
9 9
10ccflags-$(CONFIG_XFS_DEBUG) += -g 10ccflags-$(CONFIG_XFS_DEBUG) += -g
11 11
diff --git a/net/bpfilter/Makefile b/net/bpfilter/Makefile
index 854395fb98cd..aa945ab5b655 100644
--- a/net/bpfilter/Makefile
+++ b/net/bpfilter/Makefile
@@ -5,7 +5,7 @@
5 5
6hostprogs-y := bpfilter_umh 6hostprogs-y := bpfilter_umh
7bpfilter_umh-objs := main.o 7bpfilter_umh-objs := main.o
8KBUILD_HOSTCFLAGS += -Itools/include/ -Itools/include/uapi 8KBUILD_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)
diff --git a/scripts/dtc/Makefile b/scripts/dtc/Makefile
index 5f227d8d39d8..82160808765c 100644
--- a/scripts/dtc/Makefile
+++ b/scripts/dtc/Makefile
@@ -9,7 +9,7 @@ dtc-objs := dtc.o flattree.o fstree.o data.o livetree.o treesource.o \
9dtc-objs += dtc-lexer.lex.o dtc-parser.tab.o 9dtc-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 compile 11# Source files need to get at the userspace version of libfdt_env.h to compile
12HOST_EXTRACFLAGS := -I$(src)/libfdt 12HOST_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
23endif 23endif
24 24
25# Generated files need one more search path to include headers in source tree 25# 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 explicitly 29# dependencies on generated files need to be listed explicitly
30$(obj)/dtc-lexer.lex.o: $(obj)/dtc-parser.tab.h 30$(obj)/dtc-lexer.lex.o: $(obj)/dtc-parser.tab.h
diff --git a/scripts/genksyms/Makefile b/scripts/genksyms/Makefile
index 03b7ce97de14..66c314bc5933 100644
--- a/scripts/genksyms/Makefile
+++ b/scripts/genksyms/Makefile
@@ -31,8 +31,8 @@ $(obj)/parse.tab.h: $(src)/parse.y FORCE
31endif 31endif
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 explicitly 37# dependencies on generated files need to be listed explicitly
38$(obj)/lex.lex.o: $(obj)/parse.tab.h 38$(obj)/lex.lex.o: $(obj)/parse.tab.h
diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index 7c5dc31c1d95..5e0cd86cb4a7 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -147,8 +147,8 @@ common-objs := confdata.o expr.o lexer.lex.o parser.tab.o preprocess.o \
147 symbol.o 147 symbol.o
148 148
149$(obj)/lexer.lex.o: $(obj)/parser.tab.h 149$(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 targets 153# conf: Used for defconfig, oldconfig and related targets
154hostprogs-y += conf 154hostprogs-y += conf