mirror of
https://git.savannah.gnu.org/git/make.git
synced 2024-12-29 08:09:02 +00:00
539f513773
POSIX requires that the value of SHELL in the makefile NOT be exported to sub-commands. Instead, the value in the environment when make was invoked should be passed to the environment of sub-commands. Note that make still uses SHELL to _run_ sub-commands; it just doesn't change the value of the SHELL variable in the environment of sub-commands. As an extension to POSIX, if the makefile explicitly exports SHELL then GNU make _will_ use it in the environment of sub-commands.
33 lines
641 B
Perl
33 lines
641 B
Perl
# -*-perl-*-
|
|
|
|
$description = "The following test creates a makefile to test
|
|
makelevels in Make. It prints \$(MAKELEVEL) and then
|
|
prints the environment variable MAKELEVEL";
|
|
|
|
open(MAKEFILE,"> $makefile");
|
|
|
|
# The Contents of the MAKEFILE ...
|
|
|
|
print MAKEFILE <<EOF;
|
|
all:
|
|
\t\@echo MAKELEVEL is \$(MAKELEVEL)
|
|
\techo \$\$MAKELEVEL
|
|
EOF
|
|
|
|
# END of Contents of MAKEFILE
|
|
|
|
close(MAKEFILE);
|
|
|
|
# RUN MAKE
|
|
|
|
&run_make_with_options($makefile,"",&get_logfile);
|
|
|
|
# SET ANSWER
|
|
|
|
$answer = "MAKELEVEL is 0\necho \$MAKELEVEL\n1\n";
|
|
|
|
# COMPARE RESULTS
|
|
|
|
&compare_output($answer,&get_logfile(1));
|
|
|
|
1;
|