I have a minimal Makefile with just this one pattern rule:
%: %.m4
m4 $< > $@
Then, with GNU Make:
touch foo.in.m4 ; make foo.in executes as expected: m4 foo.in.m4 > foo.in
but for foo.sh.m4 (note double suffix), touch foo.sh.m4; make foo.sh tells me: *** No rule to make target 'foo.sh'.
Similar problem with several target suffixes other than .sh (namely: .f, .c, .o, .tex, .dvi). And yet many other suffixes do work (e.g. xml, doc, mp3, pdf, png, txt). The test is:
for suff in pdf sh f c o xml doc docx tex dvi mp3 png odt txt in none yxn; do
touch foo.$suff.m4
make foo.$suff
done
make -r causes things to work as expected so I guess it has something to do with the default suffix list. However, if that's the case, shouldn't adding a rule
.SUFFIXES:
...have the same effect? I tried it, and things improved, but it still failed with .c and .tex, i.e. make bar.c and make bar.tex still fail with a "no rule" error even when bar.c.in and bar.tex.in are present.
Whether make -r or the empty .SUFFIXES rule, I thought the suffix list has to do with suffix rules, not pattern rules. Can someone explain what's going on here? Thx.