default_names 1.6 KB

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