1#                                                                    -*-perl-*-
2
3$description = "This script tests to make sure that Make looks for
4default makefiles in the correct order (GNUmakefile,makefile,Makefile)";
5
6# Create a makefile called "GNUmakefile"
7$makefile = "GNUmakefile";
8
9open(MAKEFILE,"> $makefile");
10print MAKEFILE "FIRST: ; \@echo It chose GNUmakefile\n";
11close(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
16if ($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"
24open(MAKEFILE,"> Makefile");
25print MAKEFILE "THIRD: ; \@echo It chose Makefile\n";
26close(MAKEFILE);
27
28
29&run_make_with_options("","",&get_logfile);
30&compare_output("It chose GNUmakefile\n",&get_logfile(1));
31unlink $makefile;
32
33if ($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));
41unlink "Makefile";
42