VirtualBox

source: kBuild/vendor/gnumake/current/tests/scripts/options/dash-f@ 3208

最後變更 在這個檔案從3208是 2596,由 bird 提交於 13 年 前

gnumake/current -> 3.82-cvs.

  • 屬性 svn:eol-style 設為 LF
檔案大小: 2.5 KB
 
1$description = "The following test tests that if you specify greater \n"
2 ."than one '-f makefilename' on the command line, \n"
3 ."that make concatenates them. This test creates three \n"
4 ."makefiles and specifies all of them with the -f option \n"
5 ."on the command line. To make sure they were concatenated, \n"
6 ."we then call make with the rules from the concatenated \n"
7 ."makefiles one at a time. Finally, it calls all three \n"
8 ."rules in one call to make and checks that the output\n"
9 ."is in the correct order.";
10
11$makefile2 = &get_tmpfile;
12$makefile3 = &get_tmpfile;
13
14open(MAKEFILE,"> $makefile");
15
16# The Contents of the MAKEFILE ...
17
18print MAKEFILE "all: \n";
19print MAKEFILE "\t\@echo This is the output from the original makefile\n";
20
21# END of Contents of MAKEFILE
22
23close(MAKEFILE);
24
25# Create a second makefile
26open(MAKEFILE,"> $makefile2");
27print MAKEFILE "TWO: \n";
28print MAKEFILE "\t\@echo This is the output from makefile 2\n";
29close(MAKEFILE);
30
31# Create a third makefile
32open(MAKEFILE,"> $makefile3");
33print MAKEFILE "THREE: \n";
34print MAKEFILE "\t\@echo This is the output from makefile 3\n";
35close(MAKEFILE);
36
37
38# Create the answer to what should be produced by this Makefile
39$answer = "This is the output from the original makefile\n";
40
41# Run make to catch the default rule
42&run_make_with_options($makefile,"-f $makefile2 -f $makefile3",&get_logfile,0);
43
44&compare_output($answer,&get_logfile(1));
45
46
47# Run Make again with the rule from the second makefile: TWO
48$answer = "This is the output from makefile 2\n";
49
50&run_make_with_options($makefile,"-f $makefile2 -f $makefile3 TWO",&get_logfile,0);
51
52&compare_output($answer,&get_logfile(1));
53
54
55# Run Make again with the rule from the third makefile: THREE
56
57$answer = "This is the output from makefile 3\n";
58&run_make_with_options($makefile,
59 "-f $makefile2 -f $makefile3 THREE",
60 &get_logfile,
61 0);
62&compare_output($answer,&get_logfile(1));
63
64
65# Run Make again with ALL three rules in the order 2 1 3 to make sure
66# that all rules are executed in the proper order
67
68$answer = "This is the output from makefile 2\n";
69$answer .= "This is the output from the original makefile\n";
70$answer .= "This is the output from makefile 3\n";
71&run_make_with_options($makefile,
72 "-f $makefile2 -f $makefile3 TWO all THREE",
73 &get_logfile,
74 0);
75&compare_output($answer,&get_logfile(1));
76
77
78
79
80
81
82
83
84
85
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette