Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/make/unit-tests make(1): add test for .END depending...



details:   https://anonhg.NetBSD.org/src/rev/3b43a806640b
branches:  trunk
changeset: 977409:3b43a806640b
user:      rillig <rillig%NetBSD.org@localhost>
date:      Fri Oct 23 19:28:17 2020 +0000

description:
make(1): add test for .END depending on another target

diffstat:

 usr.bin/make/unit-tests/deptgt-end.exp |  2 ++
 usr.bin/make/unit-tests/deptgt-end.mk  |  9 ++++++++-
 2 files changed, 10 insertions(+), 1 deletions(-)

diffs (36 lines):

diff -r 84c8c7abe703 -r 3b43a806640b usr.bin/make/unit-tests/deptgt-end.exp
--- a/usr.bin/make/unit-tests/deptgt-end.exp    Fri Oct 23 19:23:00 2020 +0000
+++ b/usr.bin/make/unit-tests/deptgt-end.exp    Fri Oct 23 19:28:17 2020 +0000
@@ -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
diff -r 84c8c7abe703 -r 3b43a806640b usr.bin/make/unit-tests/deptgt-end.mk
--- a/usr.bin/make/unit-tests/deptgt-end.mk     Fri Oct 23 19:23:00 2020 +0000
+++ b/usr.bin/make/unit-tests/deptgt-end.mk     Fri Oct 23 19:28:17 2020 +0000
@@ -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}' deferred
 
+# The .END node can define dependencies, just like a regular target.
+.END: end-action
+end-action: .NOTMAIN
+       : $@ '$${VAR}'
+       ...
+       : $@ '$${VAR}' deferred
+
 all:
        : $@ '$${VAR}'
        ...



Home | Main Index | Thread Index | Old Index