1 # $NetBSD: cond-func.mk,v 1.4 2020/10/24 08:46:08 rillig Exp $
3 # Tests for those parts of the functions in .if conditions that are common
4 # among several functions.
6 # The below test uses the function defined(...) since it has no side-effects,
7 # the other functions (except empty(...)) would work equally well.
10 ${:UA B}= variable name with spaces
11 ${:UVAR(value)}= variable name with parentheses
12 ${:UVAR{value}}= variable name with braces
18 # Horizontal whitespace (space tab) after the opening parenthesis is ignored.
23 # Horizontal whitespace (space tab) before the closing parenthesis is ignored.
28 # The argument of a function must not directly contain whitespace.
33 # If necessary, the whitespace can be generated by a variable expression.
34 .if !defined(${:UA B})
38 # Characters that could be mistaken for operators must not appear directly
39 # in a function argument. As with whitespace, these can be generated
42 # It's not entirely clear why these characters are forbidden.
43 # The most plausible reason seems to be typo detection.
51 # Even parentheses may appear in variable names.
52 # They must be balanced though.
53 .if !defined(VAR(value))
57 # Braces do not have any special meaning when parsing arguments.
58 .if !defined(VAR{value})
62 # There may be spaces around the operators and parentheses, and even
63 # inside the parentheses. The spaces inside the parentheses are not
64 # allowed for the empty() function (see cond-func-empty.mk), therefore
65 # they are typically omitted for the other functions as well.