aboutsummaryrefslogtreecommitdiff
path: root/contrib/bmake/unit-tests/varname-makeflags.mk
blob: 3b4fd91c3f579e1f862fffe43ddc9a18cde8e91a (plain) (blame)
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
# $NetBSD: varname-makeflags.mk,v 1.3 2020/12/01 20:37:30 rillig Exp $
#
# Tests for the special MAKEFLAGS variable, which is basically just a normal
# environment variable.  It is closely related to .MAKEFLAGS but captures the
# state of .MAKEFLAGS at the very beginning of make, before any makefiles are
# read.

# TODO: Implementation

.MAKEFLAGS: -d0

# The unit tests are run with an almost empty environment.  In particular,
# the variable MAKEFLAGS is not set.  The '.MAKEFLAGS:' above also doesn't
# influence the environment variable MAKEFLAGS, therefore it is still
# undefined at this point.
.if ${MAKEFLAGS:Uundefined} != "undefined"
.  error
.endif

# The special variable .MAKEFLAGS is influenced though.
# See varname-dot-makeflags.mk for more details.
.if ${.MAKEFLAGS} != " -r -k -d 0"
.  error
.endif

all: