[PATCH] fix: build aborts if SPACE characters are found in path.

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

 



Signed-off-by: Sunil Beta <betasam@xxxxxxxxx>
---
 Makefile |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Makefile b/Makefile
index 07bc925..48bfd8e 100644
--- a/Makefile
+++ b/Makefile
@@ -10,6 +10,8 @@ NAME = "Divemaster Edition"
 # Comments in this file are targeted only to the developer, do not
 # expect to learn how to build the kernel reading this file.

+CURDIRSPC := $(echo $(CURDIR) | sed "s/ /\\\ /g" )
+$(ifneq $(CURDIR),$(CURDIRSPC), $(error directory $(CURDIR) contains spaces.))
 # Do not:
 # o  use make's built-in rules and variables
 #    (this increases performance and avoids hard-to-debug behaviour);
@@ -118,6 +120,8 @@ ifneq ($(KBUILD_OUTPUT),)
 # check that the output directory actually exists
 saved-output := $(KBUILD_OUTPUT)
 KBUILD_OUTPUT := $(shell cd $(KBUILD_OUTPUT) && /bin/pwd)
+KBUILD_OUTPUT_SPC := $(shell echo $(KBUILD_OUTPUT) | sed "s/ /\\\ /g")
+$(ifneq $(KBUILD_OUTPUT),$(KBUILD_OUTPUT_SPC), $(error output
directory $(KBUILD_OUTPUT) contains spaces.))
 $(if $(KBUILD_OUTPUT),, \
      $(error output directory "$(saved-output)" does not exist))

--
1.7.10.4
-----
This resolves issues with multiple spaces in the source or target path
of the kernel. Fixing this completely would require changes to
mkmakefile among several other files. This is just to leave newbies
comfortable with an error message as to the reason the build failed.

Sunil Beta Baskar
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

  Powered by Linux