diff mbox

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

Message ID CAK2BWApu9PjkmDdV4HoFXcq9KTh4e57iEdwYn9muVmYRwRNXgw@mail.gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Sunil Beta Baskar Jan. 18, 2013, 2:33 p.m. UTC
Signed-off-by: Sunil Beta <betasam@gmail.com>
---
 Makefile |    4 ++++
 1 file changed, 4 insertions(+)


--
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@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Michal Marek Feb. 15, 2013, 3:31 p.m. UTC | #1
On 18.1.2013 15:33, Sunil Beta Baskar wrote:
> Signed-off-by: Sunil Beta <betasam@gmail.com>
> ---
>  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.))

You do not need to call shell and sed here. Use the findstring make
function and the $(space) variable from scripts/Kbuild.include. Also,
while at it, could you also add a check for colon? This breaks the build
in similar way.

Thanks,
Michal
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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))