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