2020-09-05 12:11:04 -04:00
|
|
|
# $Id: export.mk,v 1.1.1.4 2020/08/08 22:34:25 sjg Exp $
|
2012-06-08 17:57:36 -04:00
|
|
|
|
|
|
|
|
UT_TEST=export
|
|
|
|
|
UT_FOO=foo${BAR}
|
|
|
|
|
UT_FU=fubar
|
|
|
|
|
UT_ZOO=hoopie
|
|
|
|
|
UT_NO=all
|
2020-09-05 12:11:04 -04:00
|
|
|
# believe it or not, we expect this one to come out with $UT_FU unexpanded.
|
2012-06-08 17:57:36 -04:00
|
|
|
UT_DOLLAR= This is $$UT_FU
|
|
|
|
|
|
|
|
|
|
.export UT_FU UT_FOO
|
|
|
|
|
.export UT_DOLLAR
|
2020-09-05 12:11:04 -04:00
|
|
|
|
|
|
|
|
.if !defined(.MAKE.PID)
|
|
|
|
|
.error .MAKE.PID must be defined
|
|
|
|
|
.endif
|
|
|
|
|
@= at
|
|
|
|
|
%= percent
|
|
|
|
|
*= asterisk
|
|
|
|
|
${:U!}= exclamation # A direct != would try to run "exclamation"
|
|
|
|
|
# as a shell command and assign its output
|
|
|
|
|
# to the empty variable.
|
|
|
|
|
&= ampersand
|
|
|
|
|
|
|
|
|
|
# This is ignored because it is internal.
|
2012-06-08 17:57:36 -04:00
|
|
|
.export .MAKE.PID
|
2020-09-05 12:11:04 -04:00
|
|
|
# These are ignored because they are local to the target.
|
|
|
|
|
.export @
|
|
|
|
|
.export %
|
|
|
|
|
.export *
|
|
|
|
|
.export !
|
|
|
|
|
.export &
|
|
|
|
|
# This is ignored because it is undefined.
|
|
|
|
|
.export UNDEFINED
|
2012-06-08 17:57:36 -04:00
|
|
|
|
|
|
|
|
BAR=bar is ${UT_FU}
|
|
|
|
|
|
|
|
|
|
.MAKE.EXPORTED+= UT_ZOO UT_TEST
|
|
|
|
|
|
2020-09-05 12:11:04 -04:00
|
|
|
FILTER_CMD?= egrep -v '^(MAKEFLAGS|PATH|PWD|SHLVL|_)='
|
2012-06-08 17:57:36 -04:00
|
|
|
|
2020-09-05 12:11:04 -04:00
|
|
|
all:
|
|
|
|
|
@env | ${FILTER_CMD} | sort
|