summaryrefslogtreecommitdiff
path: root/unit-tests/make-exported.mk
diff options
context:
space:
mode:
Diffstat (limited to 'unit-tests/make-exported.mk')
-rwxr-xr-xunit-tests/make-exported.mk21
1 files changed, 15 insertions, 6 deletions
diff --git a/unit-tests/make-exported.mk b/unit-tests/make-exported.mk
index 36f4b356ae53..db7f09dc490f 100755
--- a/unit-tests/make-exported.mk
+++ b/unit-tests/make-exported.mk
@@ -1,16 +1,25 @@
-# $NetBSD: make-exported.mk,v 1.1 2020/08/09 12:59:16 rillig Exp $
+# $NetBSD: make-exported.mk,v 1.6 2020/10/05 19:27:48 rillig Exp $
#
# As of 2020-08-09, the code in Var_Export is shared between the .export
# directive and the .MAKE.EXPORTED variable. This leads to non-obvious
# behavior for certain variable assignments.
--env= make-exported-value
--literal= make-exported-value
+-env= make-exported-value-env
+-literal= make-exported-value-literal
UT_VAR= ${UNEXPANDED}
-# The following behavior is probably not intended.
-.MAKE.EXPORTED= -env # like .export-env
-.MAKE.EXPORTED= -literal UT_VAR # like .export-literal PATH
+# Before 2020-10-03, the following line took the code path of .export-env,
+# which was surprising behavior. Since 2020-10-03 this line tries to
+# export the variable named "-env", but that is rejected because the
+# variable name starts with a hyphen.
+.MAKE.EXPORTED= -env
+
+# Before 2020-10-03, if the value of .MAKE.EXPORTED started with "-literal",
+# make behaved like a mixture of .export-literal and a regular .export.
+#
+# Since 2020-10-03, the "variable" named "-literal" is not exported anymore,
+# it is just ignored since its name starts with '-'.
+.MAKE.EXPORTED= -literal UT_VAR
all:
@env | sort | grep -E '^UT_|make-exported-value' || true