/* Add this makefile to the list. */
do_variable_definition (&ebuf.floc, "MAKEFILE_LIST", filename, o_file,
- f_append, 0);
+ f_append_value, 0);
/* Evaluate the makefile */
$description = "Test the MAKEFILE_LIST variable.";
-$makefile2 = &get_tmpfile;
+create_file('incl2', "m2 := \$(MAKEFILE_LIST)\n");
-open(MAKEFILE,"> $makefile");
-print MAKEFILE <<EOF;
+run_make_test(qq!
m1 := \$(MAKEFILE_LIST)
-include $makefile2
+include incl2
m3 := \$(MAKEFILE_LIST)
all:
\t\@echo \$(m1)
\t\@echo \$(m2)
\t\@echo \$(m3)
-EOF
-close(MAKEFILE);
+!,
+ '', "#MAKEFILE#\n#MAKEFILE# incl2\n#MAKEFILE# incl2\n");
+unlink('incl2');
-open(MAKEFILE,"> $makefile2");
-print MAKEFILE "m2 := \$(MAKEFILE_LIST)\n";
-close(MAKEFILE);
+# SV 50823 -- makefiles containing '$' chars
+create_file('foo$bar', "m2 := \$(MAKEFILE_LIST)\n");
-&run_make_with_options($makefile, "", &get_logfile);
-$answer = "$makefile\n$makefile $makefile2\n$makefile $makefile2\n";
-&compare_output($answer,&get_logfile(1));
+run_make_test(qq!
+m1 := \$(MAKEFILE_LIST)
+include foo\$\$bar
+m3 := \$(MAKEFILE_LIST)
+
+all:
+\t\@echo '\$(m1)'
+\t\@echo '\$(m2)'
+\t\@echo '\$(m3)'
+\t\@echo '\$(value MAKEFILE_LIST)'
+!,
+ '', "#MAKEFILE#\n#MAKEFILE# foo\$bar\n#MAKEFILE# foo\$bar\n#MAKEFILE# foo\$bar\n");
+
+unlink('foo$bar');
1;
p = value;
break;
case f_append:
+ case f_append_value:
{
/* If we have += but we're in a target variable context, we want to
append only with other variables in the context of this target. */
val = value;
if (v->recursive)
/* The previous definition of the variable was recursive.
- The new value is the unexpanded old and new values. */
+ The new value is the unexpanded old and new values. */
flavor = f_recursive;
- else
+ else if (flavor != f_append_value)
/* The previous definition of the variable was simple.
The new value comes from the old value, which was expanded
when it was set; and from the expanded new value. Allocate
f_recursive, /* Recursive definition (=) */
f_append, /* Appending definition (+=) */
f_conditional, /* Conditional definition (?=) */
- f_shell /* Shell assignment (!=) */
+ f_shell, /* Shell assignment (!=) */
+ f_append_value /* Append unexpanded value */
};
/* Structure that represents one variable definition.