aboutsummaryrefslogtreecommitdiff
path: root/contrib/bmake/unit-tests/dep.mk
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/bmake/unit-tests/dep.mk')
-rw-r--r--contrib/bmake/unit-tests/dep.mk28
1 files changed, 25 insertions, 3 deletions
diff --git a/contrib/bmake/unit-tests/dep.mk b/contrib/bmake/unit-tests/dep.mk
index b2463dfc6458..53fadc789b13 100644
--- a/contrib/bmake/unit-tests/dep.mk
+++ b/contrib/bmake/unit-tests/dep.mk
@@ -1,8 +1,30 @@
-# $NetBSD: dep.mk,v 1.2 2020/08/16 14:25:16 rillig Exp $
+# $NetBSD: dep.mk,v 1.4 2023/06/01 07:27:30 rillig Exp $
#
# Tests for dependency declarations, such as "target: sources".
-# TODO: Implementation
+.MAIN: all
+
+# As soon as a target is defined using one of the dependency operators, it is
+# restricted to this dependency operator and cannot use the others anymore.
+only-colon:
+# expect+1: Inconsistent operator for only-colon
+only-colon!
+# expect+1: Inconsistent operator for only-colon
+only-colon::
+# Ensure that the target still has the original operator. If it hadn't, there
+# would be another error message.
+only-colon:
+
+
+# Before parse.c 1.158 from 2009-10-07, the parser broke dependency lines at
+# the first ';', without parsing expressions as such. It interpreted the
+# first ';' as the separator between the dependency and its commands, and the
+# '^' as a shell command.
+all: for-subst
+.for file in ${.PARSEFILE}
+for-subst: ${file:S;^;./;g}
+ @echo ".for with :S;... OK"
+.endfor
+
all:
- @:;