[Monetdb-developers] Conditional in Makefiles

Sjoerd Mullender sjoerd at acm.org
Tue Jan 16 09:40:11 CET 2007


On 2007-01-15 18:08, Jan Rittinger wrote:
> Thanks Sjoerd for your answer. I think COND is the one I was looking 
> for. However defining a library twice with different conditions ignores 
> the second condition. Is their also the possibility for EITHER/OR (in 
> the following example HAVE_BAR?bar.c:bar_alternative.c)?
> 
> I tried it the following way (where HAVE_BAR is not HAVE_NO_BAR):
> lib_foo = {
>          COND = HAVE_BAR
>          NOINST
>          DIR = libdir
>          SOURCES = \
>                  foo1.c \
>                  foo2.c \
>                  bar.c
> }
> 
> lib_foo = {
>          COND = HAVE_NO_BAR
>          NOINST
>          DIR = libdir
>          SOURCES = \
>                  foo1.c \
>                  foo2.c \
>                  bar_alternative.c
> }

I don't think we have support for anything like this.  The only thing I
can think of is a C file which chooses which of the implementations you
want with an #ifdef (and if you want to keep the implementations in
separate files, use #include inside).

Niels, correct me if I am wrong.

> On 01/15/2007 04:16 PM, Sjoerd Mullender wrote with possible deletions:
>> On 2007-01-15 15:54, Jan Rittinger wrote:
>>> Hi Niels, hi Sjoerd,
>>>
>>> Based on a condition in configure I want to compile different files.
>>>
>>> I know that it is possible to include a directory based on a condition, 
>>> but couldn't find a solution for files. Is there any?
>>>
>>> -- If that's not possible is there some magic for the Makefile.ag files 
>>> to write a snippet of code that survives autoconf and automake without 
>>> changes?
>>>
>>> Jan
>>>
>> Look for COND in Makefile.ag.  There are some that have that, and that's
>> what you can use.  There's even one in pathfinder in src/tools/Makefile.ag.
>>
> 
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys - and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Monetdb-developers mailing list
> Monetdb-developers at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/monetdb-developers


-- 
Sjoerd Mullender

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 370 bytes
Desc: OpenPGP digital signature
URL: <http://www.monetdb.org/pipermail/developers-list/attachments/20070116/930b0348/attachment.sig>


More information about the developers-list mailing list