bug-automake
[Top][All Lists]
Advanced

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

Re: how to create dependencies for conditional sources


From: Roumen Petrov
Subject: Re: how to create dependencies for conditional sources
Date: Sun, 01 Jul 2007 22:30:51 +0300
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.10) Gecko/20070306 SeaMonkey/1.0.8

Ralf Wildenhues wrote:
Hello Roumen,

* Roumen Petrov wrote on Thu, Jun 28, 2007 at 10:26:31PM CEST:
Please find attached test case "bootstrap.sh".

How to write Makefile.am so that created makefiles to contain dependencies for conditional sources ?

For example, you coud use this Makefile.am instead:

--- snip ---
noinst_PROGRAMS = target
target_SOURCES = main.c

if WITH_CASE1
target_SOURCES += case1.c
endif

if WITH_CASE2
target_SOURCES += case2.c
endif
--- snip ---

With the above, there is no need to set target_LDADD or
target_DEPENDENCIES.

Does that work for you?

That's fine.
Its seems to me that automake 1.9.6 textinfo page "Conditional Sources" is obsolete.
Since page in CVS is same, please update textinfo.

 If no, there is also the possibility to do
something like this:

--- snip ---
if WITH_CASE1
DEPS1=case1.lo
else
DEPS1=
endif

if WITH_CASE2
DEPS2=
else
DEPS2=case2.lo
endif

noinst_PROGRAMS=target

target_SOURCES = main.c
EXTRA_target_SOURCES = case1.c case2.c
target_LDADD= $(DEPS1) $(DEPS2)
--- snip ---

But you would still not need to set target_DEPENDENCIES: automake is
smart enough to figure it out itself.
This work too, but is more complicated.

Cheers,
Ralf

Thanks,
Roumen




reply via email to

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