|
Last change
on this file since 486 was 284, checked in by bird, 19 years ago |
|
Current make snaphot, 2005-05-16.
|
-
Property svn:eol-style
set to
native
|
|
File size:
1.1 KB
|
| Line | |
|---|
| 1 | # -*-perl-*-
|
|---|
| 2 |
|
|---|
| 3 | $description = "\
|
|---|
| 4 | This tests random features of make's algorithms, often somewhat obscure,
|
|---|
| 5 | which have either broken at some point in the past or seem likely to
|
|---|
| 6 | break.";
|
|---|
| 7 |
|
|---|
| 8 | open(MAKEFILE,"> $makefile");
|
|---|
| 9 | print MAKEFILE <<'EOF';
|
|---|
| 10 | # Make sure that subdirectories built as prerequisites are actually handled
|
|---|
| 11 | # properly.
|
|---|
| 12 |
|
|---|
| 13 | all: dir/subdir/file.a
|
|---|
| 14 |
|
|---|
| 15 | dir/subdir: ; @echo mkdir -p dir/subdir
|
|---|
| 16 |
|
|---|
| 17 | dir/subdir/file.b: dir/subdir ; @echo touch dir/subdir/file.b
|
|---|
| 18 |
|
|---|
| 19 | dir/subdir/%.a: dir/subdir/%.b ; @echo cp $< $@
|
|---|
| 20 | EOF
|
|---|
| 21 | close(MAKEFILE);
|
|---|
| 22 |
|
|---|
| 23 | &run_make_with_options($makefile,"",&get_logfile);
|
|---|
| 24 | $answer = "mkdir -p dir/subdir\ntouch dir/subdir/file.b\ncp dir/subdir/file.b dir/subdir/file.a\n";
|
|---|
| 25 | &compare_output($answer,&get_logfile(1));
|
|---|
| 26 |
|
|---|
| 27 | # Test implicit rules
|
|---|
| 28 |
|
|---|
| 29 | &touch('foo.c');
|
|---|
| 30 | run_make_test('foo: foo.o',
|
|---|
| 31 | 'CC="@echo cc" OUTPUT_OPTION=',
|
|---|
| 32 | 'cc -c foo.c
|
|---|
| 33 | cc foo.o -o foo');
|
|---|
| 34 | unlink('foo.c');
|
|---|
| 35 |
|
|---|
| 36 |
|
|---|
| 37 | # Test other implicit rule searching
|
|---|
| 38 |
|
|---|
| 39 | &touch('bar');
|
|---|
| 40 | run_make_test('
|
|---|
| 41 | test.foo:
|
|---|
| 42 | %.foo : baz ; @echo done $<
|
|---|
| 43 | %.foo : bar ; @echo done $<
|
|---|
| 44 | fox: baz
|
|---|
| 45 | ',
|
|---|
| 46 | '',
|
|---|
| 47 | 'done bar');
|
|---|
| 48 | unlink('bar');
|
|---|
| 49 |
|
|---|
| 50 | 1;
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.