Lines Matching +full:set +full:- +full:env
1 # $NetBSD: varname-dot-make-level.mk,v 1.6 2025/03/22 12:23:00 rillig Exp $
7 all: .PHONY level_1 set-env-same set-env-different
9 # expect: level 1: variable 0, env 1
11 @printf 'level 1: variable %s, env %s\n' ${.MAKE.LEVEL} "$$${.MAKE.LEVEL.ENV}"
12 @${MAKE} -f ${MAKEFILE} level_2
14 # expect: level 2: variable 1, env 2
16 @printf 'level 2: variable %s, env %s\n' ${.MAKE.LEVEL} "$$${.MAKE.LEVEL.ENV}"
17 @${MAKE} -f ${MAKEFILE} level_3
19 # The .unexport-env directive clears the environment, except for the
20 # .MAKE.LEVEL.ENV make variable, which by default refers to the MAKELEVEL
23 .unexport-env
26 # expect: level 3: variable 2, env 3
28 @printf 'level 3: variable %s, env %s\n' ${.MAKE.LEVEL} "$$${.MAKE.LEVEL.ENV}"
32 # read-only global variable with the same value as before, ignore the
37 # .MAKE.LEVEL.ENV variable in the scope for command line variables, and these
38 # variables were passed to sub-makes via .MAKEOVERRIDES and the MAKEFLAGS
40 # internal .MAKE.LEVEL.ENV variable in the global scope but make it read-only
44 set-env-same: .PHONY
46 @${MAKE} -f ${MAKEFILE} ok .MAKE.LEVEL.ENV=${.MAKE.LEVEL.ENV} || echo "${.TARGET}: exit $$?"
49 # expect: make: Cannot override read-only global variable ".MAKE.LEVEL.ENV" with a command line var…
50 set-env-different: .PHONY
52 @${MAKE} -f ${MAKEFILE} ok .MAKE.LEVEL.ENV=CUSTOM || echo "${.TARGET}: exit $$?"