]> sourceware.org Git - automake.git/commitdiff
* doc/automake.texi (Extending): Elaborate on overriding.
authorAlexandre Duret-Lutz <adl@gnu.org>
Tue, 25 Nov 2003 21:48:24 +0000 (21:48 +0000)
committerAlexandre Duret-Lutz <adl@gnu.org>
Tue, 25 Nov 2003 21:48:24 +0000 (21:48 +0000)
* NEWS: Likewise.
Suggested by Bruno Haible.

ChangeLog
NEWS
doc/automake.texi
doc/stamp-vti
doc/version.texi

index 06b4d745e0e11d1cf2f367e46045dff03568d03f..e9f30fd34233a824f49f96d9ab4705ea65a7e630 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2003-11-25  Alexandre Duret-Lutz  <adl@gnu.org>
+
+       * doc/automake.texi (Extending): Elaborate on overriding.
+       * NEWS: Likewise.
+       Suggested by Bruno Haible.
+
 2003-11-24  Alexandre Duret-Lutz  <adl@gnu.org>
 
        * lib/Automake/Variable.pm (output): Add $(am__empty) to variable
diff --git a/NEWS b/NEWS
index fabd8d8741c972e1b3e21fada6cfd0fe7181107d..9fe9e3e4689a0a4d67e35930545d01e7e58c3198 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -209,6 +209,38 @@ New in 1.7e:
   - Fix ylwrap so that it does not overwrite header files that haven't
     changed, as the inline rule already does.
 
+  - User-defined rules override automake-defined rules for the same
+    targets, even when rules do not have commands.  This is not new
+    (and was documented), however some of the automake-generated
+    rules have escaped this principle in former Automake versions.
+    Rules for the following targets are affected by this fix:
+
+       clean, clean-am, dist-all, distclean, distclean-am, dvi, dvi-am,
+       info, info-am, install-data-am, install-exec-am, install-info,
+       install-info-am, install-man, installcheck-am, maintainer-clean,
+       maintainer-clean-am, mostlyclean, mostlyclean-am, pdf, pdf-am,
+       ps, ps-am, uninstall-am, uninstall-info, uninstall-man
+
+    Practically it means that an attempt to supplement the dependencies
+    of some target, as in
+
+       clean: my-clean-rule
+
+    will now *silently override* the automake definition of the
+    rule for this target.  Running `automake -Woverride' will diagnose
+    all such overriding definitions.
+
+    It should be noted that almost all these targets support a *-local
+    variant that is meant to supplement the automake-defined rule
+    (See node `Extending' in the manual).  The above rule should
+    be rewritten as
+
+      clean-local: my-clean-rule
+
+    These *-local targets have been documented since at least
+    Automake 1.2, so you should not fear the change if you have
+    to support multiple automake versions.
+
 * Miscellaneous
 
   - The Automake manual is now distributed under the terms of the GNU FDL.
index 4606a643277049195db79352826888e434cc8ee2..e8b0ba2cf0a716542d32a2bf2734ec069ff16dd0 100644 (file)
@@ -5948,19 +5948,55 @@ removed.
 @node Extending
 @chapter When Automake Isn't Enough
 
-Automake's implicit copying semantics means that many problems can be
-worked around by simply adding some @code{make} targets and rules to
-@file{Makefile.in}.  Automake will ignore these additions.
+With some minor exceptions (like @code{_PROGRAMS} variables being
+rewritten to append @code{$(EXEEXT)}), the contents of a
+@file{Makefile.am} is copied to @file{Makefile.in} verbatim.
+
+@cindex copying semantics
+
+These copying semantics means that many problems can be worked around
+by simply adding some @code{make} variables and rules to
+@file{Makefile.am}.  Automake will ignore these additions.
+
+@cindex conflicting definitions
+@cindex rules, conflicting
+@cindex variables, conflicting
+@cindex definitions, conflicts
+
+Since a @file{Makefile.in} is built from data gathered from three
+different places (@file{Makefile.am}, @file{configure.ac}, and
+@command{automake} itself), it is possible to have conflicting
+definitions of rules or variables.  When building @file{Makefile.in}
+the following priorities are respected by @command{automake} to ensure
+the user always have the last word.  User defined variables in
+@file{Makefile.am} have priority over variables @code{AC_SUBST}ed from
+@file{configure.ac}, and @code{AC_SUBST}ed variables have priority
+over @command{automake}-defined variables.  As far rules are
+concerned, a user-defined rule overrides any
+@command{automake}-defined rule for the same target.
+
+@cindex overriding rules
+@cindex overriding semantics
+@cindex rules, overriding
+
+These overriding semantics make it possible to fine tune some default
+settings of Automake, or replace some of its rules.  Overriding
+Automake rules is often inadvisable, particularly in the topmost
+directory of a package with subdirectories.  The @code{-Woverride}
+option (@pxref{Invoking Automake}) comes handy to catch overridden
+definitions.
+
+Note that Automake does not make any difference between rules with
+commands and rules that only specify dependencies.  So it is not
+possible to append new dependencies to an @code{automake}-defined
+target without redefining the entire rule.
 
 @cindex -local targets
 @cindex local targets
 
-There are some caveats to doing this.  Although you can overload a
-target already used by Automake, it is often inadvisable, particularly
-in the topmost directory of a package with subdirectories.  However,
-various useful targets have a @samp{-local} version you can specify in
-your @file{Makefile.in}.  Automake will supplement the standard target
-with these user-supplied targets.
+However, various useful targets have a @samp{-local} version you can
+specify in your @file{Makefile.in}.  Automake will supplement the
+standard target with these user-supplied targets.
 
 @trindex  all
 @trindex  all-local
index 756386eb4017be51c5e0a8f3f4d6b79ea7ca46e9..a4042ba934ef10efeb1074d6c0e66d255d6c938d 100644 (file)
@@ -1,4 +1,4 @@
-@set UPDATED 11 November 2003
+@set UPDATED 25 November 2003
 @set UPDATED-MONTH November 2003
 @set EDITION 1.7e
 @set VERSION 1.7e
index 756386eb4017be51c5e0a8f3f4d6b79ea7ca46e9..a4042ba934ef10efeb1074d6c0e66d255d6c938d 100644 (file)
@@ -1,4 +1,4 @@
-@set UPDATED 11 November 2003
+@set UPDATED 25 November 2003
 @set UPDATED-MONTH November 2003
 @set EDITION 1.7e
 @set VERSION 1.7e
This page took 0.041767 seconds and 5 git commands to generate.