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: Ralf Wildenhues
Subject: Re: build the same source twice with different macros
Date: Mon, 15 Nov 2010 22:08:16 +0100
User-agent: Mutt/1.5.20 (2010-08-04)

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]