| 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 | print MAKEFILE "FIRST: ; \@echo It chose GNUmakefile\n";
|
|---|
| 11 | close(MAKEFILE);
|
|---|
| 12 |
|
|---|
| 13 | # DOS/WIN32 platforms preserve case, but Makefile is the same file as makefile.
|
|---|
| 14 | # Just test what we can here (avoid Makefile versus makefile test).
|
|---|
| 15 | # bird: made this generic, darwin is also defaulting to case insensitive fs.
|
|---|
| 16 |
|
|---|
| 17 | if ($port_type eq 'UNIX' && !$case_insensitive_fs) {
|
|---|
| 18 | # Create another makefile called "makefile"
|
|---|
| 19 | open(MAKEFILE,"> makefile");
|
|---|
| 20 | print MAKEFILE "SECOND: ; \@echo It chose makefile\n";
|
|---|
| 21 | close(MAKEFILE);
|
|---|
| 22 | }
|
|---|
| 23 |
|
|---|
| 24 | # Create another makefile called "Makefile"
|
|---|
| 25 | open(MAKEFILE,"> Makefile");
|
|---|
| 26 | print MAKEFILE "THIRD: ; \@echo It chose Makefile\n";
|
|---|
| 27 | close(MAKEFILE);
|
|---|
| 28 |
|
|---|
| 29 |
|
|---|
| 30 | &run_make_with_options("","",&get_logfile);
|
|---|
| 31 | &compare_output("It chose GNUmakefile\n",&get_logfile(1));
|
|---|
| 32 | unlink $makefile;
|
|---|
| 33 |
|
|---|
| 34 | if ($port_type eq 'UNIX' && !$case_insensitive_fs) {
|
|---|
| 35 | &run_make_with_options("","",&get_logfile);
|
|---|
| 36 | &compare_output("It chose makefile\n",&get_logfile(1));
|
|---|
| 37 | unlink "makefile";
|
|---|
| 38 | }
|
|---|
| 39 |
|
|---|
| 40 | &run_make_with_options("","",&get_logfile);
|
|---|
| 41 | &compare_output("It chose Makefile\n",&get_logfile(1));
|
|---|
| 42 | unlink "Makefile";
|
|---|