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