xref: /netbsd-src/external/gpl2/gmake/dist/tests/scripts/features/default_names (revision 69606e3f5c9388e52aed8c120ad63c049ca45d8f)
1*69606e3fSchristos#                                                                    -*-perl-*-
2*69606e3fSchristos
3*69606e3fSchristos$description = "This script tests to make sure that Make looks for
4*69606e3fSchristosdefault makefiles in the correct order (GNUmakefile,makefile,Makefile)";
5*69606e3fSchristos
6*69606e3fSchristos# Create a makefile called "GNUmakefile"
7*69606e3fSchristos$makefile = "GNUmakefile";
8*69606e3fSchristos
9*69606e3fSchristosopen(MAKEFILE,"> $makefile");
10*69606e3fSchristosprint MAKEFILE "FIRST: ; \@echo It chose GNUmakefile\n";
11*69606e3fSchristosclose(MAKEFILE);
12*69606e3fSchristos
13*69606e3fSchristos# DOS/WIN32 platforms preserve case, but Makefile is the same file as makefile.
14*69606e3fSchristos# Just test what we can here (avoid Makefile versus makefile test).
15*69606e3fSchristos
16*69606e3fSchristosif ($port_type eq 'UNIX') {
17*69606e3fSchristos  # Create another makefile called "makefile"
18*69606e3fSchristos  open(MAKEFILE,"> makefile");
19*69606e3fSchristos  print MAKEFILE "SECOND: ; \@echo It chose makefile\n";
20*69606e3fSchristos  close(MAKEFILE);
21*69606e3fSchristos}
22*69606e3fSchristos
23*69606e3fSchristos# Create another makefile called "Makefile"
24*69606e3fSchristosopen(MAKEFILE,"> Makefile");
25*69606e3fSchristosprint MAKEFILE "THIRD: ; \@echo It chose Makefile\n";
26*69606e3fSchristosclose(MAKEFILE);
27*69606e3fSchristos
28*69606e3fSchristos
29*69606e3fSchristos&run_make_with_options("","",&get_logfile);
30*69606e3fSchristos&compare_output("It chose GNUmakefile\n",&get_logfile(1));
31*69606e3fSchristosunlink $makefile;
32*69606e3fSchristos
33*69606e3fSchristosif ($port_type eq 'UNIX') {
34*69606e3fSchristos  &run_make_with_options("","",&get_logfile);
35*69606e3fSchristos  &compare_output("It chose makefile\n",&get_logfile(1));
36*69606e3fSchristos  unlink "makefile";
37*69606e3fSchristos}
38*69606e3fSchristos
39*69606e3fSchristos&run_make_with_options("","",&get_logfile);
40*69606e3fSchristos&compare_output("It chose Makefile\n",&get_logfile(1));
41*69606e3fSchristosunlink "Makefile";
42