VirtualBox

source: kBuild/trunk/src/gmake/tests/scripts/functions/origin@ 285

最後變更 在這個檔案從285是 154,由 bird 提交於 21 年 前

This commit was generated by cvs2svn to compensate for changes in r153,
which included commits to RCS files with non-trunk default branches.

  • 屬性 svn:eol-style 設為 native
檔案大小: 1.5 KB
 
1# -*-perl-*-
2
3$description = "Test the origin function.";
4
5$details = "This is a test of the origin function in gnu make.
6This function will report on where a variable was
7defined per the following list:
8
9'undefined' never defined
10'default' default definition
11'environment' environment var without -e
12'environment override' environment var with -e
13'file' defined in makefile
14'command line' defined on the command line
15'override' defined by override in makefile
16'automatic' Automatic variable\n";
17
18# Set an environment variable
19$ENV{MAKETEST} = 1;
20
21open(MAKEFILE,"> $makefile");
22
23print MAKEFILE <<EOF;
24foo := bletch garf
25auto_var = udef CC MAKETEST MAKE foo CFLAGS WHITE \@
26av = \$(foreach var, \$(auto_var), \$(origin \$(var)) )
27override WHITE := BLACK
28all: auto
29\t\@echo \$(origin undefined)
30\t\@echo \$(origin CC)
31\t\@echo \$(origin MAKETEST)
32\t\@echo \$(origin MAKE)
33\t\@echo \$(origin foo)
34\t\@echo \$(origin CFLAGS)
35\t\@echo \$(origin WHITE)
36\t\@echo \$(origin \@)
37auto :
38\t\@echo \$(av)
39EOF
40
41close(MAKEFILE);
42
43&run_make_with_options($makefile,
44 "-e WHITE=WHITE CFLAGS=",
45 &get_logfile);
46
47# Create the answer to what should be produced by this Makefile
48$answer = "undefined default environment default file command line override automatic
49undefined
50default
51environment
52default
53file
54command line
55override
56automatic\n";
57
58
59&compare_output($answer,&get_logfile(1));
60
611;
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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