1 # $NetBSD: opt-x-reduce-exported.mk,v 1.3 2022/05/08 07:27:50 rillig Exp $ 2 # 3 # Tests for the -X command line option, which prevents variables passed on the 4 # command line from being exported to the environment of child commands. 5 6 # The variable 'BEFORE' is exported, the variable 'AFTER' isn't. 7 .MAKEFLAGS: BEFORE=before -X AFTER=after 8 9 all: .PHONY ordinary submake 10 11 ordinary: .PHONY 12 @echo 'ordinary:' 13 @env | sort | grep -e '^BEFORE' -e '^AFTER' 14 15 submake: .PHONY 16 @echo 'submake:' 17 @${MAKE} -r -f ${MAKEFILE} show-env 18 19 show-env: .PHONY 20 @env | sort | grep -e '^BEFORE' -e '^AFTER' 21