xref: /freebsd/contrib/bmake/unit-tests/export.mk (revision 1f474190)
1# $Id: export.mk,v 1.1.1.4 2020/08/08 22:34:25 sjg Exp $
2
3UT_TEST=export
4UT_FOO=foo${BAR}
5UT_FU=fubar
6UT_ZOO=hoopie
7UT_NO=all
8# believe it or not, we expect this one to come out with $UT_FU unexpanded.
9UT_DOLLAR= This is $$UT_FU
10
11.export UT_FU UT_FOO
12.export UT_DOLLAR
13
14.if !defined(.MAKE.PID)
15.error .MAKE.PID must be defined
16.endif
17@=	at
18%=	percent
19*=	asterisk
20${:U!}=	exclamation		# A direct != would try to run "exclamation"
21				# as a shell command and assign its output
22				# to the empty variable.
23&=	ampersand
24
25# This is ignored because it is internal.
26.export .MAKE.PID
27# These are ignored because they are local to the target.
28.export @
29.export %
30.export *
31.export !
32.export &
33# This is ignored because it is undefined.
34.export UNDEFINED
35
36BAR=bar is ${UT_FU}
37
38.MAKE.EXPORTED+= UT_ZOO UT_TEST
39
40FILTER_CMD?=	egrep -v '^(MAKEFLAGS|PATH|PWD|SHLVL|_)='
41
42all:
43	@env | ${FILTER_CMD} | sort
44