From: Richard Boulton Date: Mon, 18 Mar 2002 11:04:17 +0000 (+0000) Subject: Fix for PR automake/306: X-Git-Tag: branchpoint-1-6~26 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=ac731acb1c67ab436ba5bf4c2f307d239f4167b3;p=automake.git Fix for PR automake/306: * automake.texi (Generalities): Document +=. (Conditionals): Document limitations of += with conditionals. --- diff --git a/ChangeLog b/ChangeLog index 690ec1c3..f4ea9d79 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2002-03-18 Richard Boulton + + Fix for PR automake/306: + * automake.texi (Generalities): Document +=. + (Conditionals): Document limitations of += with conditionals. + 2002-03-17 Tom Tromey Fix for PR automake/295: diff --git a/automake.texi b/automake.texi index 5a6eb033..dcaeff5b 100644 --- a/automake.texi +++ b/automake.texi @@ -228,10 +228,20 @@ system. @cindex GNU make extensions -Note that GNU make extensions are not recognized by Automake. Using +Note that most GNU make extensions are not recognized by Automake. Using such extensions in a @file{Makefile.am} will lead to errors or confusing behavior. +@cindex Append operator +A special exception is that the GNU make append operator, @samp{+=}, is +supported. This operator appends its right hand argument to the macro +specified on the left. Automake will translate the operator into +an ordinary @samp{=} operator; @samp{+=} will thus work with any make program. + +Note that it is only valid to append to a macro in the same conditional +context as the macro was originally defined. @xref{Conditional Append}, for +more information. + Automake tries to group comments with adjoining targets and macro definitions in an intelligent way. @c FIXME: What does this imply practically? @@ -4372,6 +4382,30 @@ endif !DEBUG @noindent Unbalanced conditions are errors. +@anchor{Conditional Append} +Conditionals do not interact very smoothly with the append operator. +In particular, an append must happen in the same conditional context as +the original assignment. This means that the following will not work: + +@example +DBG = foo +if DEBUG +DBG += bar +endif DEBUG +@end example + +The behaviour which is probably desired in this situation can be obtained +using a temporary variable: + +@example +if DEBUG +TMP_DBG = bar +endif DEBUG +DBG = foo $(TMP_DBG) +@end example + +This restriction may be lifted in future versions of automake. + Note that conditionals in Automake are not the same as conditionals in GNU Make. Automake conditionals are checked at configure time by the @file{configure} script, and affect the translation from