summaryrefslogtreecommitdiff
path: root/GNUmakefile
diff options
context:
space:
mode:
Diffstat (limited to 'GNUmakefile')
-rw-r--r--GNUmakefile14
1 files changed, 13 insertions, 1 deletions
diff --git a/GNUmakefile b/GNUmakefile
index 0cdb67d..0bb8100 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -4,10 +4,22 @@
# Most of the complexity is dancing around to avoid having any
# possibly conflicting identifiers.
+# The flags that we actually want to pass to Make.
+desired_MAKEFLAGS = --no-builtin-rules
+desired_MAKEFLAGS += --no-builtin-variables
+desired_MAKEFLAGS += --warn-undefined-variables
+# Setting GNUMAKEFLAGS is important so that --no-builtin-variables
+# with --warn-undefined-variables doesn't cause Make (as of 4.4.1) to
+# print spurious warnings about it being undefined for internal use.
+desired_MAKEFLAGS += GNUMAKEFLAGS=''
+
+# Quiet this parent Make a bit.
MAKEFLAGS += --no-print-directory
+
+# Main.
rest = $(wordlist 2,$(words $1),$1)
target = $(or $(firstword $(MAKECMDGOALS)),default)
$(or $(call rest,$(MAKECMDGOALS)),_$(target)): $(target)
@:
$(target):
- @+$(MAKE) -f Makefile --no-builtin-rules --no-builtin-variables --warn-undefined-variables $(MAKECMDGOALS)
+ @$(MAKE) -f Makefile $(desired_MAKEFLAGS) $(MAKECMDGOALS)