All of lore.kernel.org
 help / color / mirror / Atom feed
From: Elliott Mitchell <ehem+linux@m5p.com>
To: masahiroy@kernel.org, nathan@kernel.org, nicolas@fjasle.eu
Cc: linux-kbuild@vger.kernel.org
Subject: [WIP PATCH 30/30] tools/build: modify uses of $(objtree) to assume trailing slash
Date: Sun, 3 Mar 2024 15:24:50 -0800	[thread overview]
Message-ID: <87d95fd7abd1449477cba6d9fc201fd4eedd7df5.1709508292.git.ehem+linux@m5p.com> (raw)
In-Reply-To: <cover.1709508290.git.ehem+linux@m5p.com>

Date: Tue, 20 Feb 2024 09:13:37 -0800

This isn't much more than `find | sed` to adjust all uses of $(objtree).
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 . -name Makefile\* -print0 | xargs -0 sed -i -e's,$(objtree)$,$(objtree:%/=%),' -e's,$(objtree)\([^,/]\),$(objtree:%/=%)\1,g' -es',$(objtree)/,$(objtree),g'

There could be goofs in here or missed bits.  I hope not, but...
---
 tools/perf/Makefile.perf                | 2 +-
 tools/testing/selftests/nolibc/Makefile | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index 626b07d34c9f..a347500f50b6 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -150,7 +150,7 @@ srctree := $(dir $(srctree:%/=%))
 endif
 
 ifneq ($(objtree),)
-#$(info Determined 'objtree' to be $(objtree))
+#$(info Determined 'objtree' to be $(objtree:%/=%))
 endif
 
 ifneq ($(OUTPUT),)
diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile
index 99eebfb35468..82e8d3478639 100644
--- a/tools/testing/selftests/nolibc/Makefile
+++ b/tools/testing/selftests/nolibc/Makefile
@@ -65,7 +65,7 @@ IMAGE_ppc64le    = arch/powerpc/boot/zImage
 IMAGE_riscv      = arch/riscv/boot/Image
 IMAGE_s390       = arch/s390/boot/bzImage
 IMAGE_loongarch  = arch/loongarch/boot/vmlinuz.efi
-IMAGE            = $(objtree)$(IMAGE_$(XARCH))
+IMAGE            = $(objtree:%/=%)$(IMAGE_$(XARCH))
 IMAGE_NAME       = $(notdir $(IMAGE))
 
 # default kernel configurations that appear to be usable
@@ -230,7 +230,7 @@ run-user: nolibc-test
 	$(Q)$(REPORT) $(CURDIR)/run.out
 
 initramfs.cpio: kernel nolibc-test
-	$(QUIET_GEN)echo 'file /init nolibc-test 755 0 0' | $(objtree)usr/gen_init_cpio - > initramfs.cpio
+	$(QUIET_GEN)echo 'file /init nolibc-test 755 0 0' | $(objtree:%/=%)usr/gen_init_cpio - > initramfs.cpio
 
 initramfs: nolibc-test
 	$(QUIET_MKDIR)mkdir -p initramfs
@@ -240,7 +240,7 @@ initramfs: nolibc-test
 defconfig:
 	$(Q)$(MAKE) -C $(srctree:%/=%) ARCH=$(ARCH) CC=$(CC) CROSS_COMPILE=$(CROSS_COMPILE) mrproper $(DEFCONFIG) prepare
 	$(Q)if [ -n "$(EXTRACONFIG)" ]; then \
-		$(srctree)scripts/config --file $(objtree)/.config $(EXTRACONFIG); \
+		$(srctree)scripts/config --file $(objtree).config $(EXTRACONFIG); \
 		$(MAKE) -C $(srctree:%/=%) ARCH=$(ARCH) CC=$(CC) CROSS_COMPILE=$(CROSS_COMPILE) olddefconfig < /dev/null; \
 	fi
 
