summaryrefslogtreecommitdiff
path: root/tests/scripts/variables/LIBPATTERNS
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2012-08-26 19:24:46 +0400
committerIgor Pashev <pashev.igor@gmail.com>2012-08-26 19:24:46 +0400
commite46c9ea201b4bad8f4c6d19ee6dfb3537bc9facd (patch)
tree26ae9736985be2ef61032e7808b9fb0e2155c71f /tests/scripts/variables/LIBPATTERNS
downloadmake.old-upstream.tar.gz
Imported GNU Make 3.81upstream/3.82upstream
Diffstat (limited to 'tests/scripts/variables/LIBPATTERNS')
-rw-r--r--tests/scripts/variables/LIBPATTERNS38
1 files changed, 38 insertions, 0 deletions
diff --git a/tests/scripts/variables/LIBPATTERNS b/tests/scripts/variables/LIBPATTERNS
new file mode 100644
index 0000000..826f2fa
--- /dev/null
+++ b/tests/scripts/variables/LIBPATTERNS
@@ -0,0 +1,38 @@
+# -*-perl-*-
+
+$description = "Test .LIBPATTERNS special variable.";
+
+$details = "";
+
+# TEST 0: basics
+
+touch('mtest_foo.a');
+
+run_make_test('
+.LIBPATTERNS = mtest_%.a
+all: -lfoo ; @echo "build $@ from $<"
+',
+ '', "build all from mtest_foo.a\n");
+
+# TEST 1: Handle elements that are not patterns.
+
+run_make_test('
+.LIBPATTERNS = mtest_foo.a mtest_%.a
+all: -lfoo ; @echo "build $@ from $<"
+',
+ '', "#MAKE#: .LIBPATTERNS element `mtest_foo.a' is not a pattern
+build all from mtest_foo.a\n");
+
+# TEST 2: target-specific override
+
+# Uncomment this when we add support, see Savannah bug #25703
+# run_make_test('
+# .LIBPATTERNS = mbad_%.a
+# all: .LIBPATTERNS += mtest_%.a
+# all: -lfoo ; @echo "build $@ from $<"
+# ',
+# '', "build all from mtest_foo.a\n");
+
+unlink('mtest_foo.a');
+
+1;