Home | History | Annotate | Line # | Download | only in unit-tests
cond-func-make.mk revision 1.5
      1 # $NetBSD: cond-func-make.mk,v 1.5 2023/06/23 04:56:54 rillig Exp $
      2 #
      3 # Tests for the make() function in .if conditions, which tests whether
      4 # the argument has been passed as a target via the command line or later
      5 # via the .MAKEFLAGS special dependency target.
      6 
      7 .if !make(via-cmdline)
      8 .  error
      9 .endif
     10 .if make(via-dot-makeflags)
     11 .  error
     12 .endif
     13 
     14 .MAKEFLAGS: via-dot-makeflags
     15 
     16 .if !make(via-cmdline)
     17 .  error
     18 .endif
     19 .if !make(via-dot-makeflags)
     20 .  error
     21 .endif
     22 
     23 # expect+1: warning: Unfinished character list in pattern argument '[' to function 'make'
     24 .if make([)
     25 .  error
     26 .endif
     27 
     28 via-cmdline via-dot-makeflags:
     29 	: $@
     30