xref: /netbsd-src/external/gpl2/gmake/dist/tests/scripts/functions/value (revision 69606e3f5c9388e52aed8c120ad63c049ca45d8f)
1*69606e3fSchristos#                                                                    -*-perl-*-
2*69606e3fSchristos
3*69606e3fSchristos$description = "Test the value function.";
4*69606e3fSchristos
5*69606e3fSchristos$details = "This is a test of the value function in GNU make.
6*69606e3fSchristosThis function will evaluate to the value of the named variable with no
7*69606e3fSchristosfurther expansion performed on it.\n";
8*69606e3fSchristos
9*69606e3fSchristosopen(MAKEFILE,"> $makefile");
10*69606e3fSchristos
11*69606e3fSchristosprint MAKEFILE <<'EOF';
12*69606e3fSchristosexport FOO = foo
13*69606e3fSchristos
14*69606e3fSchristosrecurse = FOO = $FOO
15*69606e3fSchristosstatic := FOO = $(value FOO)
16*69606e3fSchristos
17*69606e3fSchristosall: ; @echo $(recurse) $(value recurse) $(static) $(value static)
18*69606e3fSchristosEOF
19*69606e3fSchristos
20*69606e3fSchristosclose(MAKEFILE);
21*69606e3fSchristos
22*69606e3fSchristos&run_make_with_options($makefile, "", &get_logfile);
23*69606e3fSchristos
24*69606e3fSchristos# Create the answer to what should be produced by this Makefile
25*69606e3fSchristos$answer = "FOO = OO FOO = foo FOO = foo FOO = foo\n";
26*69606e3fSchristos
27*69606e3fSchristos
28*69606e3fSchristos&compare_output($answer,&get_logfile(1));
29*69606e3fSchristos
30*69606e3fSchristos1;
31