VirtualBox

source: kBuild/trunk/src/kmk/tests/scripts/functions/origin@ 2152

Last change on this file since 2152 was 1962, checked in by bird, 16 years ago

scripts/functions/origin: kmk adjustment - CC isn't a default variable.

  • Property svn:eol-style set to LF
File size: 1.4 KB
Line 
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# kmk: CC isn't a default.
19$CC_origin = $is_kmk ? "undefined" : "default";
20
21# Set an environment variable
22$extraENV{MAKETEST} = 1;
23
24run_make_test('
25foo := bletch garf
26auto_var = undefined CC MAKETEST MAKE foo CFLAGS WHITE @
27av = $(foreach var, $(auto_var), $(origin $(var)) )
28override WHITE := BLACK
29all: auto
30 @echo $(origin undefined)
31 @echo $(origin CC)
32 @echo $(origin MAKETEST)
33 @echo $(origin MAKE)
34 @echo $(origin foo)
35 @echo $(origin CFLAGS)
36 @echo $(origin WHITE)
37 @echo $(origin @)
38auto :
39 @echo $(av)',
40 '-e WHITE=WHITE CFLAGS=',
41 'undefined '. $CC_origin .' environment default file command line override automatic
42undefined
43'. $CC_origin .'
44environment
45default
46file
47command line
48override
49automatic');
50
51# Reset an environment variable
52delete $extraENV{MAKETEST};
53
541;
Note: See TracBrowser for help on using the repository browser.

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