summaryrefslogtreecommitdiff
path: root/tests/scripts/features/recursion
blob: 444f7ce933839c18d1c0e8361802ef14bf10b2b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#                                                                    -*-perl-*-
$description = "The following test creates a makefile to ...\n";

$details = "DETAILS";

open(MAKEFILE,"> $makefile");

# The Contents of the MAKEFILE ...

print MAKEFILE "all: \n"
              ."\t\$(MAKE) -f $makefile foo \n"
              ."foo: \n"
              ."\t\@echo \$(MAKE) \n"
              ."\t\@echo MAKELEVEL = \$(MAKELEVEL)\n"
              ."\t\$(MAKE) -f $makefile last \n"
              ."last: \n"
              ."\t\@echo \$(MAKE) \n"
              ."\t\@echo MAKELEVEL = \$(MAKELEVEL) \n"
              ."\t\@echo THE END\n";

# END of Contents of MAKEFILE

close(MAKEFILE);

if ($vos)
{
   $answer = "$make_name: Entering directory \`$pwd\'\n"
            ."make 'CFLAGS=-O' -f $makefile foo \n"
            ."make CFLAGS=-O\n"
            ."MAKELEVEL = 0\n"
            ."make 'CFLAGS=-O' -f $makefile last \n"
            ."make CFLAGS=-O\n"
            ."MAKELEVEL = 0\n"
            ."THE END\n"
            ."$make_name: Leaving directory `$pwd'\n";
}
else
{
   $answer = "$make_name: Entering directory `$pwd'\n"
            ."$mkpath -f $makefile foo \n"
            ."${make_name}[1]: Entering directory `$pwd'\n"
            ."$mkpath\n"
            ."MAKELEVEL = 1\n"
            ."$mkpath -f $makefile last \n"
            ."${make_name}[2]: Entering directory `$pwd'\n"
            ."$mkpath\n"
            ."MAKELEVEL = 2\n"
            ."THE END\n"
            ."${make_name}[2]: Leaving directory `$pwd'\n"
            ."${make_name}[1]: Leaving directory `$pwd'\n"
            ."$make_name: Leaving directory `$pwd'\n";
}

$mkoptions = "CFLAGS=-O -w";
$mkoptions .= " -j 2" if ($parallel_jobs);

&run_make_with_options($makefile,$mkoptions,&get_logfile,0);

&compare_output($answer,&get_logfile(1));

1;