aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Jarzmik <robert.jarzmik@free.fr>2016-04-02 21:38:53 +0200
committerMoyster <oysterized@gmail.com>2018-11-29 16:57:57 +0100
commit4a85459b6d3ad64a84d8691cf19d2a91b2497c58 (patch)
tree0b48267fc73b7310d72103fb1a9ff3623c475570
parent00724ff58cc0489a0321e72e7fc6aec10ef9a3b4 (diff)
kbuild: forbid kernel directory to contain spaces and colons
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>
-rw-r--r--Makefile4
1 files changed, 4 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 3c7c207ef..438430021 100644
--- a/Makefile
+++ b/Makefile
@@ -113,6 +113,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