This is the mail archive of the
automake@gnu.org
mailing list for the automake project.
how to compile same source multiple times?
- From: David Mosberger-Tang <David dot Mosberger at acm dot org>
- To: automake at gnu dot org
- Date: Sat, 23 Feb 2002 11:04:27 -0800
- Subject: how to compile same source multiple times?
- Reply-to: David dot Mosberger at acm dot org
Perhaps this is a FAQ, but I can't seem to find the answer anywhere:
What's the proper way of telling automake that the same source file
needs to be compiled multiple times with different options.
For example, I have a file called foo.c and I'd like to compile it
once with the normal options and once with -DBAR defined. The
resulting two objects would have to go into the same library (foo.c
will define different global symbols depending on whether or not BAR
is defined).
I supposed I could have autoconf generate a stub source file
foo-BAR.c which contains:
#define BAR
#include "foo.c"
and then have configure expand these files into _LDADD variable, but
I'm unsure whether this is the best way of making this work.
Suggestions?
Thanks,
--david