automake: Limits of Conditionals
1
1 20.2 Limits of Conditionals
1 ===========================
1
1 Conditionals should enclose complete statements like variables or rules
1 definitions. Automake cannot deal with conditionals used inside a
1 variable definition, for instance, and is not even able to diagnose this
1 situation. The following example would not work:
1
1 # This syntax is not understood by Automake
1 AM_CPPFLAGS = \
1 -DFEATURE_A \
1 if WANT_DEBUG
1 -DDEBUG \
1 endif
1 -DFEATURE_B
1
1 However the intended definition of ‘AM_CPPFLAGS’ can be achieved with
1
1 if WANT_DEBUG
1 DEBUGFLAGS = -DDEBUG
1 endif
1 AM_CPPFLAGS = -DFEATURE_A $(DEBUGFLAGS) -DFEATURE_B
1
1 or
1
1 AM_CPPFLAGS = -DFEATURE_A
1 if WANT_DEBUG
1 AM_CPPFLAGS += -DDEBUG
1 endif
1 AM_CPPFLAGS += -DFEATURE_B
1
1 More details and examples of conditionals are described alongside
DONTPRINTYET 11 various Automake features in this manual (⇒Conditional
Subdirectories, ⇒Conditional Sources, *noteConditional
DONTPRINTYET 1DONTPRINTYET 11 various Automake features in this manual (⇒Conditional
Subdirectories, ⇒Conditional Sources, ⇒Conditional
Programs, ⇒Conditional Libtool Libraries, *noteConditional
1DONTPRINTYET 1DONTPRINTYET 11 various Automake features in this manual (⇒Conditional
Subdirectories, ⇒Conditional Sources, ⇒Conditional
Programs, ⇒Conditional Libtool Libraries, ⇒Conditional
Libtool Sources).
1