summaryrefslogtreecommitdiff
path: root/tests/scripts/features/patspecific_vars
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@kolpackov.net>2004-10-05 16:56:14 +0000
committerBoris Kolpackov <boris@kolpackov.net>2004-10-05 16:56:14 +0000
commitb0d67e0e15490e43bbc074ec50618488c206399b (patch)
tree68ffc649b47bf74c8a738bca4872136839b1d0a5 /tests/scripts/features/patspecific_vars
parentfb6410f43583a9e0b457d675e1bc2d1ed5ba279b (diff)
downloadgunmake-b0d67e0e15490e43bbc074ec50618488c206399b.tar.gz
Moved expansion of simple pattern-specific variables from the rebuild stage
to the read stage.
Diffstat (limited to 'tests/scripts/features/patspecific_vars')
-rw-r--r--tests/scripts/features/patspecific_vars51
1 files changed, 51 insertions, 0 deletions
diff --git a/tests/scripts/features/patspecific_vars b/tests/scripts/features/patspecific_vars
index 74de9bb..31359cf 100644
--- a/tests/scripts/features/patspecific_vars
+++ b/tests/scripts/features/patspecific_vars
@@ -70,4 +70,55 @@ run_make_test('
@test "$(foo)" == "$$foo"
', '', '');
+
+# TEST #6 -- test expansion of pattern-specific simple variables
+#
+run_make_test('
+.PHONY: all
+
+all: inherit := good $$t
+all: bar baz
+
+b%: pattern := good $$t
+
+global := orginal $$t
+
+
+# normal target
+#
+ifdef rec
+bar: a = global: $(global) pattern: $(pattern) inherit: $(inherit)
+else
+bar: a := global: $(global) pattern: $(pattern) inherit: $(inherit)
+endif
+
+bar: ; @echo \'normal: $a;\'
+
+
+# pattern target
+#
+ifdef rec
+%z: a = global: $(global) pattern: $(pattern) inherit: $(inherit)
+else
+%z: a := global: $(global) pattern: $(pattern) inherit: $(inherit)
+endif
+
+%z: ; @echo \'pattrn: $a;\'
+
+
+global := new $$t
+',
+'',
+'normal: global: orginal $t pattern: inherit: ;
+pattrn: global: orginal $t pattern: inherit: ;');
+
+
+# TEST #7 -- test expansion of pattern-specific recursive variables
+#
+run_make_test(undef, # reuse previous makefile
+'rec=1',
+'normal: global: new $t pattern: good $t inherit: good $t;
+pattrn: global: new $t pattern: good $t inherit: good $t;');
+
+
1;