| 1 | # -*-perl-*-
|
|---|
| 2 |
|
|---|
| 3 | $description = "This script tests to make sure that Make looks for
|
|---|
| 4 | default makefiles in the correct order (GNUmakefile,makefile,Makefile)";
|
|---|
| 5 |
|
|---|
| 6 | # Create a makefile called "GNUmakefile"
|
|---|
| 7 | $makefile = "GNUmakefile";
|
|---|
| 8 |
|
|---|
| 9 | open(MAKEFILE,"> $makefile");
|
|---|
| 10 |
|
|---|
| 11 | print MAKEFILE "FIRST: ; \@echo It chose GNUmakefile\n";
|
|---|
| 12 |
|
|---|
| 13 | close(MAKEFILE);
|
|---|
| 14 |
|
|---|
| 15 | # DOS/WIN32 platforms preserve case, but Makefile is the same file as makefile.
|
|---|
| 16 | # Just test what we can here (avoid Makefile versus makefile test).
|
|---|
| 17 | #
|
|---|
| 18 | if ($port_type eq 'UNIX')
|
|---|
| 19 | {
|
|---|
| 20 | # Create another makefile called "makefile"
|
|---|
| 21 | open(MAKEFILE,"> makefile");
|
|---|
| 22 |
|
|---|
| 23 | print MAKEFILE "SECOND: ; \@echo It chose makefile\n";
|
|---|
| 24 |
|
|---|
| 25 | close(MAKEFILE);
|
|---|
| 26 | }
|
|---|
| 27 |
|
|---|
| 28 |
|
|---|
| 29 | # Create another makefile called "Makefile"
|
|---|
| 30 | open(MAKEFILE,"> Makefile");
|
|---|
| 31 |
|
|---|
| 32 | print MAKEFILE "THIRD: ; \@echo It chose Makefile\n";
|
|---|
| 33 |
|
|---|
| 34 | close(MAKEFILE);
|
|---|
| 35 |
|
|---|
| 36 |
|
|---|
| 37 | &run_make_with_options("","",&get_logfile);
|
|---|
| 38 |
|
|---|
| 39 | # Create the answer to what should be produced by this Makefile
|
|---|
| 40 | $answer = "It chose GNUmakefile\n";
|
|---|
| 41 |
|
|---|
| 42 | # COMPARE RESULTS
|
|---|
| 43 |
|
|---|
| 44 | &compare_output($answer,&get_logfile(1)) || &error("abort");
|
|---|
| 45 | unlink $makefile;
|
|---|
| 46 |
|
|---|
| 47 | # DOS/WIN32 platforms preserve case, but Makefile is the same file as makefile.
|
|---|
| 48 | # Just test what we can here (avoid Makefile versus makefile test).
|
|---|
| 49 | #
|
|---|
| 50 | if ($port_type eq 'UNIX')
|
|---|
| 51 | {
|
|---|
| 52 | $answer = "It chose makefile\n";
|
|---|
| 53 |
|
|---|
| 54 | &run_make_with_options("","",&get_logfile);
|
|---|
| 55 |
|
|---|
| 56 | &compare_output($answer,&get_logfile(1)) || &error("abort");
|
|---|
| 57 | unlink "makefile";
|
|---|
| 58 | }
|
|---|
| 59 |
|
|---|
| 60 | $answer = "It chose Makefile\n";
|
|---|
| 61 |
|
|---|
| 62 | &run_make_with_options("","",&get_logfile);
|
|---|
| 63 |
|
|---|
| 64 | &compare_output($answer,&get_logfile(1)) || &error("abort");
|
|---|
| 65 | unlink "Makefile";
|
|---|