xref: /netbsd-src/external/gpl2/gmake/dist/tests/scripts/features/varnesting (revision 69606e3f5c9388e52aed8c120ad63c049ca45d8f)
1*69606e3fSchristos$description = "The following test creates a makefile to ...";
2*69606e3fSchristos
3*69606e3fSchristos$details = "";
4*69606e3fSchristos
5*69606e3fSchristosopen(MAKEFILE,"> $makefile");
6*69606e3fSchristos
7*69606e3fSchristos# The Contents of the MAKEFILE ...
8*69606e3fSchristos
9*69606e3fSchristosprint MAKEFILE "x = variable1\n"
10*69606e3fSchristos              ."variable2 := Hello\n"
11*69606e3fSchristos              ."y = \$(subst 1,2,\$(x))\n"
12*69606e3fSchristos              ."z = y\n"
13*69606e3fSchristos              ."a := \$(\$(\$(z)))\n"
14*69606e3fSchristos              ."all: \n"
15*69606e3fSchristos              ."\t\@echo \$(a)\n";
16*69606e3fSchristos
17*69606e3fSchristos# END of Contents of MAKEFILE
18*69606e3fSchristos
19*69606e3fSchristosclose(MAKEFILE);
20*69606e3fSchristos
21*69606e3fSchristos&run_make_with_options($makefile,"",&get_logfile);
22*69606e3fSchristos
23*69606e3fSchristos# Create the answer to what should be produced by this Makefile
24*69606e3fSchristos$answer = "Hello\n";
25*69606e3fSchristos
26*69606e3fSchristos&compare_output($answer,&get_logfile(1));
27*69606e3fSchristos
28*69606e3fSchristos1;
29*69606e3fSchristos
30*69606e3fSchristos
31*69606e3fSchristos
32*69606e3fSchristos
33*69606e3fSchristos
34*69606e3fSchristos
35