make/tests/scripts/variables/MFILE_LIST
Paul Smith 5345adf82f [SV 50823] Support filenames containing '$' in MAKEFILE_LIST
* variable.h (enum variable_flavor: Add a new flavor for appended
values that shouldn't be expanded.
* variable.c (do_variable_definition): If given this new flavor,
do not expand the value before appending it.
* read.c (eval_makefile): Use this new flavor for MAKEFILE_LIST
* tests/scripts/variables/MFILE_LIST: Test filenames containing '$'.
2017-06-04 18:37:21 -04:00

40 lines
817 B
Perl

# -*-perl-*-
$description = "Test the MAKEFILE_LIST variable.";
create_file('incl2', "m2 := \$(MAKEFILE_LIST)\n");
run_make_test(qq!
m1 := \$(MAKEFILE_LIST)
include incl2
m3 := \$(MAKEFILE_LIST)
all:
\t\@echo \$(m1)
\t\@echo \$(m2)
\t\@echo \$(m3)
!,
'', "#MAKEFILE#\n#MAKEFILE# incl2\n#MAKEFILE# incl2\n");
unlink('incl2');
# SV 50823 -- makefiles containing '$' chars
create_file('foo$bar', "m2 := \$(MAKEFILE_LIST)\n");
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;