Home | History | Annotate | Line # | Download | only in unit-tests
cond-func-target.mk revision 1.5
      1  1.5  rillig # $NetBSD: cond-func-target.mk,v 1.5 2025/01/10 23:00:38 rillig Exp $
      2  1.1  rillig #
      3  1.2  rillig # Tests for the target() function in .if conditions.
      4  1.1  rillig 
      5  1.3  rillig .MAIN: all
      6  1.3  rillig 
      7  1.3  rillig # The target "target" does not exist yet.
      8  1.3  rillig .if target(target)
      9  1.4  rillig .  error
     10  1.3  rillig .endif
     11  1.3  rillig 
     12  1.3  rillig target:
     13  1.3  rillig 
     14  1.3  rillig # The target exists, even though it does not have any commands.
     15  1.3  rillig .if !target(target)
     16  1.4  rillig .  error
     17  1.3  rillig .endif
     18  1.3  rillig 
     19  1.3  rillig target:
     20  1.3  rillig 	# not a command
     21  1.3  rillig 
     22  1.3  rillig # Adding a comment to an existing target does not change whether the target
     23  1.3  rillig # is defined or not.
     24  1.3  rillig .if !target(target)
     25  1.4  rillig .  error
     26  1.3  rillig .endif
     27  1.3  rillig 
     28  1.3  rillig target:
     29  1.3  rillig 	@:;
     30  1.3  rillig 
     31  1.3  rillig # Adding a command to an existing target does not change whether the target
     32  1.3  rillig # is defined or not.
     33  1.3  rillig .if !target(target)
     34  1.4  rillig .  error
     35  1.3  rillig .endif
     36  1.1  rillig 
     37  1.5  rillig # Expressions in the argument of a function call don't have to be defined.
     38  1.5  rillig .if target(${UNDEF})
     39  1.5  rillig .  error
     40  1.5  rillig .endif
     41  1.5  rillig 
     42  1.1  rillig all:
     43  1.1  rillig 	@:;
     44