1 # $NetBSD: export.mk,v 1.12 2022/09/09 18:36:15 sjg Exp $ 2 3 UT_TEST= export 4 UT_FOO= foo${BAR} 5 UT_FU= fubar 6 UT_ZOO= hoopie 7 UT_NO= all 8 # believe it or not, we expect this one to come out with $UT_FU unexpanded. 9 UT_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 # This is exported (see the .rawout file) but not displayed since the dash 33 # shell filters it out. To reach consistent output for each shell, the 34 # ampersand is filtered out already by FILTER_CMD. 35 .export & 36 # This is ignored because it is undefined. 37 .export UNDEFINED 38 39 BAR= bar is ${UT_FU} 40 41 .MAKE.EXPORTED+= UT_ZOO UT_TEST 42 43 FILTER_CMD?= ${EGREP} -v '^(MAKEFLAGS|MALLOC_.*|PATH|PWD|SHLVL|_|&)=' 44 45 all: 46 @env | ${FILTER_CMD} | sort 47