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