summaryrefslogtreecommitdiff
path: root/usr.bin/make
diff options
context:
space:
mode:
authorrillig <rillig@NetBSD.org>2020-11-09 22:36:44 +0000
committerrillig <rillig@NetBSD.org>2020-11-09 22:36:44 +0000
commit93fbf3f5cdf116ff64a9feb66887f4c98b709c82 (patch)
tree1544cfe7afaf22ee1b2645b69d54e2944c973eea /usr.bin/make
parent9f672507fa2875fb52c228d798720a0e25bdca9c (diff)
make(1): add test for MAKEFILE after reading all files
Diffstat (limited to 'usr.bin/make')
-rw-r--r--usr.bin/make/unit-tests/varname-makefile.exp1
-rw-r--r--usr.bin/make/unit-tests/varname-makefile.mk9
2 files changed, 8 insertions, 2 deletions
diff --git a/usr.bin/make/unit-tests/varname-makefile.exp b/usr.bin/make/unit-tests/varname-makefile.exp
index 39a9383953d..67919c40019 100644
--- a/usr.bin/make/unit-tests/varname-makefile.exp
+++ b/usr.bin/make/unit-tests/varname-makefile.exp
@@ -1 +1,2 @@
+: In the end, MAKEFILE is /dev/null.
exit status 0
diff --git a/usr.bin/make/unit-tests/varname-makefile.mk b/usr.bin/make/unit-tests/varname-makefile.mk
index 785fe9301df..641c53de9cf 100644
--- a/usr.bin/make/unit-tests/varname-makefile.mk
+++ b/usr.bin/make/unit-tests/varname-makefile.mk
@@ -1,4 +1,4 @@
-# $NetBSD: varname-makefile.mk,v 1.2 2020/09/05 06:25:38 rillig Exp $
+# $NetBSD: varname-makefile.mk,v 1.3 2020/11/09 22:36:44 rillig Exp $
#
# Tests for the special MAKEFILE variable, which contains the current
# makefile from the -f command line option.
@@ -41,4 +41,9 @@ MAKEFILE= overwritten
.endif
all:
- @:;
+ # MAKEFILE is the file that appeared last in the command line.
+ : In the end, MAKEFILE is ${MAKEFILE}.
+
+# Additional makefiles can be added while reading a makefile. They will be
+# read in order.
+.MAKEFLAGS: -f /dev/null