]> sourceware.org Git - automake.git/commitdiff
Fix for PR automake/306:
authorRichard Boulton <richard@tartarus.org>
Mon, 18 Mar 2002 11:04:17 +0000 (11:04 +0000)
committerRichard Boulton <richard@tartarus.org>
Mon, 18 Mar 2002 11:04:17 +0000 (11:04 +0000)
* automake.texi (Generalities): Document +=.
(Conditionals): Document limitations of += with conditionals.

ChangeLog
automake.texi

index 690ec1c3f3e78f2e753984371c4fadb3c7640126..f4ea9d790d6bd90607aed39f276ad301806fabdd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2002-03-18  Richard Boulton <richard@tartarus.org>
+
+       Fix for PR automake/306:
+       * automake.texi (Generalities): Document +=.
+       (Conditionals): Document limitations of += with conditionals.
+
 2002-03-17  Tom Tromey  <tromey@redhat.com>
 
        Fix for PR automake/295:
index 5a6eb033c0bf213238f49929eaed209ed5cb7559..dcaeff5b107ed8a60eb30947a7990025c26e4a85 100644 (file)
@@ -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
This page took 0.044719 seconds and 5 git commands to generate.