mirror of
https://github.com/mirror/make.git
synced 2026-08-31 03:38:03 +08:00
Implement SysV-style $$@ support. I looked at E.Parmelan's patch but
decided to implement this a different way, and didn't use it.
This commit is contained in:
@@ -30,9 +30,8 @@ close(MAKEFILE);
|
||||
# TEST #1 -- simple test
|
||||
# -------
|
||||
|
||||
&touch(qw(foo.x baz.z));
|
||||
|
||||
sleep(1);
|
||||
# Touch these into the past
|
||||
&utouch(-10, qw(foo.x baz.z));
|
||||
|
||||
&run_make_with_options($makefile, "", &get_logfile);
|
||||
$answer = "touch $dir/bar.y
|
||||
@@ -47,4 +46,28 @@ touch $dir/foo.x\n";
|
||||
|
||||
unlink(qw(foo.x bar.y baz.z));
|
||||
|
||||
# TEST #2 -- test the SysV emulation of $$@ etc.
|
||||
# -------
|
||||
|
||||
$makefile2 = &get_tmpfile;
|
||||
|
||||
open(MAKEFILE, "> $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).%
|
||||
EOF
|
||||
|
||||
&run_make_with_options($makefile2, "$dir/foo $dir/bar", &get_logfile);
|
||||
$answer = ".x\n$dir/foo.x\n\$.x\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\n\$.x\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));
|
||||
|
||||
1;
|
||||
|
||||
Reference in New Issue
Block a user