1 | # -*-perl-*-
|
---|
2 | $description = "The following test creates a makefile to ...\n";
|
---|
3 |
|
---|
4 | $details = "DETAILS";
|
---|
5 |
|
---|
6 | open(MAKEFILE,"> $makefile");
|
---|
7 |
|
---|
8 | # The Contents of the MAKEFILE ...
|
---|
9 |
|
---|
10 | print MAKEFILE "all: \n"
|
---|
11 | ."\t\$(MAKE) -f $makefile foo \n"
|
---|
12 | ."foo: \n"
|
---|
13 | ."\t\@echo \$(MAKE) \n"
|
---|
14 | ."\t\@echo MAKELEVEL = \$(MAKELEVEL)\n"
|
---|
15 | ."\t\$(MAKE) -f $makefile last \n"
|
---|
16 | ."last: \n"
|
---|
17 | ."\t\@echo \$(MAKE) \n"
|
---|
18 | ."\t\@echo MAKELEVEL = \$(MAKELEVEL) \n"
|
---|
19 | ."\t\@echo THE END\n";
|
---|
20 |
|
---|
21 | # END of Contents of MAKEFILE
|
---|
22 |
|
---|
23 | close(MAKEFILE);
|
---|
24 |
|
---|
25 | if ($vos)
|
---|
26 | {
|
---|
27 | $answer = "$make_name: Entering directory \`$pwd\'\n"
|
---|
28 | ."make 'CFLAGS=-O' -f $makefile foo \n"
|
---|
29 | ."make CFLAGS=-O\n"
|
---|
30 | ."MAKELEVEL = 0\n"
|
---|
31 | ."make 'CFLAGS=-O' -f $makefile last \n"
|
---|
32 | ."make CFLAGS=-O\n"
|
---|
33 | ."MAKELEVEL = 0\n"
|
---|
34 | ."THE END\n"
|
---|
35 | ."$make_name: Leaving directory `$pwd'\n";
|
---|
36 | }
|
---|
37 | else
|
---|
38 | {
|
---|
39 | $answer = "$make_name: Entering directory `$pwd'\n"
|
---|
40 | ."$mkpath -f $makefile foo \n"
|
---|
41 | ."${make_name}[1]: Entering directory `$pwd'\n"
|
---|
42 | ."$mkpath\n"
|
---|
43 | ."MAKELEVEL = 1\n"
|
---|
44 | ."$mkpath -f $makefile last \n"
|
---|
45 | ."${make_name}[2]: Entering directory `$pwd'\n"
|
---|
46 | ."$mkpath\n"
|
---|
47 | ."MAKELEVEL = 2\n"
|
---|
48 | ."THE END\n"
|
---|
49 | ."${make_name}[2]: Leaving directory `$pwd'\n"
|
---|
50 | ."${make_name}[1]: Leaving directory `$pwd'\n"
|
---|
51 | ."$make_name: Leaving directory `$pwd'\n";
|
---|
52 | }
|
---|
53 |
|
---|
54 | $mkoptions = "CFLAGS=-O -w";
|
---|
55 | $mkoptions .= " -j 2" if ($parallel_jobs);
|
---|
56 |
|
---|
57 | &run_make_with_options($makefile,$mkoptions,&get_logfile,0);
|
---|
58 |
|
---|
59 | &compare_output($answer,&get_logfile(1));
|
---|
60 |
|
---|
61 | 1;
|
---|