cond-func-defined.mk revision 1.5
11.5Srillig# $NetBSD: cond-func-defined.mk,v 1.5 2020/10/24 08:46:08 rillig Exp $
21.1Srillig#
31.2Srillig# Tests for the defined() function in .if conditions.
41.1Srillig
51.3SrilligDEF=		defined
61.3Srillig${:UA B}=	variable name with spaces
71.3Srillig
81.3Srillig.if !defined(DEF)
91.5Srillig.  error
101.3Srillig.endif
111.3Srillig
121.4Srillig# Horizontal whitespace (space tab) after the opening parenthesis is ignored.
131.3Srillig.if !defined( 	DEF)
141.5Srillig.  error
151.3Srillig.endif
161.3Srillig
171.4Srillig# Horizontal whitespace (space tab) before the closing parenthesis is ignored.
181.3Srillig.if !defined(DEF 	)
191.5Srillig.  error
201.3Srillig.endif
211.3Srillig
221.3Srillig# The argument of a function must not directly contain whitespace.
231.3Srillig.if !defined(A B)
241.5Srillig.  error
251.3Srillig.endif
261.3Srillig
271.3Srillig# If necessary, the whitespace can be generated by a variable expression.
281.3Srillig.if !defined(${:UA B})
291.5Srillig.  error
301.3Srillig.endif
311.1Srillig
321.1Srilligall:
331.1Srillig	@:;
34