summaryrefslogtreecommitdiff
path: root/usr.bin/make/unit-tests/opt-debug-var.mk
blob: 5b0c5648ab55e86e6bb1fda8cad7b7df2ff2a557 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# $NetBSD: opt-debug-var.mk,v 1.2 2022/01/23 16:09:38 rillig Exp $
#
# Tests for the -dv command line option, which adds debug logging about
# variable assignment and evaluation.

.MAKEFLAGS: -dv

# expect: Global: ASSIGNED = value
ASSIGNED=	value

# TODO: Explain why the empty assignment "Global: SUBST = " is needed.
# expect: Global: SUBST = value
SUBST:=		value

.if defined(ASSIGNED)
.endif

# The usual form of variable expressions is ${VAR}.  The form $(VAR) is used
# less often as it can be visually confused with the shell construct for
# capturing the output of a subshell, which looks the same.
#
# In conditions, a call to the function 'empty' is syntactically similar to
# the form $(VAR), only that the initial '$' is the 'y' of 'empty'.
#
# expect: Var_Parse: y(ASSIGNED) (eval)
.if !empty(ASSIGNED)
.endif

.MAKEFLAGS: -d0

all: .PHONY