This is the mail archive of the automake@gnu.org mailing list for the automake project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Conditionals in Makefile.am


>>> "Pekka" == Pekka Riikonen <priikone@iki.fi> writes:

[...]

 Pekka> FILES = 		\
 Pekka> somefile.c	\
 Pekka> if HAVE_SOMETHING
 Pekka> someotherfile.c	\
 Pekka> endif
 Pekka> if HAVE_SOMETHING_ELSE
 Pekka> somethingelse.c	\
 Pekka> endif
 Pekka> something.c

 Pekka> This sort of thing is not possible now and makes it
 Pekka> really ugly to use the conditionals in makefiles, imo.
 Pekka> Currently only way to do this is to conditionalize the
 Pekka> entire FILES variable.  Alternatively it could just
 Pekka> remove the lines not to be included.

Sorry, I forgot to reply to this.  A simpler solution is to use
a sub-variable.

FILES = somefile.c $(FILES_IF_SOMETHING) $(FILES_IF_SOMETHING_ELSE) something.c
if HAVE_SOMETHING
FILES_IF_SOMETHING = someotherfile.c
endif
if HAVE_SOMETHING_ELSE
FILES_IF_SOMETHING_ELSE = somethingelse.c
endif


[...]
-- 
Alexandre Duret-Lutz




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]