Hi,

Op Sunday 02 March 2008 10:42:04 schreef Ralf Wildenhues:
> * Remco Bras wrote on Fri, Feb 29, 2008 at 11:37:01PM CET:
> > as part of my work on GNU RPGE, I've had to 'extend' the automake suffix
> > rule for compiling .c files to .o ones.
>
> Why, what limitation made this necessary, and how exactly do your
> changed rules/macros look like?  Maybe it can be solved in a different
> way without breakage.
>

It's more of a convenience, being that the .c files are preprocessed using sed 
to generate some common function definitions without having to write them all 
out by hand.  The changed rule is as follows:

.c.o:
        $(top_srcdir)/convertors.sh $< && $(CC) $(CFLAGS) $(AM_CFLAGS) -o $@ -c 
$< && 
cp $<{.backup,} && rm $<.backup

convertors.sh copies the original .c file to a .c.backup equivalent and 
invokes sed a few times on the original. Once done, the cp and rm commands 
are meant to restore the original version of the original, so that the 
abbreviation can remain in place.

> > In the docs, I could not find a variable
> > containing the default suffix rule for this purpose, so I replaced the
> > entirity of it.
>
> It's hard-coded in automake.in (see the register_language calls).

Interesting.

Thanks,
Remco


Reply via email to