Home | History | Annotate | Line # | Download | only in unit-tests
opt-debug-var.mk revision 1.3
      1 # $NetBSD: opt-debug-var.mk,v 1.3 2023/11/19 21:47:52 rillig Exp $
      2 #
      3 # Tests for the -dv command line option, which adds debug logging about
      4 # variable assignment and evaluation.
      5 
      6 .MAKEFLAGS: -dv
      7 
      8 # expect: Global: ASSIGNED = value
      9 ASSIGNED=	value
     10 
     11 # TODO: Explain why the empty assignment "Global: SUBST = " is needed.
     12 # expect: Global: SUBST = value
     13 SUBST:=		value
     14 
     15 .if defined(ASSIGNED)
     16 .endif
     17 
     18 # The usual form of expressions is ${VAR}.  The form $(VAR) is used
     19 # less often as it can be visually confused with the shell construct for
     20 # capturing the output of a subshell, which looks the same.
     21 #
     22 # In conditions, a call to the function 'empty' is syntactically similar to
     23 # the form $(VAR), only that the initial '$' is the 'y' of 'empty'.
     24 #
     25 # expect: Var_Parse: y(ASSIGNED) (eval)
     26 .if !empty(ASSIGNED)
     27 .endif
     28 
     29 .MAKEFLAGS: -d0
     30 
     31 all: .PHONY
     32