[WIP PATCH 04/30] build: add trailing slash to $(*tree)

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

 



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

This better handles the case of $({src|obj}tree) being the current
directory and $({src|obj}) being an absolute path.  Instead of being
".", $({src|obj}tree) ends up empty, and $({src|obj}) can be directly
appended.

Signed-off-by: Elliott Mitchell <ehem+linux@xxxxxxx>
---
I suspect the Makefile sections in tools/ are attempting to solve the
*exact* *same* issue.  Problem is that workaround requires changes in
every Makefile, whereas this looks closer to the root cause.

I'm less than 100% sure I've avoided all spacing changes.  I forget
where, but I seem to recall running into a space which was instead a tab.

`find . -name Makefile* -print0 | xargs -0 grep -e^\[\[:space:\]\]\*srctree.\*=`
is a handy way to locate these.
---
 Makefile | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/Makefile b/Makefile
index a7696f13bece..6d7758a76429 100644
--- a/Makefile
+++ b/Makefile
@@ -246,24 +246,24 @@ else # need-sub-make
 
 ifeq ($(abs_srctree),$(abs_objtree))
         # building in the source tree
-        srctree := .
+        srctree := ./
 	building_out_of_srctree :=
 else
         ifeq ($(abs_srctree)/,$(dir $(abs_objtree)))
                 # building in a subdirectory of the source tree
-                srctree := ..
+                srctree := ../
         else
-                srctree := $(abs_srctree)
+                srctree := $(abs_srctree)/
         endif
 	building_out_of_srctree := 1
 endif
 
 ifneq ($(KBUILD_ABS_SRCTREE),)
-srctree := $(abs_srctree)
+srctree := $(abs_srctree)/
 endif
 
-objtree		:= .
-VPATH		:= $(srctree)
+objtree		:= ./
+VPATH		:= $(srctree).
 
 export building_out_of_srctree srctree objtree VPATH
 
-- 
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