diff mbox series

[WIP,29/30] tools/build: modify uses of $(srctree) to assume trailing slash

Message ID cb592dbec84c0b00eba2e7c3cfb53dabd67ba6a3.1709508292.git.ehem+linux@m5p.com (mailing list archive)
State New
Headers show
Series Adding trailing slash to $(*tree) | expand

Commit Message

Elliott Mitchell March 1, 2024, 7:48 p.m. UTC
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@m5p.com>
---
`grep` was also used to locate things which needed other actions
(notably the non-toplevel Makefile adjustments), but this is roughly:

find tools -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...
---
 tools/testing/cxl/Kbuild         | 4 ++--
 tools/testing/cxl/test/Kbuild    | 2 +-
 tools/testing/nvdimm/Kbuild      | 4 ++--
 tools/testing/nvdimm/test/Kbuild | 4 ++--
 4 files changed, 7 insertions(+), 7 deletions(-)
diff mbox series

Patch

diff --git a/tools/testing/cxl/Kbuild b/tools/testing/cxl/Kbuild
index 030b388800f0..75069a04f29d 100644
--- a/tools/testing/cxl/Kbuild
+++ b/tools/testing/cxl/Kbuild
@@ -18,9 +18,9 @@  ldflags-y += --wrap=cxl_endpoint_parse_cdat
 DRIVERS := ../../../drivers
 CXL_SRC := $(DRIVERS)/cxl
 CXL_CORE_SRC := $(DRIVERS)/cxl/core
-ccflags-y := -I$(srctree)/drivers/cxl/
+ccflags-y := -I$(srctree)drivers/cxl/
 ccflags-y += -D__mock=__weak
-ccflags-y += -DTRACE_INCLUDE_PATH=$(CXL_CORE_SRC) -I$(srctree)/drivers/cxl/core/
+ccflags-y += -DTRACE_INCLUDE_PATH=$(CXL_CORE_SRC) -I$(srctree)drivers/cxl/core/
 
 obj-m += cxl_acpi.o
 
diff --git a/tools/testing/cxl/test/Kbuild b/tools/testing/cxl/test/Kbuild
index 6b1927897856..6da97dfb9cf0 100644
--- a/tools/testing/cxl/test/Kbuild
+++ b/tools/testing/cxl/test/Kbuild
@@ -1,5 +1,5 @@ 
 # SPDX-License-Identifier: GPL-2.0
-ccflags-y := -I$(srctree)/drivers/cxl/ -I$(srctree)/drivers/cxl/core
+ccflags-y := -I$(srctree)drivers/cxl/ -I$(srctree)drivers/cxl/core
 
 obj-m += cxl_test.o
 obj-m += cxl_mock.o
diff --git a/tools/testing/nvdimm/Kbuild b/tools/testing/nvdimm/Kbuild
index 91a3627f301a..c558ea1bf361 100644
--- a/tools/testing/nvdimm/Kbuild
+++ b/tools/testing/nvdimm/Kbuild
@@ -21,8 +21,8 @@  DRIVERS := ../../../drivers
 NVDIMM_SRC := $(DRIVERS)/nvdimm
 ACPI_SRC := $(DRIVERS)/acpi/nfit
 DAX_SRC := $(DRIVERS)/dax
-ccflags-y := -I$(srctree)/drivers/nvdimm/
-ccflags-y += -I$(srctree)/drivers/acpi/nfit/
+ccflags-y := -I$(srctree)drivers/nvdimm/
+ccflags-y += -I$(srctree)drivers/acpi/nfit/
 
 obj-$(CONFIG_LIBNVDIMM) += libnvdimm.o
 obj-$(CONFIG_BLK_DEV_PMEM) += nd_pmem.o
diff --git a/tools/testing/nvdimm/test/Kbuild b/tools/testing/nvdimm/test/Kbuild
index 003d48f5f24f..eaa3bed8360e 100644
--- a/tools/testing/nvdimm/test/Kbuild
+++ b/tools/testing/nvdimm/test/Kbuild
@@ -1,6 +1,6 @@ 
 # SPDX-License-Identifier: GPL-2.0
-ccflags-y := -I$(srctree)/drivers/nvdimm/
-ccflags-y += -I$(srctree)/drivers/acpi/nfit/
+ccflags-y := -I$(srctree)drivers/nvdimm/
+ccflags-y += -I$(srctree)drivers/acpi/nfit/
 
 obj-m += nfit_test.o
 obj-m += nfit_test_iomap.o