Josef Drexler <[EMAIL PROTECTED]> writes:

> While I could just copy the last rule for times for the four different
> types,

I believe that's the only way.


> in my actual Makefile, the commands are much more complex and the
> file would become unwieldy and harder to maintain if I had to make sure to
> make all changes to all versions of the same commands.

You can factor commands out into a single variable and then use it
from four different places:

define commands
gcc -DTYPE=$(TYPE) -c -o $@ $<
endef

%.ao: %.c
        $(commands)

hth,
-boris




_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make

Reply via email to