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