automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: build the same source twice with different macros


From: Nicolas Bock
Subject: Re: build the same source twice with different macros
Date: Mon, 15 Nov 2010 20:26:19 -0700

Thanks all for the suggestions. I will give it a try...

nick


On Mon, Nov 15, 2010 at 14:08, Ralf Wildenhues <address@hidden> wrote:
> Hi Nicolas,
>
> * Nicolas Bock wrote on Mon, Nov 15, 2010 at 05:11:26PM CET:
>> (1) I can use C++ and rewrite the function header as a template.
>> (2) I can define a macro for the preprocessor that is either defined
>> as "float" or "double" and then compile the function source twice, the
>> first time with $CC -DFLOAT=float and the second time with $CC
>> -DFLOAT=double.
>>
>> Is option (2) possible within automake without excessive hackery?
>
> Yes.
>
>> Is it advisable? Is there a third option that I might want to
>> consider?
>
> I'd say it's normal mumbo jumbo.  See 'info Automake true'.
>
> bin_PROGRAMS = foo
> foo_SOURCES = ... (other sources)
> foo_LDADD = libfood.a libfoof.a
>
> noinst_LIBRARIES = libfood.a libfoof.a
> libfood_a_SOURCES = bar.c
> libfoof_a_SOURCES = $(libfood_a_SOURCES)
> libfood_a_CPPFLAGS = -DFLOAT=float
>
> Hope that helps.
>
> Cheers,
> Ralf
>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]