MAKECMDGOALS 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. # -*-perl-*-
  2. $description = "Test the MAKECMDGOALS variable.";
  3. $details = "\
  4. We construct a makefile with various targets, all of which print out
  5. \$(MAKECMDGOALS), then call it different ways.";
  6. open(MAKEFILE,"> $makefile");
  7. print MAKEFILE "\
  8. .DEFAULT all:
  9. \@echo \$(MAKECMDGOALS)
  10. ";
  11. close(MAKEFILE);
  12. # TEST #1
  13. &run_make_with_options($makefile,
  14. "",
  15. &get_logfile,
  16. 0);
  17. $answer = "\n";
  18. &compare_output($answer,&get_logfile(1));
  19. # TEST #2
  20. &run_make_with_options($makefile,
  21. "all",
  22. &get_logfile,
  23. 0);
  24. $answer = "all\n";
  25. &compare_output($answer,&get_logfile(1));
  26. # TEST #3
  27. &run_make_with_options($makefile,
  28. "foo bar baz yaz",
  29. &get_logfile,
  30. 0);
  31. $answer = "foo bar baz yaz\nfoo bar baz yaz\nfoo bar baz yaz\nfoo bar baz yaz\n";
  32. &compare_output($answer,&get_logfile(1));
  33. # This tells the test driver that the perl test script executed properly.
  34. 1;