vpathgpath 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. # -*-perl-*-
  2. $description = "Tests VPATH+/GPATH functionality.";
  3. $details = "";
  4. $VP = "$workdir$pathsep";
  5. open(MAKEFILE,"> $makefile");
  6. # The Contents of the MAKEFILE ...
  7. print MAKEFILE "VPATH = $VP\n";
  8. print MAKEFILE <<'EOMAKE';
  9. GPATH = $(VPATH)
  10. .SUFFIXES: .a .b .c .d
  11. .PHONY: general rename notarget intermediate
  12. %.a:
  13. %.b:
  14. %.c:
  15. %.d:
  16. %.a : %.b ; cat $^ > $@
  17. %.b : %.c ; cat $^ > $@
  18. %.c :: %.d ; cat $^ > $@
  19. # General testing info:
  20. general: foo.b
  21. foo.b: foo.c bar.c
  22. EOMAKE
  23. close(MAKEFILE);
  24. @touchedfiles = ();
  25. sub touchfiles {
  26. foreach (@_) {
  27. ($f = $_) =~ s,VP/,$VP,g;
  28. &touch($f);
  29. push(@touchedfiles, $f);
  30. sleep(1);
  31. }
  32. }
  33. # Run the general-case test
  34. &touchfiles("VP/foo.d", "VP/bar.d", "VP/foo.c", "VP/bar.c", "foo.b", "bar.d");
  35. &run_make_with_options($makefile,"general",&get_logfile());
  36. push(@touchedfiles, "bar.c");
  37. $answer = "$make_name: Nothing to be done for `general'.\n";
  38. &compare_output($answer,&get_logfile(1));
  39. unlink(@touchedfiles) unless $keep;
  40. 1;