2 $description = "Tests the new VPATH+ functionality added in 3.76.";
6 $VP = "$workdir$pathsep";
8 open(MAKEFILE,"> $makefile");
10 # The Contents of the MAKEFILE ...
12 print MAKEFILE "VPATH = $VP\n";
14 print MAKEFILE <<'EOMAKE';
15 .SUFFIXES: .a .b .c .d
16 .PHONY: general rename notarget intermediate
26 cat $^ > $@ 2>/dev/null || exit 1
30 # General testing info:
35 # Rename testing info:
37 rename: $(VPATH)/foo.c foo.d
39 # Target not made testing info:
42 notarget.c: notarget.d
43 -@echo "not creating $@ from $^"
61 push(@touchedfiles, $_);
65 # Run the general-case test
67 &touchfiles("$VP/foo.d", "$VP/bar.d", "$VP/foo.c", "$VP/bar.c", "foo.b", "bar.d");
69 &run_make_with_options($makefile,"general",&get_logfile);
71 push(@touchedfiles, "bar.c");
73 $answer = "cat bar.d > bar.c
74 cat ${VP}foo.c bar.c > foo.b 2>/dev/null || exit 1
76 &compare_output($answer,&get_logfile(1));
78 # Test rules that don't make the target correctly
80 &touchfiles("$VP/notarget.c", "notarget.b", "notarget.d");
82 &run_make_with_options($makefile,"notarget",&get_logfile,512);
84 $answer = "not creating notarget.c from notarget.d
85 cat notarget.c > notarget.b 2>/dev/null || exit 1
86 $make_name: *** [$makefile:13: notarget.b] Error 1
89 &compare_output($answer,&get_logfile(1));
91 # Test intermediate file handling (part 1)
93 &touchfiles("$VP/inter.d");
95 &run_make_with_options($makefile,"intermediate",&get_logfile);
97 push(@touchedfiles, "inter.a", "inter.b");
99 my $be = pack("L", 1) eq pack("N", 1);
100 my $intfiles = $be ? "inter.c inter.b" : "inter.b inter.c";
101 $answer = "cat ${VP}inter.d > inter.c
102 cat inter.c > inter.b 2>/dev/null || exit 1
103 cat inter.b > inter.a
106 &compare_output($answer,&get_logfile(1));
108 # Test intermediate file handling (part 2)
110 &utouch(-20, "inter.a");
111 &utouch(-10, "$VP/inter.b");
112 &touch("$VP/inter.d");
114 push(@touchedfiles, "$VP/inter.b", "$VP/inter.d");
116 &run_make_with_options($makefile,"intermediate",&get_logfile);
118 $answer = "cat ${VP}inter.d > inter.c
119 cat inter.c > inter.b 2>/dev/null || exit 1
120 cat inter.b > inter.a
123 &compare_output($answer,&get_logfile(1));
125 unlink @touchedfiles unless $keep;
130 ### eval: (setq whitespace-action (delq 'auto-cleanup whitespace-action))