Add the beginning of the .ONESHELL special feature.
[make.git] / tests / scripts / features / vpathgpath
blobf7683f52e3251059283364ec6c25f43f0d99c0e6
1 #                                                                    -*-perl-*-
2 $description = "Tests VPATH+/GPATH functionality.";
4 $details = "";
6 $VP = "$workdir$pathsep";
8 open(MAKEFILE,"> $makefile");
10 # The Contents of the MAKEFILE ...
12 print MAKEFILE "VPATH = $VP\n";
14 print MAKEFILE <<'EOMAKE';
16 GPATH = $(VPATH)
18 .SUFFIXES: .a .b .c .d
19 .PHONY: general rename notarget intermediate
21 %.a:
22 %.b:
23 %.c:
24 %.d:
26 %.a : %.b ; cat $^ > $@
27 %.b : %.c ; cat $^ > $@
28 %.c :: %.d ; cat $^ > $@
30 # General testing info:
32 general: foo.b
33 foo.b: foo.c bar.c
35 EOMAKE
37 close(MAKEFILE);
39 @touchedfiles = ();
41 $off = -500;
43 sub touchfiles {
44   foreach (@_) {
45     ($f = $_) =~ s,VP/,$VP,g;
46     &utouch($off, $f);
47     $off += 10;
48     push(@touchedfiles, $f);
49   }
52 # Run the general-case test
54 &touchfiles("VP/foo.d", "VP/bar.d", "VP/foo.c", "VP/bar.c", "foo.b", "bar.d");
56 &run_make_with_options($makefile,"general",&get_logfile());
58 push(@touchedfiles, "bar.c");
60 $answer = "$make_name: Nothing to be done for `general'.\n";
62 &compare_output($answer,&get_logfile(1));
64 unlink(@touchedfiles) unless $keep;