[Monetdb-developers] Conditional in Makefiles
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 -- Jan Rittinger Database Systems Technische Universität München (Germany) http://www-db.in.tum.de/~rittinge/
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. -- Sjoerd Mullender
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 } 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.
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@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monetdb-developers
-- Sjoerd Mullender
participants (2)
-
Jan Rittinger
-
Sjoerd Mullender