• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#                                                                    -*-perl-*-
2$description = "Tests VPATH+/GPATH functionality.";
3
4$details = "";
5
6$VP = "$workdir$pathsep";
7
8open(MAKEFILE,"> $makefile");
9
10# The Contents of the MAKEFILE ...
11
12print MAKEFILE "VPATH = $VP\n";
13
14print MAKEFILE <<'EOMAKE';
15
16GPATH = $(VPATH)
17
18.SUFFIXES: .a .b .c .d
19.PHONY: general rename notarget intermediate
20
21%.a:
22%.b:
23%.c:
24%.d:
25
26%.a : %.b ; cat $^ > $@
27%.b : %.c ; cat $^ > $@
28%.c :: %.d ; cat $^ > $@
29
30# General testing info:
31
32general: foo.b
33foo.b: foo.c bar.c
34
35EOMAKE
36
37close(MAKEFILE);
38
39@touchedfiles = ();
40
41$off = -500;
42
43sub touchfiles {
44  foreach (@_) {
45    ($f = $_) =~ s,VP/,$VP,g;
46    &utouch($off, $f);
47    $off += 10;
48    push(@touchedfiles, $f);
49  }
50}
51
52# Run the general-case test
53
54&touchfiles("VP/foo.d", "VP/bar.d", "VP/foo.c", "VP/bar.c", "foo.b", "bar.d");
55
56&run_make_with_options($makefile,"general",&get_logfile());
57
58push(@touchedfiles, "bar.c");
59
60$answer = "$make_name: Nothing to be done for `general'.\n";
61
62&compare_output($answer,&get_logfile(1));
63
64unlink(@touchedfiles) unless $keep;
65
661;
67