1 1.4 rillig # $NetBSD: cond-func-exists.mk,v 1.4 2020/08/28 12:59:36 rillig Exp $ 2 1.1 rillig # 3 1.2 rillig # Tests for the exists() function in .if conditions. 4 1.1 rillig 5 1.4 rillig .if !exists(.) 6 1.3 rillig .error 7 1.3 rillig .endif 8 1.3 rillig 9 1.3 rillig # The argument to the function must not be enclosed in quotes. 10 1.3 rillig # Neither double quotes nor single quotes are allowed. 11 1.3 rillig .if exists(".") 12 1.3 rillig .error 13 1.3 rillig .endif 14 1.3 rillig 15 1.3 rillig .if exists('.') 16 1.3 rillig .error 17 1.3 rillig .endif 18 1.3 rillig 19 1.3 rillig # The only way to escape characters that would otherwise influence the parser 20 1.3 rillig # is to enclose them in a variable expression. For function arguments, 21 1.3 rillig # neither the backslash nor the dollar sign act as escape character. 22 1.3 rillig .if exists(\.) 23 1.3 rillig .error 24 1.3 rillig .endif 25 1.3 rillig 26 1.4 rillig .if !exists(${:U.}) 27 1.3 rillig .error 28 1.3 rillig .endif 29 1.3 rillig 30 1.3 rillig # The argument to the function can have several variable expressions. 31 1.3 rillig # See cond-func.mk for the characters that cannot be used directly. 32 1.4 rillig .if !exists(${.PARSEDIR}/${.PARSEFILE}) 33 1.4 rillig .error 34 1.4 rillig .endif 35 1.4 rillig 36 1.4 rillig # Whitespace is trimmed on both sides of the function argument. 37 1.4 rillig .if !exists( . ) 38 1.3 rillig .error 39 1.3 rillig .endif 40 1.1 rillig 41 1.1 rillig all: 42 1.1 rillig @:; 43