summaryrefslogtreecommitdiffstats
path: root/build/pymake/tests/dynamic-var.mk
diff options
context:
space:
mode:
Diffstat (limited to 'build/pymake/tests/dynamic-var.mk')
-rw-r--r--build/pymake/tests/dynamic-var.mk18
1 files changed, 18 insertions, 0 deletions
diff --git a/build/pymake/tests/dynamic-var.mk b/build/pymake/tests/dynamic-var.mk
new file mode 100644
index 000000000..0993b9ccf
--- /dev/null
+++ b/build/pymake/tests/dynamic-var.mk
@@ -0,0 +1,18 @@
+# The *name* of variables can be constructed dynamically.
+
+VARNAME = FOOBAR
+
+$(VARNAME) = foovalue
+$(VARNAME)2 = foo2value
+
+$(VARNAME:%BAR=%BAM) = foobam
+
+all:
+ test "$(FOOBAR)" = "foovalue"
+ test "$(flavor FOOBAZ)" = "undefined"
+ test "$(FOOBAR2)" = "bazvalue"
+ test "$(FOOBAM)" = "foobam"
+ @echo TEST-PASS
+
+VARNAME = FOOBAZ
+FOOBAR2 = bazvalue