- Enhance .POSIX to set -e when invoking shells, as demanded by a
[make.git] / tests / scripts / variables / MAKEFILES
blobb23da8ead3c28567d03a7a3d297326b5d4084b7e
1 #                                                                    -*-perl-*-
3 $description = "Test the MAKEFILES variable.";
5 $makefile2 = &get_tmpfile;
6 $makefile3 = &get_tmpfile;
8 open(MAKEFILE,"> $makefile");
9 print MAKEFILE 'all: ; @echo DEFAULT RULE: M2=$(M2) M3=$(M3)', "\n";
10 close(MAKEFILE);
13 open(MAKEFILE,"> $makefile2");
14 print MAKEFILE <<EOF;
15 M2 = m2
16 NDEF: ; \@echo RULE FROM MAKEFILE 2
17 EOF
18 close(MAKEFILE);
21 open(MAKEFILE,"> $makefile3");
22 print MAKEFILE <<EOF;
23 M3 = m3
24 NDEF3: ; \@echo RULE FROM MAKEFILE 3
25 EOF
26 close(MAKEFILE);
29 &run_make_with_options($makefile, "MAKEFILES='$makefile2 $makefile3'",
30                        &get_logfile);
31 $answer = "DEFAULT RULE: M2=m2 M3=m3\n";
32 &compare_output($answer,&get_logfile(1));
34 # TEST 2: Verify that included makefiles don't set the default goal.
35 # See Savannah bug #13401.
37 create_file('xx-inc.mk', '
38 include_goal: ; @echo $@
39 include xx-ind.mk
40 ');
42 create_file('xx-ind.mk', '
43 indirect_goal: ; @echo $@
44 ');
46 run_make_test(q!
47 top: ; @echo $@
49               'MAKEFILES=xx-inc.mk', "top\n");
51 unlink(qw(xx-inc.mk xx-ind.mk));