summaryrefslogtreecommitdiff
path: root/tests/scripts/variables
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2002-07-08 02:26:47 +0000
committerPaul Smith <psmith@gnu.org>2002-07-08 02:26:47 +0000
commit8572d6adf04d397505770b0b0d5cfd91cf6a92a8 (patch)
tree8e590714da1d480bef4ca2afbe81fa95c2624de6 /tests/scripts/variables
parent4a073980236d80b47a24c5caea3ece4e9bb7e044 (diff)
downloadgunmake-8572d6adf04d397505770b0b0d5cfd91cf6a92a8.tar.gz
Major updates in preparation for 3.80.
New version of the manual, put into the doc subdir. Enhancements: $(eval ...) and $(value ...) functions, various bug fixes, etc. See the ChangeLog. More to come.
Diffstat (limited to 'tests/scripts/variables')
-rw-r--r--tests/scripts/variables/MAKEFILE_LIST30
-rw-r--r--tests/scripts/variables/flavors17
2 files changed, 47 insertions, 0 deletions
diff --git a/tests/scripts/variables/MAKEFILE_LIST b/tests/scripts/variables/MAKEFILE_LIST
new file mode 100644
index 0000000..076e42d
--- /dev/null
+++ b/tests/scripts/variables/MAKEFILE_LIST
@@ -0,0 +1,30 @@
+# -*-perl-*-
+
+$description = "Test the MAKEFILE_LIST variable.";
+
+$makefile2 = &get_tmpfile;
+
+open(MAKEFILE,"> $makefile");
+print MAKEFILE <<EOF;
+m1 := \$(MAKEFILE_LIST)
+include $makefile2
+m3 := \$(MAKEFILE_LIST)
+
+all:
+\t\@echo \$(m1)
+\t\@echo \$(m2)
+\t\@echo \$(m3)
+EOF
+close(MAKEFILE);
+
+
+open(MAKEFILE,"> $makefile2");
+print MAKEFILE "m2 := \$(MAKEFILE_LIST)\n";
+close(MAKEFILE);
+
+
+&run_make_with_options($makefile, "", &get_logfile);
+$answer = "$makefile\n$makefile $makefile2\n$makefile $makefile2\n";
+&compare_output($answer,&get_logfile(1));
+
+1;
diff --git a/tests/scripts/variables/flavors b/tests/scripts/variables/flavors
index 02dca0b..7c98afd 100644
--- a/tests/scripts/variables/flavors
+++ b/tests/scripts/variables/flavors
@@ -37,6 +37,16 @@ define
endef
endif
+define outer
+ define inner
+ A = B
+ endef
+endef
+
+$(eval $(outer))
+
+outer: ; @echo $(inner)
+
EOF
# END of Contents of MAKEFILE
@@ -64,5 +74,12 @@ $answer = "later foo bar\n";
$answer = "$makefile:23: *** empty variable name. Stop.\n";
&compare_output($answer, &get_logfile(1));
+# TEST #4
+# -------
+
+&run_make_with_options($makefile, "outer", &get_logfile);
+$answer = "A = B\n";
+&compare_output($answer, &get_logfile(1));
+
1;