]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/bmake/unit-tests/cond-func-commands.mk
Update to bmake-20200902
[FreeBSD/FreeBSD.git] / contrib / bmake / unit-tests / cond-func-commands.mk
1 # $NetBSD: cond-func-commands.mk,v 1.3 2020/08/23 14:07:20 rillig Exp $
2 #
3 # Tests for the commands() function in .if conditions.
4
5 .MAIN: all
6
7 # The target "target" does not exist yet, therefore it cannot have commands.
8 .if commands(target)
9 .error
10 .endif
11
12 target:
13
14 # Now the target exists, but it still has no commands.
15 .if commands(target)
16 .error
17 .endif
18
19 target:
20         # not a command
21
22 # Even after the comment, the target still has no commands.
23 .if commands(target)
24 .error
25 .endif
26
27 target:
28         @:;
29
30 # Finally the target has commands.
31 .if !commands(target)
32 .error
33 .endif
34
35 all:
36         @:;