aboutsummaryrefslogtreecommitdiff
path: root/unit-tests/cond-func-commands.mk
blob: 4a098169048c62e816b8030793777d07f72e51a7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# $NetBSD: cond-func-commands.mk,v 1.3 2020/08/23 14:07:20 rillig Exp $
#
# Tests for the commands() function in .if conditions.

.MAIN: all

# The target "target" does not exist yet, therefore it cannot have commands.
.if commands(target)
.error
.endif

target:

# Now the target exists, but it still has no commands.
.if commands(target)
.error
.endif

target:
	# not a command

# Even after the comment, the target still has no commands.
.if commands(target)
.error
.endif

target:
	@:;

# Finally the target has commands.
.if !commands(target)
.error
.endif

all:
	@:;