Module Name: src
Committed By: rillig
Date: Fri Oct 23 19:28:17 UTC 2020
Modified Files:
src/usr.bin/make/unit-tests: deptgt-end.exp deptgt-end.mk
Log Message:
make(1): add test for .END depending on another target
To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/make/unit-tests/deptgt-end.exp
cvs rdiff -u -r1.5 -r1.6 src/usr.bin/make/unit-tests/deptgt-end.mk
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.bin/make/unit-tests/deptgt-end.exp
diff -u src/usr.bin/make/unit-tests/deptgt-end.exp:1.3 src/usr.bin/make/unit-tests/deptgt-end.exp:1.4
--- src/usr.bin/make/unit-tests/deptgt-end.exp:1.3 Tue Sep 22 19:41:09 2020
+++ src/usr.bin/make/unit-tests/deptgt-end.exp Fri Oct 23 19:28:17 2020
@@ -1,7 +1,9 @@
: .BEGIN '${VAR}'
: all '${VAR}'
+: end-action '${VAR}'
: .END '${VAR}'
: .END '${VAR}' deferred
: .BEGIN 'Should not be expanded.' deferred
: all 'Should not be expanded.' deferred
+: end-action 'Should not be expanded.' deferred
exit status 0
Index: src/usr.bin/make/unit-tests/deptgt-end.mk
diff -u src/usr.bin/make/unit-tests/deptgt-end.mk:1.5 src/usr.bin/make/unit-tests/deptgt-end.mk:1.6
--- src/usr.bin/make/unit-tests/deptgt-end.mk:1.5 Wed Sep 23 03:06:38 2020
+++ src/usr.bin/make/unit-tests/deptgt-end.mk Fri Oct 23 19:28:17 2020
@@ -1,4 +1,4 @@
-# $NetBSD: deptgt-end.mk,v 1.5 2020/09/23 03:06:38 rillig Exp $
+# $NetBSD: deptgt-end.mk,v 1.6 2020/10/23 19:28:17 rillig Exp $
#
# Tests for the special target .END in dependency declarations,
# which is run after making the desired targets.
@@ -18,6 +18,13 @@ VAR= Should not be expanded.
...
: $@ '$${VAR}' deferred
+# The .END node can define dependencies, just like a regular target.
+.END: end-action
+end-action: .NOTMAIN
+ : $@ '$${VAR}'
+ ...
+ : $@ '$${VAR}' deferred
+
all:
: $@ '$${VAR}'
...