aboutsummaryrefslogtreecommitdiff
path: root/unit-tests/cond-late.mk
diff options
context:
space:
mode:
Diffstat (limited to 'unit-tests/cond-late.mk')
-rw-r--r--unit-tests/cond-late.mk12
1 files changed, 7 insertions, 5 deletions
diff --git a/unit-tests/cond-late.mk b/unit-tests/cond-late.mk
index 397f5febd4802..4df3df2cf1d42 100644
--- a/unit-tests/cond-late.mk
+++ b/unit-tests/cond-late.mk
@@ -1,7 +1,9 @@
-# $NetBSD: cond-late.mk,v 1.2 2020/07/25 20:37:46 rillig Exp $
+# $NetBSD: cond-late.mk,v 1.3 2020/11/15 14:07:53 rillig Exp $
#
# Using the :? modifier, variable expressions can contain conditional
-# expressions that are evaluated late. Any variables appearing in these
+# expressions that are evaluated late, at expansion time.
+#
+# Any variables appearing in these
# conditions are expanded before parsing the condition. This is
# different from many other places.
#
@@ -11,15 +13,15 @@
# They should also not contain operators like == or <, since these are
# actually interpreted as these operators. This is demonstrated below.
#
-# If the order of evaluation were to change to first parse the condition
-# and then expand the variables, the output would change from the
-# current "yes no" to "yes yes", since both variables are non-empty.
all: cond-literal
COND.true= "yes" == "yes"
COND.false= "yes" != "yes"
+# If the order of evaluation were to change to first parse the condition
+# and then expand the variables, the output would change from the
+# current "yes no" to "yes yes", since both variables are non-empty.
cond-literal:
@echo ${ ${COND.true} :?yes:no}
@echo ${ ${COND.false} :?yes:no}