automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Patch: PR 306


From: Richard Boulton
Subject: Patch: PR 306
Date: 18 Mar 2002 02:45:43 +0000

Attached is an attempt at documenting +=.

It's my first stab at writing .texi documentation, so please be gentle
if I've done it wrong. ;-)

-- 
Richard


Index: ChangeLog
===================================================================
RCS file: /cvs/automake/automake/ChangeLog,v
retrieving revision 1.1786
diff -u -r1.1786 ChangeLog
--- ChangeLog   2002/03/18 01:37:50     1.1786
+++ ChangeLog   2002/03/18 02:42:06
@@ -1,3 +1,9 @@
+Mon Mar 18 02:40:47 GMT 2002  Richard Boulton <address@hidden>
+
+       Fix for PR automake/306:
+       * automake.texi (Generalities): Document +=.
+       (Conditionals): Document limitations of += with conditionals.
+
 2002-03-17  Tom Tromey  <address@hidden>
 
        Fix for PR automake/295:
Index: automake.texi
===================================================================
RCS file: /cvs/automake/automake/automake.texi,v
retrieving revision 1.269
diff -u -r1.269 automake.texi
--- automake.texi       2002/03/18 01:37:52     1.269
+++ automake.texi       2002/03/18 02:42:18
@@ -228,10 +228,20 @@
 
 @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.
 
address@hidden 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?
@@ -4371,6 +4381,30 @@
 
 @noindent
 Unbalanced conditions are errors.
+
address@hidden 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:
+
address@hidden
+DBG = foo
+if DEBUG
+DBG += bar
+endif DEBUG
address@hidden example
+
+The behaviour which is probably desired in this situation can be obtained
+using a temporary variable:
+
address@hidden
+if DEBUG
+TMP_DBG = bar
+endif DEBUG
+DBG = foo $(TMP_DBG)
address@hidden 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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]