@@ -1,5 +1,9 @@
# Makefile for QEMU.
+ifneq ($(words $(subst :, ,$(CURDIR))), 1)
+ $(error main directory cannot contain spaces nor colons)
+endif
+
# Always point to the root of the build tree (needs GNU make).
BUILD_DIR=$(CURDIR)
@@ -279,6 +279,11 @@ ld_has() {
# make source path absolute
source_path=$(cd "$(dirname -- "$0")"; pwd)
+if printf %s\\n "$source_path" "$PWD" | grep -q "[[:space:]:]";
+then
+ error_exit "main directory cannot contain spaces nor colons"
+fi
+
# default parameters
cpu=""
iasl="iasl"