1999-10-15 07:00:58 +00:00
|
|
|
# -*-perl-*-
|
|
|
|
|
|
|
|
$description = "Test the MAKEFILES variable.";
|
1999-09-14 02:03:19 +00:00
|
|
|
|
|
|
|
$makefile2 = &get_tmpfile;
|
1999-10-15 07:00:58 +00:00
|
|
|
$makefile3 = &get_tmpfile;
|
1999-09-14 02:03:19 +00:00
|
|
|
|
|
|
|
open(MAKEFILE,"> $makefile2");
|
1999-10-15 07:00:58 +00:00
|
|
|
print MAKEFILE <<EOF;
|
|
|
|
M2 = m2
|
|
|
|
NDEF: ; \@echo RULE FROM MAKEFILE 2
|
|
|
|
EOF
|
1999-09-14 02:03:19 +00:00
|
|
|
close(MAKEFILE);
|
|
|
|
|
|
|
|
|
1999-10-15 07:00:58 +00:00
|
|
|
open(MAKEFILE,"> $makefile3");
|
|
|
|
print MAKEFILE <<EOF;
|
|
|
|
M3 = m3
|
|
|
|
NDEF3: ; \@echo RULE FROM MAKEFILE 3
|
|
|
|
EOF
|
|
|
|
close(MAKEFILE);
|
1999-09-14 02:03:19 +00:00
|
|
|
|
2017-04-17 19:37:57 +00:00
|
|
|
run_make_test(q!
|
|
|
|
all: ; @echo DEFAULT RULE: M2=$(M2) M3=$(M3)
|
|
|
|
!,
|
|
|
|
["MAKEFILES=$makefile2 $makefile3"], "DEFAULT RULE: M2=m2 M3=m3\n");
|
1999-09-14 02:03:19 +00:00
|
|
|
|
2009-06-13 23:10:52 +00:00
|
|
|
# TEST 2: Verify that included makefiles don't set the default goal.
|
|
|
|
# See Savannah bug #13401.
|
|
|
|
|
|
|
|
create_file('xx-inc.mk', '
|
|
|
|
include_goal: ; @echo $@
|
|
|
|
include xx-ind.mk
|
|
|
|
');
|
|
|
|
|
|
|
|
create_file('xx-ind.mk', '
|
|
|
|
indirect_goal: ; @echo $@
|
|
|
|
');
|
|
|
|
|
|
|
|
run_make_test(q!
|
|
|
|
top: ; @echo $@
|
|
|
|
!,
|
|
|
|
'MAKEFILES=xx-inc.mk', "top\n");
|
|
|
|
|
|
|
|
unlink(qw(xx-inc.mk xx-ind.mk));
|
|
|
|
|
1999-09-14 02:03:19 +00:00
|
|
|
1;
|