-- 
2.39.2


  parent reply	other threads:[~2024-03-04  2:53 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-03 23:24 [WIP PATCH 00/30] Adding trailing slash to $(*tree) Elliott Mitchell
2024-03-01 19:48 ` [WIP PATCH 07/30] build: modify uses of $(srctree) to assume trailing slash Elliott Mitchell
2024-03-01 19:48 ` [WIP PATCH 06/30] " Elliott Mitchell
2024-03-01 19:48 ` [WIP PATCH 29/30] tools/build: " Elliott Mitchell
2024-03-01 19:48 ` [WIP PATCH 11/30] scripts: " Elliott Mitchell
2024-03-01 20:03 ` [WIP PATCH 12/30] " Elliott Mitchell
2024-03-01 20:03 ` [WIP PATCH 08/30] build: " Elliott Mitchell
2024-03-01 20:51 ` [WIP PATCH 01/30] build: replace uses of $(abspath ) with existing variables Elliott Mitchell
2024-03-04  9:50   ` Nicolas Schier
2024-03-04 10:01     ` Nicolas Schier
2024-03-04 19:45       ` Elliott Mitchell
2024-03-05 10:51         ` Nicolas Schier
2024-03-01 23:26 ` [WIP PATCH 16/30] scripts/dtc: dtx_diff: include trailing slash in ${srctree} variable Elliott Mitchell
2024-03-01 23:50 ` [WIP PATCH 25/30] scripts/coccicheck: modify to handle ${srctree} with trailing slash Elliott Mitchell
2024-03-01 23:50 ` [WIP PATCH 02/30] " Elliott Mitchell
2024-03-02  0:29 ` [WIP PATCH 15/30] build/scripts: install.sh: modify use of ${srctree} for " Elliott Mitchell
2024-03-02  0:32 ` [WIP PATCH 17/30] build/scripts: generate_initcall_order.pl: " Elliott Mitchell
2024-03-02  0:33 ` [WIP PATCH 18/30] build/scripts: streamline_config.pl: " Elliott Mitchell
2024-03-02  1:08 ` [WIP PATCH 14/30] build/scripts: link-vmlinux.sh: modify use of ${objtree} " Elliott Mitchell
2024-03-02  1:43 ` [WIP PATCH 19/30] scripts/package: mkdebian: modify use of ${srctree} to assume " Elliott Mitchell
2024-03-02  1:43 ` [WIP PATCH 20/30] scripts/package: buildtar: " Elliott Mitchell
2024-03-02  1:46 ` [WIP PATCH 22/30] scripts/nsdeps: " Elliott Mitchell
2024-03-02  1:47 ` [WIP PATCH 23/30] build/scripts: makelst: modify suggested use of ${srctree} for " Elliott Mitchell
2024-03-02  2:01 ` [WIP PATCH 21/30] scripts/package: mkspec: modify use of ${srctree} to assume " Elliott Mitchell
2024-03-02  2:02 ` [WIP PATCH 24/30] scripts/generate_rust_analyzer.py: modify use of ${srctree} for " Elliott Mitchell
2024-03-03 22:11 ` [WIP PATCH 03/30] build: handle optional trailing slash in $(srctree) Elliott Mitchell
2024-03-03 23:24 ` [WIP PATCH 13/30] scripts: modify uses of $(objtree) to assume trailing slash Elliott Mitchell
2024-03-03 23:24 ` [WIP PATCH 10/30] scripts: modify uses of $(srctree) " Elliott Mitchell
2024-03-03 23:24 ` [WIP PATCH 09/30] build: modify uses of $(objtree) " Elliott Mitchell
2024-03-03 23:24 ` [WIP PATCH 27/30] tools/build: add trailing slash to $(*tree) Elliott Mitchell
2024-03-03 23:24 ` [WIP PATCH 28/30] tools/build: modify uses of $(srctree) to assume trailing slash Elliott Mitchell
2024-03-03 23:24 ` [WIP PATCH 05/30] build: " Elliott Mitchell
2024-03-03 23:24 ` Elliott Mitchell [this message]
2024-03-03 23:24 ` [WIP PATCH 26/30] build: change $(*tree) to empty for current directory Elliott Mitchell
2024-03-03 23:24 ` [WIP PATCH 04/30] build: add trailing slash to $(*tree) Elliott Mitchell
2024-03-04  9:57 ` [WIP PATCH 00/30] Adding " Nicolas Schier
2024-03-04 19:36   ` Elliott Mitchell
2024-03-05 10:43     ` Nicolas Schier
2024-03-07  0:02       ` Elliott Mitchell
2024-03-05 15:20     ` Masahiro Yamada
2024-03-07  0:09       ` Elliott Mitchell
2024-03-10 13:07         ` Masahiro Yamada
2024-03-12  0:15           ` Elliott Mitchell
2024-03-13  4:22             ` Masahiro Yamada

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87d95fd7abd1449477cba6d9fc201fd4eedd7df5.1709508292.git.ehem+linux@m5p.com \
    --to=ehem+linux@m5p.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=nathan@kernel.org \
    --cc=nicolas@fjasle.eu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.