cond-func-defined.mk revision 1.6
1# $NetBSD: cond-func-defined.mk,v 1.6 2020/11/07 14:40:51 rillig Exp $
2#
3# Tests for the defined() function in .if conditions.
4
5DEF=		defined
6${:UA B}=	variable name with spaces
7
8.if !defined(DEF)
9.  error
10.endif
11
12# Horizontal whitespace (space tab) after the opening parenthesis is ignored.
13.if !defined( 	DEF)
14.  error
15.endif
16
17# Horizontal whitespace (space tab) before the closing parenthesis is ignored.
18.if !defined(DEF 	)
19.  error
20.endif
21
22# The argument of a function must not directly contain whitespace.
23.if !defined(A B)
24.  error
25.endif
26
27# If necessary, the whitespace can be generated by a variable expression.
28.if !defined(${:UA B})
29.  error
30.endif
31
32# Parse error: missing closing parenthesis; see ParseFuncArg.
33.if defined(DEF
34.  error
35.else
36.  error
37.endif
38
39all:
40	@:;
41