xref: /freebsd/contrib/bmake/unit-tests/dep.mk (revision 8aac90f18aef7c9eea906c3ff9a001ca7b94f375)
1# $NetBSD: dep.mk,v 1.4 2023/06/01 07:27:30 rillig Exp $
2#
3# Tests for dependency declarations, such as "target: sources".
4
5.MAIN: all
6
7# As soon as a target is defined using one of the dependency operators, it is
8# restricted to this dependency operator and cannot use the others anymore.
9only-colon:
10# expect+1: Inconsistent operator for only-colon
11only-colon!
12# expect+1: Inconsistent operator for only-colon
13only-colon::
14# Ensure that the target still has the original operator.  If it hadn't, there
15# would be another error message.
16only-colon:
17
18
19# Before parse.c 1.158 from 2009-10-07, the parser broke dependency lines at
20# the first ';', without parsing expressions as such.  It interpreted the
21# first ';' as the separator between the dependency and its commands, and the
22# '^' as a shell command.
23all: for-subst
24.for file in ${.PARSEFILE}
25for-subst:	  ${file:S;^;./;g}
26	@echo ".for with :S;... OK"
27.endfor
28
29
30all:
31