default_names revision 1.1 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
16 if ($port_type eq 'UNIX') {
17 # Create another makefile called "makefile"
18 open(MAKEFILE,"> makefile");
19 print MAKEFILE "SECOND: ; \@echo It chose makefile\n";
20 close(MAKEFILE);
21 }
22
23 # Create another makefile called "Makefile"
24 open(MAKEFILE,"> Makefile");
25 print MAKEFILE "THIRD: ; \@echo It chose Makefile\n";
26 close(MAKEFILE);
27
28
29 &run_make_with_options("","",&get_logfile);
30 &compare_output("It chose GNUmakefile\n",&get_logfile(1));
31 unlink $makefile;
32
33 if ($port_type eq 'UNIX') {
34 &run_make_with_options("","",&get_logfile);
35 &compare_output("It chose makefile\n",&get_logfile(1));
36 unlink "makefile";
37 }
38
39 &run_make_with_options("","",&get_logfile);
40 &compare_output("It chose Makefile\n",&get_logfile(1));
41 unlink "Makefile";
42