Skip to content

Commit 9cc342f

Browse files
committed
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 48f6e3c ("kbuild: do not drop -I without parameter"). [1]: https://patchwork.kernel.org/patch/9632347/ Signed-off-by: Masahiro Yamada <[email protected]>
1 parent 14340de commit 9cc342f

File tree

17 files changed

+25
-26
lines changed

17 files changed

+25
-26
lines changed

arch/mips/pnx833x/Platform

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ endif
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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,8 @@ cpuincdir-y += cpu-common # Must be last
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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ endif
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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ CFLAGS_physaddr.o := $(nostackp)
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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ zlib := inffast.c inflate.c inftrees.c
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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ intel-ishtp-hid-objs += ishtp-hid-client.o
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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
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

0 commit comments

Comments
 (0)