vpath2 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. $description = "This is part 2 in a series to test the vpath directive\n"
  2. ."It tests the three forms of the directive:\n"
  3. ." vpath pattern directive\n"
  4. ." vpath pattern (clears path associated with pattern)\n"
  5. ." vpath (clears all paths specified with vpath)\n";
  6. $details = "This test simply adds many search paths using various vpath\n"
  7. ."directive forms and clears them afterwards. It has a simple\n"
  8. ."rule to print a message at the end to confirm that the makefile\n"
  9. ."ran with no errors.\n";
  10. open(MAKEFILE,"> $makefile");
  11. # The Contents of the MAKEFILE ...
  12. print MAKEFILE "VPATH = $workdir:$sourcedir\n";
  13. print MAKEFILE "vpath %.c foo\n";
  14. print MAKEFILE "vpath %.c $workdir\n";
  15. print MAKEFILE "vpath %.c $sourcedir\n";
  16. print MAKEFILE "vpath %.h $workdir\n";
  17. print MAKEFILE "vpath %.c\n";
  18. print MAKEFILE "vpath\n";
  19. print MAKEFILE "all:\n";
  20. print MAKEFILE "\t\@echo ALL IS WELL\n";
  21. # END of Contents of MAKEFILE
  22. close(MAKEFILE);
  23. &run_make_with_options($makefile,"",&get_logfile);
  24. # Create the answer to what should be produced by this Makefile
  25. $answer = "ALL IS WELL\n";
  26. &compare_output($answer,&get_logfile(1));
  27. 1;