Debian Codegraph @

tests/scripts/variables/MAKEFILES

raw
1 # -*-perl-*-
2
3 $description = "Test the MAKEFILES variable.";
4
5 $makefile2 = &get_tmpfile;
6 $makefile3 = &get_tmpfile;
7
8 open(MAKEFILE,"> $makefile2");
9 print MAKEFILE <<EOF;
10 M2 = m2
11 NDEF: ; \@echo RULE FROM MAKEFILE 2
12 EOF
13 close(MAKEFILE);
14
15
16 open(MAKEFILE,"> $makefile3");
17 print MAKEFILE <<EOF;
18 M3 = m3
19 NDEF3: ; \@echo RULE FROM MAKEFILE 3
20 EOF
21 close(MAKEFILE);
22
23 run_make_test(q!
24 all: ; @echo DEFAULT RULE: M2=$(M2) M3=$(M3)
25 !,
26 ["MAKEFILES=$makefile2 $makefile3"], "DEFAULT RULE: M2=m2 M3=m3\n");
27
28 # TEST 2: Verify that included makefiles don't set the default goal.
29 # See Savannah bug #13401.
30
31 create_file('xx-inc.mk', '
32 include_goal: ; @echo $@
33 include xx-ind.mk
34 ');
35
36 create_file('xx-ind.mk', '
37 indirect_goal: ; @echo $@
38 ');
39
40 run_make_test(q!
41 top: ; @echo $@
42 !,
43 'MAKEFILES=xx-inc.mk', "top\n");
44
45 unlink(qw(xx-inc.mk xx-ind.mk));
46
47 1;