[WIP PATCH 06/30] build: modify uses of $(srctree) to assume trailing slash

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This isn't much more than `find | sed` to adjust all uses of $(srctree).
This is split into a separate commit to highlight the actual changes to
the build machinery.

Signed-off-by: Elliott Mitchell <ehem+linux@xxxxxxx>
---
`grep` was also used to locate things which needed other actions
(notably the non-toplevel Makefile adjustments), but this is roughly:

find . -name Kbuild\* -print0 | xargs -0 sed -i -e's,$(srctree)$,$(srctree:%/=%),' -e's,$(srctree)\([^,/]\),$(srctree:%/=%)\1,g' -es',$(srctree)/,$(srctree),g'

There could be goofs in here or missed bits.  I hope not, but...
---
 arch/arm/Kbuild                  | 2 +-
 arch/mips/Kbuild                 | 2 +-
 arch/mips/Kbuild.platforms       | 2 +-
 drivers/gpu/drm/nouveau/Kbuild   | 2 +-
 drivers/scsi/cxgbi/cxgb3i/Kbuild | 4 ++--
 drivers/scsi/cxgbi/cxgb4i/Kbuild | 4 ++--
 include/uapi/Kbuild              | 6 +++---
 7 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/arch/arm/Kbuild b/arch/arm/Kbuild
index b506622e7e23..a2205b97791f 100644
--- a/arch/arm/Kbuild
+++ b/arch/arm/Kbuild
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0-only
 obj-$(CONFIG_FPE_NWFPE)		+= nwfpe/
 # Put arch/arm/fastfpe/ to use this.
-obj-$(CONFIG_FPE_FASTFPE)	+= $(patsubst $(srctree)/$(src)/%,%,$(wildcard $(srctree)/$(src)/fastfpe/))
+obj-$(CONFIG_FPE_FASTFPE)	+= $(patsubst $(srctree)$(src)/%,%,$(wildcard $(srctree)$(src)/fastfpe/))
 obj-$(CONFIG_VFP)		+= vfp/
 obj-$(CONFIG_XEN)		+= xen/
 obj-$(CONFIG_VDSO)		+= vdso/
diff --git a/arch/mips/Kbuild b/arch/mips/Kbuild
index e2d623621a00..4aa066d63a9e 100644
--- a/arch/mips/Kbuild
+++ b/arch/mips/Kbuild
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0
 
 # platform specific definitions
-include $(srctree)/arch/mips/Kbuild.platforms
+include $(srctree)arch/mips/Kbuild.platforms
 obj-y := $(platform-y)
 
 # make clean traverses $(obj-) without having included .config, so
diff --git a/arch/mips/Kbuild.platforms b/arch/mips/Kbuild.platforms
index a2311c4bce6a..cd8439f4d51c 100644
--- a/arch/mips/Kbuild.platforms
+++ b/arch/mips/Kbuild.platforms
@@ -33,4 +33,4 @@ platform-$(CONFIG_SNI_RM)		+= sni/
 platform-$(CONFIG_MACH_TX49XX)		+= txx9/
 
 # include the platform specific files
-include $(patsubst %/, $(srctree)/arch/mips/%/Platform, $(platform-y))
+include $(patsubst %/, $(srctree)arch/mips/%/Platform, $(platform-y))
diff --git a/drivers/gpu/drm/nouveau/Kbuild b/drivers/gpu/drm/nouveau/Kbuild
index cf6b3a80c0c8..9038528a80d6 100644
--- a/drivers/gpu/drm/nouveau/Kbuild
+++ b/drivers/gpu/drm/nouveau/Kbuild
@@ -1,4 +1,4 @@
-NOUVEAU_PATH ?= $(srctree)
+NOUVEAU_PATH ?= $(srctree:%/=%)
 
 # SPDX-License-Identifier: MIT
 ccflags-y += -I $(NOUVEAU_PATH)/$(src)/include
diff --git a/drivers/scsi/cxgbi/cxgb3i/Kbuild b/drivers/scsi/cxgbi/cxgb3i/Kbuild
index 8d8a43f5ea80..abeec066f908 100644
--- a/drivers/scsi/cxgbi/cxgb3i/Kbuild
+++ b/drivers/scsi/cxgbi/cxgb3i/Kbuild
@@ -1,5 +1,5 @@
 # SPDX-License-Identifier: GPL-2.0
-ccflags-y += -I$(srctree)/drivers/net/ethernet/chelsio/cxgb3
-ccflags-y += -I$(srctree)/drivers/net/ethernet/chelsio/libcxgb
+ccflags-y += -I$(srctree)drivers/net/ethernet/chelsio/cxgb3
+ccflags-y += -I$(srctree)drivers/net/ethernet/chelsio/libcxgb
 
 obj-$(CONFIG_SCSI_CXGB3_ISCSI) += cxgb3i.o
diff --git a/drivers/scsi/cxgbi/cxgb4i/Kbuild b/drivers/scsi/cxgbi/cxgb4i/Kbuild
index fd3e0c964de6..f256cac0fcdc 100644
--- a/drivers/scsi/cxgbi/cxgb4i/Kbuild
+++ b/drivers/scsi/cxgbi/cxgb4i/Kbuild
@@ -1,5 +1,5 @@
 # SPDX-License-Identifier: GPL-2.0
-ccflags-y += -I$(srctree)/drivers/net/ethernet/chelsio/cxgb4
-ccflags-y += -I$(srctree)/drivers/net/ethernet/chelsio/libcxgb
+ccflags-y += -I$(srctree)drivers/net/ethernet/chelsio/cxgb4
+ccflags-y += -I$(srctree)drivers/net/ethernet/chelsio/libcxgb
 
 obj-$(CONFIG_SCSI_CXGB4_ISCSI) += cxgb4i.o
diff --git a/include/uapi/Kbuild b/include/uapi/Kbuild
index 61ee6e59c930..4b8401173ef5 100644
--- a/include/uapi/Kbuild
+++ b/include/uapi/Kbuild
@@ -1,13 +1,13 @@
 # SPDX-License-Identifier: GPL-2.0
-ifeq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/uapi/asm/a.out.h),)
+ifeq ($(wildcard $(srctree)arch/$(SRCARCH)/include/uapi/asm/a.out.h),)
 no-export-headers += linux/a.out.h
 endif
 
-ifeq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/uapi/asm/kvm.h),)
+ifeq ($(wildcard $(srctree)arch/$(SRCARCH)/include/uapi/asm/kvm.h),)
 no-export-headers += linux/kvm.h
 endif
 
-ifeq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/uapi/asm/kvm_para.h),)
+ifeq ($(wildcard $(srctree)arch/$(SRCARCH)/include/uapi/asm/kvm_para.h),)
 ifeq ($(wildcard $(objtree)/arch/$(SRCARCH)/include/generated/uapi/asm/kvm_para.h),)
 no-export-headers += linux/kvm_para.h
 endif
-- 
2.39.2





[Index of Archives]     [Linux&nblp;USB Development]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite Secrets]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux