9 |
for another target filtered with .elc and creates a command |
for another target filtered with .elc and creates a command |
10 |
to emacs a .el file"; |
to emacs a .el file"; |
11 |
|
|
|
open(MAKEFILE,"> $makefile"); |
|
|
print MAKEFILE <<'EOF'; |
|
|
files = foo.elc bar.o lose.o |
|
|
|
|
|
$(filter %.o,$(files)): %.o: %.c ; @echo CC -c $(CFLAGS) $< -o $@ |
|
|
|
|
|
$(filter %.elc,$(files)): %.elc: %.el ; @echo emacs $< |
|
|
EOF |
|
|
close(MAKEFILE); |
|
|
|
|
|
|
|
12 |
&touch('bar.c', 'lose.c'); |
&touch('bar.c', 'lose.c'); |
13 |
|
|
14 |
# TEST #1 |
# TEST #0 |
15 |
# ------- |
# ------- |
16 |
|
|
17 |
&run_make_with_options($makefile, '', &get_logfile); |
run_make_test(' |
18 |
$answer = "CC -c bar.c -o bar.o\n"; |
files = foo.elc bar.o lose.o |
|
&compare_output($answer, &get_logfile(1)); |
|
19 |
|
|
20 |
|
$(filter %.o,$(files)): %.o: %.c ; @echo CC -c $(CFLAGS) $< -o $@ |
21 |
|
|
22 |
|
$(filter %.elc,$(files)): %.elc: %.el ; @echo emacs $< |
23 |
|
', |
24 |
|
'', |
25 |
|
'CC -c bar.c -o bar.o'); |
26 |
|
|
27 |
# TEST #2 |
# TEST #1 |
28 |
# ------- |
# ------- |
29 |
|
|
30 |
&run_make_with_options($makefile, 'lose.o', &get_logfile); |
run_make_test(undef, 'lose.o', 'CC -c lose.c -o lose.o'); |
|
$answer = "CC -c lose.c -o lose.o\n"; |
|
|
&compare_output($answer, &get_logfile(1)); |
|
31 |
|
|
32 |
|
|
33 |
# TEST #3 |
# TEST #2 |
34 |
# ------- |
# ------- |
35 |
&touch("foo.el"); |
&touch("foo.el"); |
36 |
|
|
37 |
&run_make_with_options($makefile, 'foo.elc', &get_logfile); |
run_make_test(undef, 'foo.elc', 'emacs foo.el'); |
|
$answer = "emacs foo.el\n"; |
|
|
&compare_output($answer, &get_logfile(1)); |
|
|
|
|
38 |
|
|
39 |
|
# Clean up after the first tests. |
40 |
unlink('foo.el', 'bar.c', 'lose.c'); |
unlink('foo.el', 'bar.c', 'lose.c'); |
41 |
|
|
42 |
|
|
43 |
# TEST #4 -- PR/1670: don't core dump on invalid static pattern rules |
# TEST #3 -- PR/1670: don't core dump on invalid static pattern rules |
44 |
# ------- |
# ------- |
45 |
|
|
46 |
$makefile2 = &get_tmpfile; |
run_make_test(' |
47 |
open(MAKEFILE, "> $makefile2"); |
.DEFAULT: ; @echo $@ |
48 |
print MAKEFILE "foo: foo%: % ; \@echo \$@\n"; |
foo: foo%: % %.x % % % y.% % ; @echo $@ |
49 |
close(MAKEFILE); |
', |
50 |
|
'', ".x\ny.\nfoo"); |
51 |
&run_make_with_options($makefile2, '', &get_logfile); |
|
|
$answer = "foo\n"; |
|
|
&compare_output($answer, &get_logfile(1)); |
|
52 |
|
|
53 |
# TEST #5 -- bug #12180: core dump on a stat pattern rule with an empty |
# TEST #4 -- bug #12180: core dump on a stat pattern rule with an empty |
54 |
# prerequisite list. |
# prerequisite list. |
|
# |
|
55 |
run_make_test(' |
run_make_test(' |
56 |
foo.x bar.x: %.x : ; @echo $@ |
foo.x bar.x: %.x : ; @echo $@ |
57 |
|
|
58 |
', |
', |
59 |
'', |
'', 'foo.x'); |
|
'foo.x |
|
|
'); |
|
60 |
|
|
61 |
|
|
62 |
# TEST #6 -- bug #13881: double colon static pattern rule does not |
# TEST #5 -- bug #13881: double colon static pattern rule does not |
63 |
# substitute %. |
# substitute %. |
|
# |
|
64 |
run_make_test(' |
run_make_test(' |
65 |
foo.bar:: %.bar: %.baz |
foo.bar:: %.bar: %.baz |
66 |
foo.baz: ;@: |
foo.baz: ;@: |
67 |
', |
', |
68 |
'', |
'', ''); |
|
''); |
|
69 |
|
|
70 |
1; |
1; |