Imported Upstream version 3.82
[platform/upstream/make.git] / tests / scripts / features / vpath2
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
7 $details = "This test simply adds many search paths using various vpath\n"
8           ."directive forms and clears them afterwards.  It has a simple\n"
9           ."rule to print a message at the end to confirm that the makefile\n"
10           ."ran with no errors.\n";
11
12 open(MAKEFILE,"> $makefile");
13
14 # The Contents of the MAKEFILE ...
15
16 print MAKEFILE "VPATH = $workdir:$sourcedir\n";
17 print MAKEFILE "vpath %.c foo\n";
18 print MAKEFILE "vpath %.c $workdir\n";
19 print MAKEFILE "vpath %.c $sourcedir\n";
20 print MAKEFILE "vpath %.h $workdir\n";
21 print MAKEFILE "vpath %.c\n";
22 print MAKEFILE "vpath\n";
23 print MAKEFILE "all:\n";
24 print MAKEFILE "\t\@echo ALL IS WELL\n";
25 # END of Contents of MAKEFILE
26
27 close(MAKEFILE);
28
29 &run_make_with_options($makefile,"",&get_logfile);
30
31 # Create the answer to what should be produced by this Makefile
32 $answer = "ALL IS WELL\n";
33
34 &compare_output($answer,&get_logfile(1));
35
36 1;
37
38
39
40
41
42
43
44
45