summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorRobert Jarzmik <robert.jarzmik@free.fr>2016-04-02 21:38:53 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-09-30 10:18:35 +0200
commitd772ec1314f80de536aafc729855bcf3e691f997 (patch)
treec952eab378cd41b4e939c3bb4787729ede7b9dab /Makefile
parent9b6bbc3d96729c18eef9a3c39021967220bcc5e4 (diff)
kbuild: forbid kernel directory to contain spaces and colons
commit 51193b76bfff5027cf96ba63effae808ad67cca7 upstream. When the kernel path contains a space or a colon somewhere in the path name, the modules_install target doesn't work anymore, as the path names are not enclosed in double quotes. It is also supposed that and O= build will suffer from the same weakness as modules_install. Instead of checking and improving kbuild to resist to directories including these characters, error out early to prevent any build if the kernel's main directory contains a space. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Michal Marek <mmarek@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile4
1 files changed, 4 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index a50bb7c72b1c..05d83a80464f 100644
--- a/Makefile
+++ b/Makefile
@@ -128,6 +128,10 @@ _all:
# Cancel implicit rules on top Makefile
$(CURDIR)/Makefile Makefile: ;
+ifneq ($(words $(subst :, ,$(CURDIR))), 1)
+ $(error main directory cannot contain spaces nor colons)
+endif
+
ifneq ($(KBUILD_OUTPUT),)
# Invoke a second make in the output directory, passing relevant variables
# check that the output directory actually exists