xref: /freebsd/contrib/bmake/unit-tests/varname-makeflags.mk (revision 3ff01b231dfa83d518854c63e7c9cd1debd1139e)
1# $NetBSD: varname-makeflags.mk,v 1.3 2020/12/01 20:37:30 rillig Exp $
2#
3# Tests for the special MAKEFLAGS variable, which is basically just a normal
4# environment variable.  It is closely related to .MAKEFLAGS but captures the
5# state of .MAKEFLAGS at the very beginning of make, before any makefiles are
6# read.
7
8# TODO: Implementation
9
10.MAKEFLAGS: -d0
11
12# The unit tests are run with an almost empty environment.  In particular,
13# the variable MAKEFLAGS is not set.  The '.MAKEFLAGS:' above also doesn't
14# influence the environment variable MAKEFLAGS, therefore it is still
15# undefined at this point.
16.if ${MAKEFLAGS:Uundefined} != "undefined"
17.  error
18.endif
19
20# The special variable .MAKEFLAGS is influenced though.
21# See varname-dot-makeflags.mk for more details.
22.if ${.MAKEFLAGS} != " -r -k -d 0"
23.  error
24.endif
25
26all:
27