Tom Tromey writes:
> Dean> I am looking for a way to include extra rules in every
> Dean> Makefile.in that automake generates.
>
> The typical way is to make a "Makefile.include" and then include it
> from each Makefile.am.
>
> Dean> %.s: %.c
>
> Note that "%" rules are not portable.
> I wonder if automake should warn about this.
>
> Tom
After doing my recent suffix rule changes (AFAIK not applied yet) I
think that some form of limited pattern->suffix rule mapping is
possible for pattern rules with leading %'s and only one % on the RHS.
I think this type of "simple" pattern rule makes up a large part of
pattern rule usage. i.e. they are being used because they are easier
to write/understand, not to get the extra functionality.
This mapping could be activated by an automake option
--expand-pattern-rules so as not to surprise maintainers currently
using "non-simple" pattern rules.
e.g.
%_c.h %_s.h %_c.c %_s.c : %.idl
$(idlcomp) $<
expands to:
.idl_c.h:
$(serialize) $(idlcomp) $<
.idl_s.h:
$(serialize) $(idlcomp) $<
.idl_c.c:
$(serialize) $(idlcomp) $<
.idl_s.c:
$(serialize) $(idlcomp) $<
If people are interested I could include this in the next version of
my built source patch, as I'm already doing something similar by hand.
In fact it's rather tedious and difficult by hand (lot of cutting and
pasting) so automating it might be quite a win.
The serialize is to prevent parallel builds double generating files
and getting them mangled. The main difficult is coming up with a
portable version of serialize written only in shell script :)
Alex.