Imported Upstream version 4.0
[platform/upstream/make.git] / tests / scripts / targets / DEFAULT
1 $description = "The following test creates a makefile to override part\n"
2               ."of one Makefile with Another Makefile with the .DEFAULT\n"
3               ."rule.";
4
5 $details = "This tests the use of the .DEFAULT special target to say that \n"
6           ."to remake any target that cannot be made fram the information\n"
7           ."in the containing makefile, make should look in another makefile\n"
8           ."This test gives this makefile the target bar which is not \n"
9           ."defined here but passes the target bar on to another makefile\n"
10           ."which does have the target bar defined.\n";
11
12 $makefile2 = &get_tmpfile;
13
14 open(MAKEFILE,"> $makefile");
15
16 # The Contents of the MAKEFILE ...
17
18 print MAKEFILE "foo:\n";
19 print MAKEFILE "\t\@echo Executing rule FOO\n\n";
20 print MAKEFILE ".DEFAULT:\n";
21 print MAKEFILE "\t\@\$(MAKE) -f $makefile2 \$\@ \n";
22
23 # END of Contents of MAKEFILE
24
25 close(MAKEFILE);
26
27
28 open(MAKEFILE,"> $makefile2");
29
30 print MAKEFILE "bar:\n";
31 print MAKEFILE "\t\@echo Executing rule BAR\n\n";
32
33 close(MAKEFILE);
34
35 &run_make_with_options($makefile,'bar',&get_logfile);
36
37 # Create the answer to what should be produced by this Makefile
38 $answer = "${make_name}[1]: Entering directory '$pwd'\n"
39         . "Executing rule BAR\n"
40         . "${make_name}[1]: Leaving directory '$pwd'\n";
41
42 # COMPARE RESULTS
43
44 &compare_output($answer,&get_logfile(1));
45
46 # This tells the test driver that the perl test script executed properly.
47 1;
48
49
50
51
52
53