cond-func-defined.mk revision 1.3
11.3Srillig# $NetBSD: cond-func-defined.mk,v 1.3 2020/08/20 17:23:43 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.3Srillig.error
101.3Srillig.endif
111.3Srillig
121.3Srillig# Horizontal whitespace after the opening parenthesis is ignored.
131.3Srillig.if !defined( 	DEF)
141.3Srillig.error
151.3Srillig.endif
161.3Srillig
171.3Srillig# Horizontal whitespace before the closing parenthesis is ignored.
181.3Srillig.if !defined(DEF 	)
191.3Srillig.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.3Srillig.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.3Srillig.error
301.3Srillig.endif
311.1Srillig
321.1Srilligall:
331.1Srillig	@:;
34