2002-09-04 07:26:19 +00:00
|
|
|
# -*-perl-*-
|
|
|
|
|
|
|
|
$description = "\
|
|
|
|
This tests random features of make's algorithms, often somewhat obscure,
|
|
|
|
which have either broken at some point in the past or seem likely to
|
|
|
|
break.";
|
|
|
|
|
|
|
|
open(MAKEFILE,"> $makefile");
|
|
|
|
print MAKEFILE <<'EOF';
|
|
|
|
# Make sure that subdirectories built as prerequisites are actually handled
|
|
|
|
# properly.
|
|
|
|
|
|
|
|
all: dir/subdir/file.a
|
|
|
|
|
|
|
|
dir/subdir: ; @echo mkdir -p dir/subdir
|
|
|
|
|
|
|
|
dir/subdir/file.b: dir/subdir ; @echo touch dir/subdir/file.b
|
|
|
|
|
|
|
|
dir/subdir/%.a: dir/subdir/%.b ; @echo cp $< $@
|
|
|
|
EOF
|
|
|
|
close(MAKEFILE);
|
|
|
|
|
|
|
|
&run_make_with_options($makefile,"",&get_logfile);
|
|
|
|
$answer = "mkdir -p dir/subdir\ntouch dir/subdir/file.b\ncp dir/subdir/file.b dir/subdir/file.a\n";
|
|
|
|
&compare_output($answer,&get_logfile(1));
|
|
|
|
|
2005-02-27 21:40:23 +00:00
|
|
|
# Test implicit rules
|
|
|
|
|
|
|
|
&touch('foo.c');
|
2005-02-28 07:48:22 +00:00
|
|
|
run_make_test('foo: foo.o',
|
2005-02-27 21:40:23 +00:00
|
|
|
'CC="@echo cc" OUTPUT_OPTION=',
|
|
|
|
'cc -c foo.c
|
|
|
|
cc foo.o -o foo');
|
|
|
|
unlink('foo.c');
|
|
|
|
|
|
|
|
|
|
|
|
# Test other implicit rule searching
|
|
|
|
|
|
|
|
&touch('bar');
|
|
|
|
run_make_test('
|
|
|
|
test.foo:
|
|
|
|
%.foo : baz ; @echo done $<
|
|
|
|
%.foo : bar ; @echo done $<
|
|
|
|
fox: baz
|
|
|
|
',
|
|
|
|
'',
|
|
|
|
'done bar');
|
|
|
|
unlink('bar');
|
|
|
|
|
2002-09-04 07:26:19 +00:00
|
|
|
1;
|