1 | $description ="The following test creates a makefile to test the -I option.";
|
---|
2 |
|
---|
3 | $details = "\
|
---|
4 | This test tests the -I option by including a filename in
|
---|
5 | another directory and giving make that directory name
|
---|
6 | under -I in the command line. Without this option, the make
|
---|
7 | would fail to find the included file. It also checks to make
|
---|
8 | sure that the -I option gets passed to recursive makes.";
|
---|
9 |
|
---|
10 | $makefile2 = &get_tmpfile;
|
---|
11 |
|
---|
12 | open(MAKEFILE,"> $makefile");
|
---|
13 |
|
---|
14 | # The Contents of the MAKEFILE ...
|
---|
15 |
|
---|
16 | $mf2 = substr ($makefile2, index ($makefile2, $pathsep) + 1);
|
---|
17 | print MAKEFILE <<EOF;
|
---|
18 | include $mf2
|
---|
19 | all:
|
---|
20 | \t\@echo There should be no errors for this makefile.
|
---|
21 | EOF
|
---|
22 |
|
---|
23 | # END of Contents of MAKEFILE
|
---|
24 |
|
---|
25 | close(MAKEFILE);
|
---|
26 |
|
---|
27 |
|
---|
28 | open(MAKEFILE,"> $makefile2");
|
---|
29 |
|
---|
30 | print MAKEFILE <<EOF;
|
---|
31 | ANOTHER:
|
---|
32 | \t\@echo This is another included makefile
|
---|
33 | recurse:
|
---|
34 | \t\$(MAKE) ANOTHER -f $makefile
|
---|
35 | EOF
|
---|
36 |
|
---|
37 | close(MAKEFILE);
|
---|
38 |
|
---|
39 | &run_make_with_options($makefile,"-I $workdir all",&get_logfile);
|
---|
40 |
|
---|
41 | # Create the answer to what should be produced by this Makefile
|
---|
42 | $answer = "There should be no errors for this makefile.\n";
|
---|
43 | &compare_output($answer,&get_logfile(1));
|
---|
44 |
|
---|
45 |
|
---|
46 | $answer = "This is another included makefile\n";
|
---|
47 | &run_make_with_options($makefile,"-I $workdir ANOTHER",&get_logfile);
|
---|
48 | &compare_output($answer,&get_logfile(1));
|
---|
49 |
|
---|
50 |
|
---|
51 | $answer = "$mkpath ANOTHER -f $makefile
|
---|
52 | ${make_name}[1]: Entering directory `$pwd'
|
---|
53 | This is another included makefile
|
---|
54 | ${make_name}[1]: Leaving directory `$pwd'\n";
|
---|
55 |
|
---|
56 | &run_make_with_options($makefile,"-I $workdir recurse",&get_logfile);
|
---|
57 | &compare_output($answer,&get_logfile(1));
|
---|