2022-07-26 15:52:53 +00:00
|
|
|
# $NetBSD: opt-x-reduce-exported.mk,v 1.3 2022/05/08 07:27:50 rillig Exp $
|
2020-09-05 16:11:04 +00:00
|
|
|
#
|
2022-07-26 15:52:53 +00:00
|
|
|
# Tests for the -X command line option, which prevents variables passed on the
|
|
|
|
# command line from being exported to the environment of child commands.
|
2020-09-05 16:11:04 +00:00
|
|
|
|
2022-07-26 15:52:53 +00:00
|
|
|
# The variable 'BEFORE' is exported, the variable 'AFTER' isn't.
|
|
|
|
.MAKEFLAGS: BEFORE=before -X AFTER=after
|
2020-09-05 16:11:04 +00:00
|
|
|
|
2022-07-26 15:52:53 +00:00
|
|
|
all: .PHONY ordinary submake
|
|
|
|
|
|
|
|
ordinary: .PHONY
|
|
|
|
@echo 'ordinary:'
|
|
|
|
@env | sort | grep -e '^BEFORE' -e '^AFTER'
|
|
|
|
|
|
|
|
submake: .PHONY
|
|
|
|
@echo 'submake:'
|
|
|
|
@${MAKE} -r -f ${MAKEFILE} show-env
|
|
|
|
|
|
|
|
show-env: .PHONY
|
|
|
|
@env | sort | grep -e '^BEFORE' -e '^AFTER'
|