Module Name: src
Committed By: rillig
Date: Sat Aug 22 11:53:18 UTC 2020
Modified Files:
src/usr.bin/make/unit-tests: depsrc-usebefore.exp depsrc-usebefore.mk
Log Message:
make(1): extend test for .USEBEFORE
When several .USEBEFORE targets are added to another target, they are
added in reverse order. But the commands of each .USEBEFORE target are
added in normal order.
To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/make/unit-tests/depsrc-usebefore.exp
cvs rdiff -u -r1.4 -r1.5 src/usr.bin/make/unit-tests/depsrc-usebefore.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/depsrc-usebefore.exp
diff -u src/usr.bin/make/unit-tests/depsrc-usebefore.exp:1.2 src/usr.bin/make/unit-tests/depsrc-usebefore.exp:1.3
--- src/usr.bin/make/unit-tests/depsrc-usebefore.exp:1.2 Sat Aug 22 07:46:18 2020
+++ src/usr.bin/make/unit-tests/depsrc-usebefore.exp Sat Aug 22 11:53:18 2020
@@ -1,4 +1,6 @@
-first
-second
+first 1
+first 2
+second 1
+second 2
directly
exit status 0
Index: src/usr.bin/make/unit-tests/depsrc-usebefore.mk
diff -u src/usr.bin/make/unit-tests/depsrc-usebefore.mk:1.4 src/usr.bin/make/unit-tests/depsrc-usebefore.mk:1.5
--- src/usr.bin/make/unit-tests/depsrc-usebefore.mk:1.4 Sat Aug 22 07:49:44 2020
+++ src/usr.bin/make/unit-tests/depsrc-usebefore.mk Sat Aug 22 11:53:18 2020
@@ -1,4 +1,4 @@
-# $NetBSD: depsrc-usebefore.mk,v 1.4 2020/08/22 07:49:44 rillig Exp $
+# $NetBSD: depsrc-usebefore.mk,v 1.5 2020/08/22 11:53:18 rillig Exp $
#
# Tests for the special source .USEBEFORE in dependency declarations,
# which allows to prepend common commands to other targets.
@@ -6,16 +6,18 @@
all: action directly
first: .USEBEFORE
- @echo first # Using ${.TARGET} here would expand to "action"
+ @echo first 1 # Using ${.TARGET} here would expand to "action"
+ @echo first 2 # Using ${.TARGET} here would expand to "action"
second: .USEBEFORE
- @echo second
+ @echo second 1
+ @echo second 2
-# It's possible but uncommon to have a .USEBEFORE target with no commands.
+# It is possible but uncommon to have a .USEBEFORE target with no commands.
# This may happen as the result of expanding a .for loop.
empty: .USEBEFORE
-# It's possible but uncommon to directly make a .USEBEFORE target.
+# It is possible but uncommon to directly make a .USEBEFORE target.
directly: .USEBEFORE
@echo directly