automake
[Top][All Lists]
Advanced

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

Canonical way to conditionally add (a large amount of) sources to PROG_S


From: Tim Van Holder
Subject: Canonical way to conditionally add (a large amount of) sources to PROG_SOURCES?
Date: Mon, 11 Jun 2001 19:04:13 +0200

Hi,

I need to conditionally (based on a --with configure option)
add a fairly large number (~50) of sources to foo_SOURCES.

First I tried

OPTIONAL=
if MYCONDITIONAL
OPTIONAL = lotsasource.c lotsayacc.y
endif

foo_SOURCES = $(REGULAR) $(OPTIONAL)

but that didn't work; automake complains that OPTIONAL is already
set in TRUE, which implies MYCONDITIONAL_TRUE.

Moving it to

if MYCONDITIONAL
OPTIONAL = lotsasource.c lotsayacc.y
else
OPTIONAL=
endif

foo_SOURCES = $(REGULAR) $(OPTIONAL)

didn't help; now I get three separate errors about am_foo_OBJECTS
already being defined in a condition implied by another one.

So I tried

OPTIONAL = lotsasource.c lotsayacc.y

if MYCONDITIONAL
foo_SOURCES = $(REGULAR) $(OPTIONAL)
else
foo_SOURCES = $(REGULAR)
endif

which didn't give any warnings, but am_foo_OBJECTS is empty :-(

What is the proper way of handling such a situation?
(If it's in the manual, please point me to the correct
chapter; a cursory examination revealed nothing much).




reply via email to

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