1 1.12 sjg # $NetBSD: export.mk,v 1.12 2022/09/09 18:36:15 sjg Exp $ 2 1.1 apb 3 1.10 rillig UT_TEST= export 4 1.10 rillig UT_FOO= foo${BAR} 5 1.10 rillig UT_FU= fubar 6 1.10 rillig UT_ZOO= hoopie 7 1.10 rillig UT_NO= all 8 1.5 rillig # believe it or not, we expect this one to come out with $UT_FU unexpanded. 9 1.10 rillig UT_DOLLAR= This is $$UT_FU 10 1.1 apb 11 1.1 apb .export UT_FU UT_FOO 12 1.1 apb .export UT_DOLLAR 13 1.3 rillig 14 1.3 rillig .if !defined(.MAKE.PID) 15 1.9 rillig . error .MAKE.PID must be defined 16 1.3 rillig .endif 17 1.3 rillig @= at 18 1.3 rillig %= percent 19 1.3 rillig *= asterisk 20 1.3 rillig ${:U!}= exclamation # A direct != would try to run "exclamation" 21 1.3 rillig # as a shell command and assign its output 22 1.3 rillig # to the empty variable. 23 1.3 rillig &= ampersand 24 1.3 rillig 25 1.3 rillig # This is ignored because it is internal. 26 1.1 apb .export .MAKE.PID 27 1.3 rillig # These are ignored because they are local to the target. 28 1.3 rillig .export @ 29 1.3 rillig .export % 30 1.3 rillig .export * 31 1.3 rillig .export ! 32 1.7 rillig # This is exported (see the .rawout file) but not displayed since the dash 33 1.7 rillig # shell filters it out. To reach consistent output for each shell, the 34 1.7 rillig # ampersand is filtered out already by FILTER_CMD. 35 1.3 rillig .export & 36 1.3 rillig # This is ignored because it is undefined. 37 1.3 rillig .export UNDEFINED 38 1.1 apb 39 1.10 rillig BAR= bar is ${UT_FU} 40 1.1 apb 41 1.10 rillig .MAKE.EXPORTED+= UT_ZOO UT_TEST 42 1.1 apb 43 1.12 sjg FILTER_CMD?= ${EGREP} -v '^(MAKEFLAGS|MALLOC_.*|PATH|PWD|SHLVL|_|&)=' 44 1.2 rillig 45 1.1 apb all: 46 1.2 rillig @env | ${FILTER_CMD} | sort 47