xref: /freebsd/contrib/bmake/unit-tests/cond-func-target.mk (revision 7ef62cebc2f965b0f640263e179276928885e33d)
1# $NetBSD: cond-func-target.mk,v 1.4 2020/10/24 08:46:08 rillig Exp $
2#
3# Tests for the target() function in .if conditions.
4
5.MAIN: all
6
7# The target "target" does not exist yet.
8.if target(target)
9.  error
10.endif
11
12target:
13
14# The target exists, even though it does not have any commands.
15.if !target(target)
16.  error
17.endif
18
19target:
20	# not a command
21
22# Adding a comment to an existing target does not change whether the target
23# is defined or not.
24.if !target(target)
25.  error
26.endif
27
28target:
29	@:;
30
31# Adding a command to an existing target does not change whether the target
32# is defined or not.
33.if !target(target)
34.  error
35.endif
36
37all:
38	@:;
39