xref: /netbsd-src/external/gpl2/gmake/dist/tests/scripts/variables/MAKELEVEL (revision 69606e3f5c9388e52aed8c120ad63c049ca45d8f)
1*69606e3fSchristos#                                                                    -*-perl-*-
2*69606e3fSchristos
3*69606e3fSchristos$description = "The following test creates a makefile to test
4*69606e3fSchristosmakelevels in Make. It prints \$(MAKELEVEL) and then
5*69606e3fSchristosprints the environment variable MAKELEVEL";
6*69606e3fSchristos
7*69606e3fSchristosopen(MAKEFILE,"> $makefile");
8*69606e3fSchristos
9*69606e3fSchristos# The Contents of the MAKEFILE ...
10*69606e3fSchristos
11*69606e3fSchristosprint MAKEFILE <<EOF;
12*69606e3fSchristosall:
13*69606e3fSchristos\t\@echo MAKELEVEL is \$(MAKELEVEL)
14*69606e3fSchristos\techo \$\$MAKELEVEL
15*69606e3fSchristosEOF
16*69606e3fSchristos
17*69606e3fSchristos# END of Contents of MAKEFILE
18*69606e3fSchristos
19*69606e3fSchristosclose(MAKEFILE);
20*69606e3fSchristos
21*69606e3fSchristos# RUN MAKE
22*69606e3fSchristos
23*69606e3fSchristos&run_make_with_options($makefile,"",&get_logfile);
24*69606e3fSchristos
25*69606e3fSchristos# SET ANSWER
26*69606e3fSchristos
27*69606e3fSchristos$answer = "MAKELEVEL is 0\necho \$MAKELEVEL\n1\n";
28*69606e3fSchristos
29*69606e3fSchristos# COMPARE RESULTS
30*69606e3fSchristos
31*69606e3fSchristos&compare_output($answer,&get_logfile(1));
32*69606e3fSchristos
33*69606e3fSchristos1;
34