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