aboutsummaryrefslogtreecommitdiff
path: root/contrib/bmake/unit-tests/dep-colon.mk
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/bmake/unit-tests/dep-colon.mk')
-rw-r--r--contrib/bmake/unit-tests/dep-colon.mk18
1 files changed, 15 insertions, 3 deletions
diff --git a/contrib/bmake/unit-tests/dep-colon.mk b/contrib/bmake/unit-tests/dep-colon.mk
index 7355c59ae557..e9931c9b2cf8 100644
--- a/contrib/bmake/unit-tests/dep-colon.mk
+++ b/contrib/bmake/unit-tests/dep-colon.mk
@@ -1,8 +1,20 @@
-# $NetBSD: dep-colon.mk,v 1.2 2020/08/16 14:25:16 rillig Exp $
+# $NetBSD: dep-colon.mk,v 1.3 2020/10/17 20:10:04 rillig Exp $
#
# Tests for the : operator in dependency declarations.
# TODO: Implementation
-all:
- @:;
+# In a dependency declaration line, there may be a shell command after the
+# sources. It is separated by a semicolon. This "feature" is required by
+# POSIX. It is seldom used, if at all.
+all: target1
+target1: source1; @echo making ${.TARGET} from ${.ALLSRC}
+source1: .PHONY
+
+# The semicolon for separating the sources from the creation commands must
+# appear at the top-level. The semicolons inside the :S;1;2; modifier are
+# skipped when looking for the semicolon that separates the sources from
+# the commands.
+all: target2
+target2: source${:U1:S;1;2;}; @echo making ${.TARGET} from ${.ALLSRC}
+source2: .PHONY