VirtualBox

source: kBuild/vendor/gnumake/current/tests/scripts/functions/origin@ 486

Last change on this file since 486 was 153, checked in by bird, 20 years ago

GNU Make 3.81beta1.

  • Property svn:eol-style set to native
File size: 1.5 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# 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;
Note: See TracBrowser for help on using the repository browser.

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