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).