summaryrefslogtreecommitdiff
path: root/buildlib/defaults.mak
diff options
context:
space:
mode:
Diffstat (limited to 'buildlib/defaults.mak')
-rw-r--r--buildlib/defaults.mak16
1 files changed, 14 insertions, 2 deletions
diff --git a/buildlib/defaults.mak b/buildlib/defaults.mak
index 3e145f673..17a6b8ac8 100644
--- a/buildlib/defaults.mak
+++ b/buildlib/defaults.mak
@@ -40,13 +40,25 @@ BUILD_POSSIBLE := $(BASE) $(BASE)/build-$(shell uname -m) $(BASE)/build
endif
BUILDX:= $(foreach i,$(BUILD_POSSIBLE),$(wildcard $(i)/environment.mak*))
-BUILDX:= $(patsubst %/,%,$(firstword $(dir $(BUILDX))))
ifeq ($(words $(BUILDX)),0)
-error-all:
+
+# Check for a busted wildcard function. We use this function in several
+# places, it must work.
+ifeq ($(words $(wildcard *)),0)
+error-all/environment.mak:
+ echo You have a broken version of GNU Make - upgrade.
+else
+error-all/environment.mak:
echo Can't find the build directory in $(BUILD_POSSIBLE) -- use BUILD=
endif
+# Force include below to come to the error target
+BUILDX := error-all
+else
+BUILDX:= $(patsubst %/,%,$(firstword $(dir $(BUILDX))))
+endif
+
override BUILD := $(BUILDX)
# Base definitions