# -*-perl-*- $description = "Test automatic variable setting."; $details = ""; use Cwd; $dir = cwd; $dir =~ s,.*/([^/]+)$,../$1,; open(MAKEFILE, "> $makefile"); print MAKEFILE "dir = $dir\n"; print MAKEFILE <<'EOF'; .SUFFIXES: .SUFFIXES: .x .y .z $(dir)/foo.x : baz.z $(dir)/bar.y baz.z @echo '$$@ = $@, $$(@D) = $(@D), $$(@F) = $(@F)' @echo '$$* = $*, $$(*D) = $(*D), $$(*F) = $(*F)' @echo '$$< = $<, $$( $makefile2"); print MAKEFILE "dir = $dir\n"; print MAKEFILE <<'EOF'; .SUFFIXES: .DEFAULT: ; @echo '$@' $(dir)/foo $(dir)/bar: $@.x $$@.x $$$@.x $$$$@.x $$(@D).x $$(@F).x $(dir)/x.z $(dir)/y.z: $(dir)/%.z : $@.% $$@.% $$$@.% $$$$@.% $$(@D).% $$(@F).% $(dir)/biz: $$(@).x $${@}.x $${@D}.x $${@F}.x EOF close(MAKEFILE); &run_make_with_options($makefile2, "$dir/foo $dir/bar", &get_logfile); $answer = ".x\n$dir/foo.x\nx\n\$@.x\n$dir.x\nfoo.x\n$dir/bar.x\nbar.x\n"; &compare_output($answer, &get_logfile(1)); &run_make_with_options($makefile2, "$dir/x.z $dir/y.z", &get_logfile); $answer = ".x\n$dir/x.z.x\nx\n\$@.x\n$dir.x\nx.z.x\n.y\n$dir/y.z.y\n\y\n\$@.y\n$dir.y\ny.z.y\n"; &compare_output($answer, &get_logfile(1)); &run_make_with_options($makefile2, "$dir/biz", &get_logfile); $answer = "$dir/biz.x\n$dir.x\nbiz.x\n"; &compare_output($answer, &get_logfile(1)); 1;