]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
Bug and doc fixes
authorTom Tromey <tromey@redhat.com>
Tue, 5 Mar 1996 04:12:49 +0000 (04:12 +0000)
committerTom Tromey <tromey@redhat.com>
Tue, 5 Mar 1996 04:12:49 +0000 (04:12 +0000)
13 files changed:
ChangeLog
Makefile.in
NEWS
THANKS
TODO
automake.in
automake.texi
dist-vars.am
tests/ChangeLog
tests/Makefile.am
tests/Makefile.in
tests/exdir.test [new file with mode: 0755]
version.texi

index f539de5196b93f7e40be8b92ba07361f46a3cd22..37294696e8189b04b877fe295be6bddfa1788005 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+Mon Mar  4 19:30:24 1996  Tom Tromey  <tromey@creche.cygnus.com>
+
+       * automake.in (handle_lib_objects): New function.
+       (handle_libraries): Use it.
+       (handle_programs): Ditto.
+       (handle_dist_worker): Deprecate DIST_SUBDIRS.
+       (am_install_var): Allow extended directory mechanism to work.
+       Test exdir.test.
+
+       * dist-vars.am (DISTFILES): Use EXTRA_DIST.
+       (DEP_DISTFILES): Ditto.
+
+       * automake.in (OBJECT_PATTERN): New variable.
+       (am_install_var): Use it.
+       (handle_dist): DIST_OTHER is an anachronism.
+
 Sat Mar  2 14:04:38 1996  Tom Tromey  <tromey@creche.cygnus.com>
 
        * automake.in (handle_dist_worker): Only cause Automake to be
index 3bf4a1d0c12792ae5e508afdfa3332bdc1e967f3..9cf268b3b43823c99e60dbfe68aff180da7418aa 100644 (file)
@@ -93,9 +93,9 @@ PACKAGE = @PACKAGE@
 VERSION = @VERSION@
 
 DISTFILES = $(DIST_COMMON) $(SOURCES) $(BUILT_SOURCES) $(HEADERS) \
-       $(TEXINFOS) $(INFOS) $(MANS) $(DIST_OTHER) $(DATA)
+       $(TEXINFOS) $(INFOS) $(MANS) $(EXTRA_DIST) $(DATA)
 DEP_DISTFILES = $(DIST_COMMON) $(SOURCES) $(BUILT_SOURCES) $(HEADERS) \
-       $(TEXINFOS) $(INFO_DEPS) $(MANS) $(DIST_OTHER) $(DATA)
+       $(TEXINFOS) $(INFO_DEPS) $(MANS) $(EXTRA_DIST) $(DATA)
 default: all
 
 
diff --git a/NEWS b/NEWS
index f02b75c2a9495af85184a926aef7f8db2cc2a579..fcf1f372dd2998723bd193b4fc0e83f1864af598 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,9 +1,14 @@
 New in 0.31:
 * Bug fixes
-* Documentation updates from François Pinard
+* Documentation updates (many from François Pinard)
 * strictness `normal' now renamed to `foreign'
 * Renamed --install-missing to --add-missing
 * Now handles AC_CONFIG_AUX_DIR
+* Now handles TESTS macro
+* DIST_OTHER renamed to EXTRA_DIST
+* DIST_SUBDIRS is deprecated
+* @ALLOCA@ and @LIBOBJS@ now work in _LDADD variables
+* Better error messages in many cases
 \f
 New in 0.30:
 * Bug fixes
diff --git a/THANKS b/THANKS
index 5bce45e990624e1853b2392d71d30f4919173ff6..5a04ee42a1b9f8cde7d89541dfca9fac589057b8 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -8,6 +8,7 @@ Greg A. Woods <woods@most.weird.com>
 Henrik Frystyk Nielsen <frystyk@w3.org>
 Jerome Santini <santini@chambord.univ-orleans.fr>
 Jim Meyering <meyering@na-net.ornl.gov>
+Joerg-Martin Schwarz <jms@jms.prima.ruhr.de>
 Karl Berry <kb@cs.umb.edu>
 Markku Rossi <mtr@ngs.fi>
 Noah Friedman <friedman@gnu.ai.mit.edu>
diff --git a/TODO b/TODO
index 501f1cbe149e54d5e3fb9366d7b06c8d4217d622..df1ab47613b36d2ee94b08c9cdcff78bff0ad0c6 100644 (file)
--- a/TODO
+++ b/TODO
@@ -1,26 +1,6 @@
 Priorities for release:
-* Add prog_CFLAGS
 * test new error message scheme!
-
-François> * Do you speak somewhere of the capability Automake has to let
-François> the user overrides definitions and goals?  I think this is useful,
-François> at times.  I think the "When Automake Isn't Enough" node needs to
-François> be revisited, as it says false things.
-
-need to add chapter with examples of each kind of package
-
-François> * You might say a word about comment processing, double
-François> hash removing, and copying of a possible copyright block at
-François> beginning of Makefile.am.
--- this should be its own node
--- should include general comment on automake processing -- copy-through
--- include recommended order of macros
-
-François> * The manual should tell about the fact the automake program, when
-François> used for a single subdirectory, should be run from the top level,
-François> with something like an explicit DIR/Makefile argument.
-
-* look at ``'' issues in docs.  and look for 'definition' pragma
+* For 0.32: remove last mention of DIST_OTHER
 
 Other priorities:
 * Must rewrite am_install_var.  Should break into multiple functions.
@@ -54,9 +34,6 @@ Add support for html via an option.  Use texi2html.  Use
 distribution.  Also allow "html_DATA", for raw .html files.
   [ when will texinfo support html? ]
 
-if configure.in not found, move up a directory and try again?  This
-could eliminate a common source of problems.
-
 uninstall and pkg-dirs should rm -rf the dir.
 
 a potential bug: configure puts "blah.o" into LIBOBJS, thus implying
@@ -181,16 +158,18 @@ DIST_SUBDIRS   directories which are copied verbatim into the
                distribution.  Used eg for directories holding
                only example code (which don't have their own
                makefile).  This variable might be a bad idea.
+  [ should just require a new Makefile.am.  They are supposed to be
+    easy to write ]
 
 Document customary ordering of Makefile.am.  From François.
 
+must document that @ALLOCA@ works in _LDADD
+
 Must document BUILT_SOURCES variable.  See depend.am.
 
 Should include extended version of diagram from Autoconf (suggested by
 Greg Woods)
 
-must document check, install-info targets
-
 ================================================================
 
 Libraries:
@@ -209,6 +188,9 @@ Some examples to keep in mind while doing this:
 * readline
 * kpathsea
 
+Gord Matzigkeit is doing work on this issue, mostly from the Autoconf
+side of things.
+
 ================================================================
 
 Have a program that generates a Makefile on stdout, passes it through
@@ -217,7 +199,9 @@ other than the gee-whiz factor?
 
 Would it be useful to integrate in some way with the Debian package
 building utility?  Must check.  maybe it would be possible to deal
-with all the different package utilities somehow.
+with all the different package utilities somehow.  Lately I've been
+hearing good things about the RedHat packaging utilities.  Why are
+there so many of these?  Are they fun to write or something?
 
 ================================================================
 
@@ -248,3 +232,6 @@ consider auto-including any file that matches "*.in".
 must look at mkid to see how it works (for subdir usage)
   [ right now, it doesn't.  i don't see a simple fix right now ]
 
+if configure.in not found, move up a directory and try again?  This
+could eliminate a common source of problems.
+  [ this is just a bad idea ]
index 66c68e99a9c4e13727505ce31acaa45266afddbd..73d635a0198fae8d462607dd5387155f6bdd81c5 100755 (executable)
@@ -40,6 +40,9 @@ $COMMENT_PATTERN = "^#";
 $RULE_PATTERN = "^([a-zA-Z_.][-.a-zA-Z0-9_.]*) *:";
 $MACRO_PATTERN = "^([A-Za-z][A-Za-z0-9_]*)[ \t]*=[ \t]*(.*)\$";
 
+# Valid syntax for a derived object, eg a program name.  This must
+# satisfy both the filesystem and make.
+$OBJECT_PATTERN = "^[A-Za-z_][-+.A-Za-z_0-9]+\$";
 
 # Constants to define the "strictness" level.
 $FOREIGN = 0;
@@ -552,6 +555,46 @@ sub handle_source_transform
     return @result;
 }
 
+# Special-case @ALLOCA@ and @LIBOBJS@ in _LDADD or _LIBADD variables.
+sub handle_lib_objects
+{
+    local ($var) = @_;
+
+    die "programming error in handle_lib_objects"
+       if ! defined $contents{$var};
+
+    # We recognize certain things that are commonly put in LIBADD or
+    # LDADD.
+    local ($lsearch);
+
+    foreach $lsearch (split (/\s+/, $contents{$var}))
+    {
+       # Automatically handle @LIBOBJS@ and @ALLOCA@.  Basically this
+       # means adding entries to dep_files.
+       if ($lsearch eq '@LIBOBJS@')
+       {
+           local ($iter, $rewrite);
+           foreach $iter (keys %libsources)
+           {
+               if ($iter ne 'alloca.c')
+               {
+                   ($rewrite = $iter) =~ s/\.c$/.P/;
+                   $dep_files{'$(srcdir)/.deps/' . $rewrite} = 1;
+                   &require_file_with_line ($var, $FOREIGN, $iter);
+               }
+           }
+       }
+       elsif ($lsearch eq '@ALLOCA@')
+       {
+           &am_line_error ($var,
+                           "\@ALLOCA\@ seen but \`AC_FUNC_ALLOCA' not in \`configure.in'")
+               if ! defined $libsources{'alloca.c'};
+           $dep_files{'$(srcdir)/.deps/alloca.P'} = 1;
+           &require_file_with_line ($var, $FOREIGN, 'alloca.c');
+       }
+    }
+}
+
 # Handle C programs.
 sub handle_programs
 {
@@ -568,7 +611,11 @@ sub handle_programs
     {
        &handle_source_transform ($one_file, $obj);
 
-       if (! defined $contents{$one_file . "_LDADD"})
+       if (defined $contents{$one_file . "_LDADD"})
+       {
+           &handle_lib_objects ($one_file . '_LDADD');
+       }
+       else
        {
            # User didn't define prog_LDADD override.  So do it.
            $output_vars .= $one_file . '_LDADD = $(LDADD)' . "\n";
@@ -578,6 +625,9 @@ sub handle_programs
            &file_contents_with_transform ('s/\@PROGRAM\@/' . $one_file
                                           . '/go', 'program');
     }
+
+    &handle_lib_objects ('LDADD')
+       if defined $contents{'LDADD'};
 }
 
 # Handle libraries.
@@ -623,38 +673,7 @@ sub handle_libraries
     {
        if (defined $contents{$onelib . '_LIBADD'})
        {
-           # We recognize certain things that are commonly put in
-           # LIBADD.
-           local ($lsearch);
-
-           foreach $lsearch (split (/\s+/, $contents{$onelib . '_LIBADD'}))
-           {
-               # Automatically handle @LIBOBJS@ and @ALLOCA@.
-               # Basically this means adding entries to dep_files.
-               if ($lsearch eq '@LIBOBJS@')
-               {
-                   local ($iter, $rewrite);
-                   foreach $iter (keys %libsources)
-                   {
-                       if ($iter ne 'alloca.c')
-                       {
-                           ($rewrite = $iter) =~ s/\.c$/.P/;
-                           $dep_files{'$(srcdir)/.deps/' . $rewrite} = 1;
-                           &require_file_with_line ($onelib . '_LIBADD',
-                                                    $FOREIGN, $iter);
-                       }
-                   }
-               }
-               elsif ($lsearch eq '@ALLOCA@')
-               {
-                   &am_line_error ($onelib . '_LIBADD',
-                                   "\@ALLOCA\@ seen but \`AC_FUNC_ALLOCA' not in \`configure.in'")
-                       if ! defined $libsources{'alloca.c'};
-                   $dep_files{'$(srcdir)/.deps/alloca.P'} = 1;
-                   &require_file_with_line ($onelib . '_LIBADD', $FOREIGN,
-                                            'alloca.c');
-               }
-           }
+           &handle_lib_objects ($onelib . '_LIBADD');
        }
        else
        {
@@ -1041,6 +1060,9 @@ sub handle_dist_worker
     # is a hack which might go away.
     if (defined $contents{'DIST_SUBDIRS'})
     {
+       &am_line_error ('DIST_SUBDIRS',
+                       "\`DIST_SUBDIRS' is deprecated; make a new \`Makefile.am' instead");
+
        $output_rules .= '      @for dir in $(DIST_SUBDIRS); do         \\
          echo copying directory $$dir;         \\
          tar chf - $$dir | (cd $(distdir) && tar xBpf -); \\
@@ -1075,6 +1097,11 @@ sub handle_dist
     $maint_charset = $local_maint_charset
        if $relative_dir eq '.';
 
+    &am_line_error
+       ('DIST_OTHER',
+        "\`DIST_OTHER' is an anachronism; use \`EXTRA_DIST' instead")
+           if defined $contents{'DIST_OTHER'};
+
     if (defined $contents{'DIST_CHARSET'})
     {
        &am_line_error ('DIST_CHARSET',
@@ -2398,13 +2425,20 @@ sub am_install_var
            {
                &am_line_error ($varname, "invalid variable \"$varname\"");
            }
+           else
+           {
+               # Ensure all extended prefixes are actually used.
+               $valid{$1} = 1;
+           }
        }
     }
+    # We never want to examine EXTRA_blah.
+    undef $valid{'EXTRA'};
 
     local ($clean_file) = $file . '-clean';
     local ($one_name);
     local ($X);
-    foreach $X (@prefixes)
+    foreach $X (keys %valid)
     {
        $one_name = $X . '_' . $primary;
        if (defined $contents{$one_name})
@@ -2420,7 +2454,7 @@ sub am_install_var
                push (@result, $rcurs);
                &am_line_error ($one_name, "invalid object name \`$rcurs'")
                    if $primary_uses_subobjects{$primary}
-                       && $rcurs !~ /^[A-Za-z_][A-Za-z_0-9]+$/;
+                       && $rcurs !~ /$OBJECT_PATTERN/;
            }
 
            if ($do_clean)
index 0c9931a322e4ca15fe6b3bb9e9e8df108e29c4a4..31062907210c208b4639f58ce346374023985065 100644 (file)
@@ -114,7 +114,8 @@ documents version @value{VERSION}.
 * Miscellaneous::               Miscellaneous rules
 * Extending::                   Extending Automake
 * Distributing::                Distributing the Makefile.in
-* Future::                      Some ideas for the future.
+* Examples::                    Some example packages
+* Future::                      Some ideas for the future
 * Variables::                   Index of variables
 * Configure variables::         Index of configure variables and macros
 * Targets::                     Index of targets
@@ -168,7 +169,12 @@ and generate the corresponding @file{Makefile.in}.
 You can optionally give @code{automake} an argument; @samp{.am} is
 appended to the argument and the result is used as the name of the input
 file.  This feature is generally only used to automatically rebuild an
-out-of-date @file{Makefile.in}.
+out-of-date @file{Makefile.in}.  Note that @code{automake} must always
+be run from the topmost directory of a project, even if being used to
+regenerate the @file{Makefile.in} in some subdirectory.  This is
+necessary because @code{automake} must scan @file{configure.in}, and
+because @code{automake} uses the knowledge that a @file{Makefile.in} is
+in a subdirectory to change its behavior in some cases.
 
 @code{automake} accepts the following options:
 
@@ -198,7 +204,7 @@ see @ref{Dist}.
 @item --add-missing
 Automake requires certain common files to exist in certain situations;
 for instance @file{config.guess} is required if @file{configure.in} runs
-@samp{AC_CANONICAL_HOST}.  Automake is distributed with several of these
+@code{AC_CANONICAL_HOST}.  Automake is distributed with several of these
 files; this option will cause the missing ones to be automatically added
 to the package, whenever possible.
 
@@ -229,22 +235,23 @@ Print the version number of Automake and exit.
 @code{automake} supports three kinds of directory hierarchy: ``flat'',
 ``shallow'', and ``deep''.
 
-A flat package is one in which all the files are in a single directory.
-The @file{Makefile.am} for such a package by definition lacks a
-@samp{SUBDIRS} macro.  An example of such a package is @code{termutils}.
+A @dfn{flat} package is one in which all the files are in a single
+directory.  The @file{Makefile.am} for such a package by definition
+lacks a @code{SUBDIRS} macro.  An example of such a package is
+@code{termutils}.
 @vindex SUBDIRS
 
-A deep package is one in which all the source lies in subdirectories;
-the top level directory contains mainly configuration information.  GNU
-cpio is a good example of such a package, as is GNU @code{tar}.  The top
-level @file{Makefile.am} for a deep package will contain a
-@samp{SUBDIRS} macro, but no other macros to define objects which are
-built.
+A @dfn{deep} package is one in which all the source lies in
+subdirectories; the top level directory contains mainly configuration
+information.  GNU cpio is a good example of such a package, as is GNU
+@code{tar}.  The top level @file{Makefile.am} for a deep package will
+contain a @code{SUBDIRS} macro, but no other macros to define objects
+which are built.
 
-A shallow package is one in which the primary source resides in the
-top-level directory, while various parts (typically libraries) reside in
-subdirectories.  @code{automake} is one such package (as is GNU
-@code{make}, which does not currently use @code{automake}).
+A @dfn{shallow} package is one in which the primary source resides in
+the top-level directory, while various parts (typically libraries)
+reside in subdirectories.  @code{automake} is one such package (as is
+GNU @code{make}, which does not currently use @code{automake}).
 
 
 @section Strictness
@@ -252,7 +259,7 @@ While Automake is intended to be used by maintainers of GNU packages, it
 does make some effort to accomodate those who wish to use it, but do not
 want to use all the GNU conventions.
 
-To this end, Automake supports three levels of ``strictness'' -- the
+To this end, Automake supports three levels of @dfn{strictness} -- the
 strictness indicating how stringently Automake should check standards
 conformance.
 
@@ -287,8 +294,8 @@ and how they are installed.  This scheme also supports @code{configure}
 time determination of what should be built.
 
 At @code{make} time, certain variables are used to determine which
-objects are to be built.  These variables are called ``primary''
-variables.  For instance, the primary variable @samp{PROGRAMS} holds a
+objects are to be built.  These variables are called @dfn{primary}
+variables.  For instance, the primary variable @code{PROGRAMS} holds a
 list of programs which are to be compiled and linked.
 @vindex PROGRAMS
 
@@ -299,8 +306,8 @@ be used as the installation directory.  The standard directory names are
 given in the GNU standards
 (@pxref{Directory Variables, , , standards.info, The GNU Coding
 Standards}).
-@code{automake} extends this list with @samp{pkglibdir},
-@samp{pkgincludedir}, and @samp{pkgdatadir}; these are the same as the
+@code{automake} extends this list with @code{pkglibdir},
+@code{pkgincludedir}, and @code{pkgdatadir}; these are the same as the
 non-@samp{pkg} versions, but with @samp{@@PACKAGE@@} appended.
 @cvindex PACKAGE
 
@@ -312,8 +319,8 @@ must know the entire list of objects to be built in order to generate a
 @file{Makefile.in} that will work in all cases.
 
 For instance, @code{cpio} decides at configure time which programs are
-built.  Some of the programs are installed in @samp{bindir}, and some
-are installed in @samp{sbindir}:
+built.  Some of the programs are installed in @code{bindir}, and some
+are installed in @code{sbindir}:
 
 @example
 EXTRA_PROGRAMS = mt rmt
@@ -360,6 +367,35 @@ Possible primary names are @samp{PROGRAMS}, @samp{LIBRARIES},
 @vindex MANS
 @vindex TEXINFOS
 
+@section General Operation
+Automake essentially works by reading a @file{Makefile.am} and
+generating a @file{Makefile.in}.  The macro definitions and targets in
+the @file{Makefile.am} are copied into the generated file.
+
+Automake tries to group comments with adjoining targets (or variable
+definitions) in an intelligent way.
+
+A target defined in @file{Makefile.am} generally overrides any such
+target of a similar name that would be automatically generated by
+@code{automake}.  Although this is a supported feature, it is generally
+best to avoid making use of it, as sometimes the generated rules are
+very particular.
+
+Automake also allows a form of comment which is @emph{not} copied into
+the output; all lines beginning with @samp{##} are completely ignored by
+Automake.
+
+It is customary to make the first line of @file{Makefile.am} read:
+
+@example
+## Process this file with automake to produce Makefile.in
+@end example
+
+@c FIXME discuss putting a copyright into Makefile.am here?  I would but
+@c I don't know quite what to say.
+
+@c FIXME document customary ordering of Makefile.am here!
+
 
 @node configure
 @chapter Scanning @file{configure.in}
@@ -368,28 +404,28 @@ Automake requires certain variables to be defined and certain macros to
 be used in the package @file{configure.in}.
 
 One such requirement is that @file{configure.in} must define the
-variables @samp{PACKAGE} and @samp{VERSION} with @samp{AC_SUBST}.
+variables @code{PACKAGE} and @code{VERSION} with @code{AC_SUBST}.
 @cvindex PACKAGE
 @cvindex VERSION
-@samp{PACKAGE} should be the name of the package as it appears when
+@code{PACKAGE} should be the name of the package as it appears when
 bundled for distribution.  For instance, Automake definees
-@samp{PACKAGE} to be @samp{automake}.  @samp{VERSION} should be the
+@code{PACKAGE} to be @samp{automake}.  @code{VERSION} should be the
 version number of the release that is being developed.  We recommend
 that you make @file{configure.in} the only place in your package where
 the version number is defined; this makes releases simpler.
 
-Automake also requires the use of the macros @samp{AC_ARG_PROGRAM}
+Automake also requires the use of the macros @code{AC_ARG_PROGRAM}
 @cvindex AC_ARG_PROGRAM
 
 If your package is not a flat distribution, Automake requires the use of
-@samp{AC_PROG_MAKE_SET}.
+@code{AC_PROG_MAKE_SET}.
 @cvindex AC_PROG_MAKE_SET
 
 Automake will also recognize the use of certain macros and tailor the
 generated @file{Makefile.in} appropriately.  Currently recognized macros
 and their effects are:
 
-@table @samp
+@table @code
 @item AC_CONFIG_HEADER
 Automake will generate rules to automatically regenerate the config
 header.
@@ -401,7 +437,7 @@ Automake uses this to determine which files to create.
 
 @item AC_PATH_XTRA
 Automake will insert definitions for the variables defined by
-@samp{AC_PATH_XTRA} into each @file{Makefile.in} that builds a C program
+@code{AC_PATH_XTRA} into each @file{Makefile.in} that builds a C program
 or library.
 @cvindex AC_PATH_XTRA
 
@@ -429,8 +465,8 @@ information.
 @cvindex fp_FUNC_FNMATCH
 @cvindex AC_REPLACE_FUNCS
 
-Automake will also detect statements which put @file{.o} files into
-@samp{LIBOBJS}, and will treat these additional files in a similar way.
+Automake will also detect statements which put @samp{.o} files into
+@code{LIBOBJS}, and will treat these additional files in a similar way.
 @cvindex LIBOBJS
 
 @item AC_PROG_RANLIB
@@ -439,8 +475,8 @@ This is required if any libraries are built in the package.
 
 @item AC_PROG_INSTALL
 @item fp_PROG_INSTALL
-@samp{fp_PROG_INSTALL} is required if any scripts (@pxref{Scripts}) are
-installed by the package.  Otherwise, @samp{AC_PROG_INSTALL} is
+@code{fp_PROG_INSTALL} is required if any scripts (@pxref{Scripts}) are
+installed by the package.  Otherwise, @code{AC_PROG_INSTALL} is
 required.
 @cvindex AC_PROG_INSTALL
 @cvindex fp_PROG_INSTALL
@@ -456,7 +492,7 @@ the package meets some of gettext's requirements.
 @cvindex ud_GNU_GETTEXT
 @end table
 
-The ``fp_'' macros are from @value{Francois} Pinard, and are included
+The @samp{fp_} macros are from @value{Francois} Pinard, and are included
 with Automake.  @code{automake} will tell where the macros can be found
 if they are missing.
 
@@ -466,13 +502,13 @@ if they are missing.
 
 In non-flat packages, the top level @file{Makefile.am} must tell
 Automake which subdirectories are to be built.  This is done via the
-@samp{SUBDIRS} variable.
+@code{SUBDIRS} variable.
 @vindex SUBDIRS
 
-The @samp{SUBDIRS} macro holds a list of subdirectories in which
-building of various sorts can occur.  Many targets (eg @samp{all}) in
+The @code{SUBDIRS} macro holds a list of subdirectories in which
+building of various sorts can occur.  Many targets (eg @code{all}) in
 the generated @file{Makefile} will run both locally and in all specified
-subdirectories.  Note that the directories listed in @samp{SUBDIRS} are
+subdirectories.  Note that the directories listed in @code{SUBDIRS} are
 not required to contain @file{Makefile.am}s; only @file{Makefile}s
 (after configuration).  This allows inclusion of libraries from packages
 which do not use Automake (such as @code{gettext}).
@@ -483,13 +519,13 @@ distribution:
 
 @example
 SUBDIRS = lib src doc man
-DIST_OTHER = @@README_ALPHA@@
+EXTRA_DIST = @@README_ALPHA@@
 @end example
 
-@samp{SUBDIRS} can contain configure substitutions (eg @samp{@@DIRS@@});
+@code{SUBDIRS} can contain configure substitutions (eg @samp{@@DIRS@@});
 Automake itself does not actually examine the contents of this variable.
 
-If @samp{SUBDIRS} is defined, then your @file{configure.in} must include
+If @code{SUBDIRS} is defined, then your @file{configure.in} must include
 @code{AC_PROG_MAKE_SET}.
 
 
@@ -512,8 +548,8 @@ to build C programs and libraries.
 
 In a directory containing source that gets built into a program (as
 opposed to a library), the @samp{PROGRAMS} primary is used.  Programs
-can be installed in @samp{bindir}, @samp{sbindir}, @samp{libexecdir},
-@samp{pkglibdir}, or not at all.
+can be installed in @code{bindir}, @code{sbindir}, @code{libexecdir},
+@code{pkglibdir}, or not at all.
 
 For instance:
 
@@ -523,7 +559,7 @@ bin_PROGRAMS = hello
 
 In this simple case, the resulting @file{Makefile.in} will contain code
 to generate a program named @code{hello}.  The variable
-@samp{hello_SOURCES} is used to specify which source files get built
+@code{hello_SOURCES} is used to specify which source files get built
 into an executable:
 
 @example
@@ -534,18 +570,18 @@ This causes @file{hello.c} to be compiled into @file{hello.o}, and then
 linked to produce @file{hello}.
 
 If @samp{prog_SOURCES} is needed, but not specified, then it defaults to
-the single file @samp{prog.c}.  Id est In the example above, the
-definition of @samp{hello_SOURCES} is actually redundant.
+the single file @file{prog.c}.  Id est in the example above, the
+definition of @code{hello_SOURCES} is actually redundant.
 @vindex _SOURCES
 @vindex SOURCES
 
 Multiple programs can be built in a single directory.  Multiple programs
 can share a single source file.  The source file must be listed in each
-``_SOURCES'' definition.
+@samp{_SOURCES} definition.
 
-Header files listed in a ``_SOURCES'' definition will be ignored.  Lex
-(``.l'') and yacc (``.y'') files can also be listed; support for these
-should work but is still preliminary.
+Header files listed in a @samp{_SOURCES} definition will be ignored.
+Lex (@samp{.l}) and yacc (@samp{.y}) files can also be listed; support
+for these should work but is still preliminary.
 @c lex & yacc should have a separate section
 
 Sometimes it is useful to determine the programs that are to be built at
@@ -556,22 +592,22 @@ In this case, you must notify @code{Automake} of all the programs that
 can possibly be built, but at the same time cause the generated
 @file{Makefile.in} to use the programs specified by @code{configure}.
 This is done by having @code{configure} substitute values into each
-``_PROGRAMS'' definition, while listing all optionally built programs in
-@samp{EXTRA_PROGRAMS}.
+@samp{_PROGRAMS} definition, while listing all optionally built programs in
+@code{EXTRA_PROGRAMS}.
 @vindex EXTRA_PROGRAMS
 
 If you need to link against libraries that are not found by
-@code{configure}, you can use @samp{LDADD} to do so.  This variable
+@code{configure}, you can use @code{LDADD} to do so.  This variable
 actually can be used to add any options to the linker command line.
 @vindex LDADD
 
 Sometimes, multiple programs are built in one directory but do not share
 the same link-time requirements.  In this case, you can use the
 @samp{@var{prog}_LDADD} variable (where @var{PROG} is the name of the
-program as it appears in some ``_PROGRAMS'' variable, and usually
-written in lowercase) to override the global @samp{LDADD}.  (If this
+program as it appears in some @samp{_PROGRAMS} variable, and usually
+written in lowercase) to override the global @code{LDADD}.  (If this
 variable exists for a given program, then that program is not linked
-using @samp{LDADD}.)
+using @code{LDADD}.)
 @vindex _LDADD
 
 For instance, in GNU cpio, @code{pax}, @code{cpio}, and @code{mt} are
@@ -600,9 +636,9 @@ rmt_SOURCES = @dots{}
 
 Building a library is much like building a program.  In this case, the
 name of the primary is @samp{LIBRARIES}.  Libraries can be installed in
-@samp{libdir} or @samp{pkglibdir}.
+@code{libdir} or @code{pkglibdir}.
 
-Each @samp{where_LIBRARIES} variable is a list of the base names of
+Each @samp{_LIBRARIES} variable is a list of the base names of
 libraries to be built.  For instance to create a library named
 @file{libcpio.a}, but not install it, you would write:
 
@@ -611,9 +647,9 @@ noinst_LIBRARIES = cpio
 @end example
 
 The sources that go into a library are determined exactly as they are
-for programs, via the ``_SOURCES'' variables.  Note that programs and
-libraries share a namespace, so one cannot have a program (``lob'') and
-a library (``liblob.a'') with the same name in one directory.
+for programs, via the @samp{_SOURCES} variables.  Note that programs and
+libraries share a namespace, so one cannot have a program (@file{lob}) and
+a library (@file{liblob.a}) with the same name in one directory.
 
 Extra objects can be added to a library using the @samp{library_LIBADD}
 variable.  This should be used for objects determined by
@@ -625,9 +661,9 @@ variable.  This should be used for objects determined by
 cpio_LIBADD = @@LIBOBJS@@ @@ALLOCA@@
 @end example
 
-Note that Automake explicitly recognizes the use of @samp{@@LIBOBJS@@}
-and @samp{@@ALLOCA@@} in the above example, and uses this information,
-plus the list of @samp{LIBOBJS} files derived from @file{configure.in}
+Note that Automake explicitly recognizes the use of @code{@@LIBOBJS@@}
+and @code{@@ALLOCA@@} in the above example, and uses this information,
+plus the list of @code{LIBOBJS} files derived from @file{configure.in}
 to automatically include the appropriate source files in the
 distribution (@pxref{Dist}).  These source files are also automatically
 handled in the dependency-tracking scheme, see @xref{Dependencies}.
@@ -640,9 +676,9 @@ Although the GNU standards prohibit it, some GNU programs are written in
 ANSI C; see FIXME.  This is possible because each source file can be
 ``de-ANSI-fied'' before the actual compilation takes place.
 
-If the @file{Makefile.am} variable @samp{AUTOMAKE_OPTIONS}
+If the @file{Makefile.am} variable @code{AUTOMAKE_OPTIONS}
 @vindex AUTOMAKE_OPTIONS
-(@ref{Options}) contains the option @samp{ansi2knr}
+(@ref{Options}) contains the option @code{ansi2knr}
 @opindex ansi2knr
 then code to handle de-ANSI-fication is inserted into the generated
 @file{Makefile.in}.
@@ -654,7 +690,7 @@ This support requires the source files @file{ansi2knr.c} and
 @file{ansi2knr.1} to be in the same directory as the ANSI C source;
 these files are distributed with Automake.
 Also, the package @file{configure.in} must call the macro
-@samp{fp_C_PROTOTYPES}.
+@code{fp_C_PROTOTYPES}.
 @cvindex fp_C_PROTOTYPES
 
 
@@ -674,7 +710,7 @@ different dependency generating program, if there is enough demand.
 This mode is enabled by default if any C program or library is defined
 in the current directory.
 
-When you decide to make a distribution, the @samp{dist} target will
+When you decide to make a distribution, the @code{dist} target will
 @trindex dist
 re-run @code{automake} with the @samp{--include-deps} option.  This
 @c FIXME XREF?
@@ -683,8 +719,8 @@ generated @file{Makefile.in}, and thus into the distribution.
 @samp{--include-deps} also turns off inclusion of the dependency
 generation code.
 
-This mode can be suppressed by putting @samp{no-dependencies} in the
-variable @samp{AUTOMAKE_OPTIONS}.
+This mode can be suppressed by putting @code{no-dependencies} in the
+variable @code{AUTOMAKE_OPTIONS}.
 @vindex AUTOMAKE_OPTIONS
 @opindex no-dependencies
 
@@ -724,18 +760,18 @@ from @file{automake.in}.  Here is how this is handled:
 bin_SCRIPTS = automake
 @end example
 
-Since @code{automake} appears in the @samp{AC_OUTPUT} macro,
+Since @code{automake} appears in the @code{AC_OUTPUT} macro,
 dependencies for it are automatically generated.
 
-Script objects can be installed in @samp{bindir}, @samp{sbindir},
-@samp{libexecdir}, or @samp{pkgdatadir}.
+Script objects can be installed in @code{bindir}, @code{sbindir},
+@code{libexecdir}, or @code{pkgdatadir}.
 
 
 @node Headers
 @section Header files
 
 Header files are specified by the @samp{HEADERS} family of variables.
-Generally header files are not installed, so the @samp{noinst_HEADERS}
+Generally header files are not installed, so the @code{noinst_HEADERS}
 variable will be the most used.
 @vindex HEADERS
 
@@ -789,26 +825,26 @@ Currently Automake provides support for Texinfo and man pages.
 
 If the current directory contains Texinfo source, you must declare it
 with the @samp{TEXINFOS} primary.  Generally Texinfo files are converted
-into info, and thus the @samp{info_TEXINFOS} macro is most commonly used
-here.  Note that any Texinfo source file must end in the @file{.texi}
-extension (@file{.texinfo} won't work).
+into info, and thus the @code{info_TEXINFOS} macro is most commonly used
+here.  Note that any Texinfo source file must end in the @samp{.texi}
+extension (@samp{.texinfo} won't work).
 @vindex TEXINFOS
 @vindex info_TEXINFOS
 
-If the @file{.texi} file ``@@include''s @file{version.texi}, then that
+If the @samp{.texi} file @code{@@include}s @file{version.texi}, then that
 file will be automatically generated.  @file{version.texi} defines three
-Texinfo macros you can reference: @samp{EDITION}, @samp{VERSION}, and
-@samp{UPDATED}.  The first two hold the version number of your package
+Texinfo macros you can reference: @code{EDITION}, @code{VERSION}, and
+@code{UPDATED}.  The first two hold the version number of your package
 (but are kept separate for clarity); the last is the date the primary
 file was last modified.  The @file{version.texi} support requires the
 @code{mdate-sh} program; this program is supplied with Automake.
 
-Sometimes an info file actually depends on more than one @file{.texi}
-file.  For instance, in the @samp{xdvik} distribution,
+Sometimes an info file actually depends on more than one @samp{.texi}
+file.  For instance, in the @code{xdvik} distribution,
 @file{kpathsea.texi} includes the files @file{install.texi},
 @file{copying.texi}, and @file{freedom.texi}.  You can tell Automake
 about these dependencies using the @samp{texi_TEXINFOS} variable.  Here
-is how @samp{xdvik} could do it:
+is how @code{xdvik} could do it:
 @vindex TEXINFOS
 @vindex _TEXINFOS
 
@@ -821,6 +857,9 @@ Automake will warn if a directory containing Texinfo source does not
 also contain the file @file{texinfo.tex}.  This file is supplied with
 Automake.
 
+Automake generates an @code{install-info} target; some people apparently
+use this.
+
 
 @node Man pages
 @section Man pages
@@ -828,18 +867,19 @@ Automake.
 A package can also include man pages.  (Though see the GNU standards on
 this matter, @ref{Man Pages, , , standards.info, The GNU Coding
 Standards}.)  Man pages are declared using the @samp{MANS} primary.
-Generally the @samp{man_MANS} macro is used.  Man pages are
+Generally the @code{man_MANS} macro is used.  Man pages are
 automatically installed in the correct subdirectory of @code{mandir},
 based on the file extension.
 @vindex MANS
 @vindex man_MANS
 
-By default, man pages are installed by @code{make install}.  However,
+@c Use @samp{make install} per documentation: (texi.info)code.
+By default, man pages are installed by @samp{make install}.  However,
 since the GNU project does not require man pages, many maintainers do
 not expend effort to keep the man pages up to date.  In these cases, the
-@samp{no-installman} option will prevent the man pages from being
+@code{no-installman} option will prevent the man pages from being
 installed by default.  The user can still explicitly install them via
-@code{make install-man}.
+@samp{make install-man}.
 @opindex no-installman
 @trindex install-man
 
@@ -851,8 +891,8 @@ info_TEXINFOS = cpio.texi
 man_MANS = cpio.1 mt.1
 @end example
 
-Texinfo source, info pages and man pages are all considered to be
-``source'' for the purposes of making a distribution.
+Texinfo source, info pages and man pages are all considered to be source
+for the purposes of making a distribution.
 
 
 @node Install
@@ -865,23 +905,23 @@ installed in the appropriate places.
 
 Automake also handles installing any specified info and man pages.
 
-Automake generates separate @samp{install-data} and @samp{install-exec}
+Automake generates separate @code{install-data} and @code{install-exec}
 targets, in case the installer is installing on multiple machines which
 share directory structure -- these targets allow the machine-independent
-parts to be installed only once.  The @samp{install} target depends on
+parts to be installed only once.  The @code{install} target depends on
 both of these targets.
 @trindex install-data
 @trindex install-exec
 @trindex install
 
-Automake also generates an @samp{uninstall} target, and an
-@samp{installdirs} target.
+Automake also generates an @code{uninstall} target, and an
+@code{installdirs} target.
 @trindex uninstall
 @trindex installdirs
 
 It is possible to extend this mechanism by defining an
-@samp{install-exec-local} or @samp{install-data-local} target.  If these
-targets exist, they will be run at @code{make install} time.
+@code{install-exec-local} or @code{install-data-local} target.  If these
+targets exist, they will be run at @samp{make install} time.
 @trindex install-exec-local
 @trindex install-data-local
 
@@ -894,8 +934,8 @@ The GNU Makefile Standards specify a number of different clean rules.
 Generally the files that can cleaned are determined automatically by
 Automake.  Of course, Automake also recognizes some variables that can
 be defined to specify additional files to clean.  These variables are
-@samp{MOSTLYCLEANFILES}, @samp{CLEANFILES}, @samp{DISTCLEANFILES}, and
-@samp{MAINTAINERCLEANFILES}.
+@code{MOSTLYCLEANFILES}, @code{CLEANFILES}, @code{DISTCLEANFILES}, and
+@code{MAINTAINERCLEANFILES}.
 @vindex MOSTLYCLEANFILES
 @vindex CLEANFILES
 @vindex DISTCLEANFILES
@@ -903,7 +943,7 @@ be defined to specify additional files to clean.  These variables are
 
 In Automake, the @code{automake} program is not automatically removed,
 because it is an executable script.  So this code in @file{Makefile.am}
-causes it to be removed by @code{make clean}:
+causes it to be removed by @samp{make clean}:
 
 @example
 CLEANFILES = automake
@@ -913,7 +953,7 @@ CLEANFILES = automake
 @node Dist
 @chapter What Goes in a Distribution
 
-The @samp{dist} target in the generated @file{Makefile.in} can be used
+The @code{dist} target in the generated @file{Makefile.in} can be used
 to generate a gzip'd @code{tar} file for distribution.  The tar file is
 named based on the @var{PACKAGE} and @var{VERSION} variables.
 @cvindex PACKAGE
@@ -925,26 +965,26 @@ Automake: all source files are automatically included in a distribution,
 as are all @file{Makefile.am}s and @file{Makefile.in}s.  Automake also
 has a built-in list of commonly used files which, if present in the
 current directory, are automatically included.  This list is printed by
-@code{automake --help}.  Also, files which are read by @code{configure}
+@samp{automake --help}.  Also, files which are read by @code{configure}
 (ie, the source files corresponding to the files specified in the
-@samp{AC_OUTPUT} invocation) are automatically distributed.
+@code{AC_OUTPUT} invocation) are automatically distributed.
 
 Still, sometimes there are files which must be distributed, but which
 are not covered in the automatic rules.  These files should be listed in
-the @samp{DIST_OTHER} variable.
-@vindex DIST_OTHER
+the @code{EXTRA_DIST} variable.
+@vindex EXTRA_DIST
 
 
 @node Tests
 @chapter Support for test suites
 
 Automake supports a simple form of test suite.  If the variable
-@samp{TESTS} is defined, its value is taken to be a list of programs to
+@code{TESTS} is defined, its value is taken to be a list of programs to
 run in order to do the testing.  The programs can either be derived
 objects or source objects; the generated rule will look both in
 @var{srcdir} and @file{.}.
 
-The testing is done via @code{make check}.  The number of failures will
+The testing is done via @samp{make check}.  The number of failures will
 be printed at the end of the run.
 
 In the future there will be some support for test suites which use
@@ -956,28 +996,28 @@ In the future there will be some support for test suites which use
 
 Various features of Automake can be controlled by options in the
 @file{Makefile.am}.  Such options are listed in a special variable named
-@samp{AUTOMAKE_OPTIONS}.  Currently understood options are:
+@code{AUTOMAKE_OPTIONS}.  Currently understood options are:
 @vindex AUTOMAKE_OPTIONS
 
 @table @asis
-@item @samp{gnits}
-@itemx @samp{gnu}
-@itemx @samp{foreign}
+@item @code{gnits}
+@itemx @code{gnu}
+@itemx @code{foreign}
 The same as the corresponding @samp{--strictness} option.
 
-@item @samp{no-installman}
+@item @code{no-installman}
 The generated @file{Makefile.in} will not cause man pages to be
-installed by default.  However, an @samp{install-man} target will still
+installed by default.  However, an @code{install-man} target will still
 be available for optional installation.
 
-@item @samp{ansi2knr}
+@item @code{ansi2knr}
 Turn on automatic de-ANSI-fication.
 
-@item @samp{dist-shar}
-Generate a @samp{dist-shar} target as well as the ordinary @samp{dist}
+@item @code{dist-shar}
+Generate a @code{dist-shar} target as well as the ordinary @code{dist}
 target.
 
-@item @samp{no-dependencies}
+@item @code{no-dependencies}
 This is similar to using @samp{--include-deps} on the command line, but
 is useful for those situations where you don't have the necessary bits
 to make automatic dependency tracking work @xref{Dependencies}.  In this
@@ -1010,16 +1050,16 @@ There are a few rules and variables that didn't fit anywhere else.
 @code{automake} will generate rules to generate @file{TAGS} files for
 use with GNU Emacs under some circumstances.
 
-If any C source code or headers are present, then a @samp{tags} target
+If any C source code or headers are present, then a @code{tags} target
 will be generated for the directory.
 @trindex tags
 
-At the topmost directory of a multi-directory package, a @samp{tags}
+At the topmost directory of a multi-directory package, a @code{tags}
 target file will be generated which, when run, will generate a
 @file{TAGS} file that includes by reference all @file{TAGS} files from
 subdirectories.
 
-Also, if the variable @samp{ETAGS_ARGS} is defined, a @samp{tags} target
+Also, if the variable @code{ETAGS_ARGS} is defined, a @code{tags} target
 will be generated.  This variable is intended for use in directories
 which contain taggable source that @code{etags} does not understand.
 
@@ -1031,7 +1071,7 @@ ETAGS_ARGS = automake.in --lang=none \
  --regex='/^@@node[ \t]+\([^,]+\)/\1/' automake.texi
 @end example
 
-Automake will also generate an @samp{id} target which will run
+Automake will also generate an @code{ID} target which will run
 @code{mkid} on the source.  This is only supported on a
 directory-by-directory basis.
 @trindex id
@@ -1043,7 +1083,7 @@ directory-by-directory basis.
 It is sometimes useful to introduce a new implicit rule to handle a file
 type that Automake does not know about.  If this is done, you must
 notify GNU Make of the new suffixes.  This can be done by putting a list
-of new suffixes in the @samp{SUFFIXES} variable.
+of new suffixes in the @code{SUFFIXES} variable.
 @vindex SUFFIXES
 
 
@@ -1066,13 +1106,13 @@ additions.
 There are some caveats to doing this.  Although you can overload a
 target already used by @code{automake}, it is often inadvisable,
 particularly in the topmost directory of a non-flat package.  However,
-various useful targets have a ``-local'' version you can specify in your
+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.
 
-The targets that support a local version are @samp{all}, @samp{info},
-@samp{dvi}, @samp{check}, @samp{install-data}, @samp{install-exec}, and
-@samp{uninstall}.
+The targets that support a local version are @code{all}, @code{info},
+@code{dvi}, @code{check}, @code{install-data}, @code{install-exec}, and
+@code{uninstall}.
 @trindex all
 @trindex info
 @trindex dvi
@@ -1105,6 +1145,299 @@ Some of the files that can be automatically installed via the
 to see.
 
 
+@node Examples
+@chapter Some example packages
+
+Here are some examples of how Automake can be used.
+
+@menu
+* Hello::                       The simplest GNU program
+* Tricky::                      A trickier example
+* Automake::                    Automake's own use
+* Textutils::                   A deep hierarchy
+@end menu
+
+@node Hello
+@section The simplest GNU program
+
+@code{hello} is renowned for its classic simplicity and versatility.
+What better place to begin a tour?  The below shows what could be used
+as the Hello distribution's @file{Makefile.am}.
+
+@example
+bin_PROGRAMS = hello
+hello_SOURCES = hello.c version.c getopt.c getopt1.c getopt.h
+hello_LDADD = @@ALLOCA@@
+info_TEXINFOS = hello.texi
+hello_TEXINFOS = gpl.texi
+
+EXTRA_DIST = testdata
+
+check-local: hello
+        @@echo expect no output from diff
+        ./hello > test.out
+        diff -c $(srcdir)/testdata test.out
+        rm -f test.out
+@end example
+
+Of course, Automake also requires some minor changes to
+@file{configure.in}.  The new @file{configure.in} would read:
+
+@example
+dnl Process this file with autoconf to produce a configure script.
+AC_INIT(hello.c)
+VERSION=1.3
+AC_SUBST(VERSION)
+PACKAGE=hello
+AC_SUBST(PACKAGE)
+AC_PROG_CC
+AC_PROG_CPP
+AC_PROG_INSTALL
+AC_STDC_HEADERS
+AC_HAVE_HEADERS(string.h fcntl.h sys/file.h)
+AC_ALLOCA
+AC_OUTPUT(Makefile)
+@end example
+
+If Hello were really going to use Automake, the @file{version.c} file
+would probably be deleted, or changed so as to be automatically
+generated.
+
+
+@node Tricky
+@section A tricker example
+
+Here is another, trickier example.  It shows how to generate two
+programs (@code{ctags} and @code{etags}) from the same source file
+(@file{etags.c}).  The difficult part is that each compilation of
+@file{etags.c} requires different @code{cpp} flags.
+
+@example
+bin_PROGRAMS = etags ctags
+ctags_SOURCES =
+ctags_LDADD = ctags.o
+
+etags.o:
+        $(COMPILE) -DETAGS_REGEXPS etags.c
+
+ctags.o:
+        $(COMPILE) -DCTAGS -o ctags.o etags.c
+@end example
+
+Note that @code{ctags_SOURCES} is defined to be empty -- that way no
+implicit value is substituted.  The implicit value, however, is used to
+generate @code{etags} from @file{etags.o}.
+
+
+@node Automake
+@section Automake uses itself
+
+Automake, of course, uses itself to generate its @file{Makefile.in}.
+Since Automake is a shallow package, it has more than one
+@file{Makefile.am}.  Here is the top-level @file{Makefile.am}:
+
+@example
+## Process this file with automake to create Makefile.in
+
+AUTOMAKE_OPTIONS = gnits
+MAINT_CHARSET = latin1
+PERL = @@PERL@@
+
+SUBDIRS = tests
+
+bin_SCRIPTS = automake
+info_TEXINFOS = automake.texi
+
+pkgdata_DATA = clean-kr.am clean.am compile-kr.am compile-vars.am \
+compile.am data.am depend.am \
+dist-vars.am footer.am header.am header-vars.am \
+kr-vars.am libraries-vars.am \
+libraries.am library.am mans-vars.am \
+program.am programs.am remake-hdr.am \
+remake-subd.am remake.am scripts.am subdirs.am tags.am tags-subd.am \
+tags-clean.am \
+texi-version.am texinfos-vars.am texinfos.am \
+libraries-clean.am programs-clean.am data-clean.am \
+COPYING INSTALL texinfo.tex \
+ansi2knr.c ansi2knr.1 \
+aclocal.m4
+
+## These must all be executable when installed.
+pkgdata_SCRIPTS = config.guess config.sub install-sh mdate-sh mkinstalldirs
+
+CLEANFILES = automake
+
+# The following requires a fixed version of the Emacs 19.30 etags.
+ETAGS_ARGS = automake.in --lang=none \
+ --regex='/^@@node[ \t]+\([^,]+\)/\1/' automake.texi
+
+## `test -x' is not portable.  So we use Perl instead.  If Perl
+## doesn't exist, then this test is meaningless anyway.
+# Check to make sure some installed files are executable.
+installcheck-local:
+       $(PERL) -e "exit ! -x '$(pkgdatadir)/config.guess';"
+       $(PERL) -e "exit ! -x '$(pkgdatadir)/config.sub';"
+       $(PERL) -e "exit ! -x '$(pkgdatadir)/install-sh';"
+       $(PERL) -e "exit ! -x '$(pkgdatadir)/mdate-sh';"
+       $(PERL) -e "exit ! -x '$(pkgdatadir)/mkinstalldirs';"
+
+# Some simple checks:
+# * syntax check with perl4 and perl5.
+# * make sure the scripts don't use 'true'
+# * expect no instances of '$@{...@}'
+# These are only really guaranteed to work on my machine.
+maintainer-check: automake check
+       $(PERL) -c -w automake
+       @@if grep '^[^#].*true' $(srcdir)/[a-z]*.am; then \
+         echo "can't use 'true' in GNU Makefile" 1>&2; \
+         exit 1;                               \
+       else :; fi
+       @@if test `fgrep '$$@{' $(srcdir)/[a-z]*.am | wc -l` -ne 0; then \
+         echo "found too many uses of '\$$@{'" 1>&2; \
+         exit 1;                               \
+       fi
+       if $(SHELL) -c 'perl4.036 -v' >/dev/null 2>&1; then \
+         perl4.036 -c -w automake; \
+       else :; fi
+
+# Tag before making distribution.  Also, don't make a distribution if
+# checks fail.  Also, make sure the NEWS file is up-to-date.
+cvs-dist: maintainer-check
+       @@if sed 1q NEWS | grep -e "$(VERSION)" > /dev/null; then :; else \
+         echo "NEWS not updated; not releasing" 1>&2; \
+         exit 1;                               \
+       fi
+       cvs tag `echo "Release-$(VERSION)" | sed 's/\./-/g'`
+       $(MAKE) dist
+@end example
+
+As you can see, Automake defines many of its own rules, to make the
+maintainer's job easier.  For instance the @code{cvs-dist} rule
+automatically tags the current version in the CVS repository, and then
+makes a standard distribution.
+
+Automake consists primarily of one program, @code{automake}, and a
+number of auxiliary scripts.  Automake also installs a number of
+programs which are possibly installed via the @samp{--add-missing}
+option; these scripts are listed in the @code{pkgdata_SCRIPTS} variable.
+
+Automake also has a @file{tests} subdirectory, as indicated in the
+@code{SUBDIRS} variable above.  Here is @file{tests/Makefile.am}:
+
+@example
+## Process this file with automake to create Makefile.in
+
+AUTOMAKE_OPTIONS = gnits
+
+TESTS = mdate.test vtexi.test acoutput.test instexec.test checkall.test \
+acoutnoq.test acouttbs.test libobj.test proginst.test acoutqnl.test \
+confincl.test spelling.test prefix.test badprog.test depend.test
+
+EXTRA_DIST = defs
+@end example
+
+This is where all the tests are really run.  @file{defs} is an
+initialization file used by each test script; it is explicitly mentioned
+because @code{automake} has no way of automatically finding it.
+
+
+@node Textutils
+@section A deep hierarchy
+
+The GNU textutils are a collection of programs for manipulating text
+files.  They are distributed as a deep package.  The textutils have only
+recently been modified to use Automake; the examples come from a
+prerelease.
+
+Here is the top-level @file{Makefile.am}:
+
+@example
+SUBDIRS = lib src doc man
+@end example
+
+In the @file{lib} directory, a library is built which is used by each
+textutil.  Here is @file{lib/Makefile.am}:
+
+@example
+noinst_LIBRARIES = tu
+
+EXTRA_DIST = rx.c regex.c
+
+tu_SOURCES = error.h getline.h getopt.h linebuffer.h \
+long-options.h md5.h regex.h rx.h xstrtod.h xstrtol.h xstrtoul.h \
+error.c full-write.c getline.c getopt.c getopt1.c \
+linebuffer.c long-options.c md5.c memchr.c safe-read.c \
+xmalloc.c xstrtod.c xstrtol.c xstrtoul.c
+
+tu_LIBADD = @@REGEXOBJ@@ @@LIBOBJS@@ @@ALLOCA@@
+@end example
+
+The @file{src} directory contains the source for all the textutils -- 23
+programs in all.  The @file{Makefile.am} for this directory also
+includes some simple checking code, and constructs a @file{version.c}
+file on the fly:
+
+@example
+bin_PROGRAMS = cat cksum comm csplit cut expand fmt fold head join md5sum \
+nl od paste pr sort split sum tac tail tr unexpand uniq wc
+
+noinst_HEADERS = system.h version.h
+DISTCLEANFILES = stamp-v version.c
+
+INCLUDES = -I$(top_srcdir)/lib
+
+LDADD = version.o ../lib/libtu.a
+
+$(PROGRAMS): version.o ../lib/libtu.a
+
+AUTOMAKE_OPTIONS = ansi2knr
+
+version.c: stamp-v
+stamp-v: Makefile
+       rm -f t-version.c
+       echo '#include <config.h>' > t-version.c
+       echo '#include "version.h"' >> t-version.c
+       echo 'const char *version_string = "'GNU @@PACKAGE@@ @@VERSION@@'";' \
+               >> t-version.c
+       if cmp -s version.c t-version.c; then   \
+         rm t-version.c;                       \
+       else                                    \
+         mv t-version.c version.c;             \
+       fi
+       echo timestamp > $@@
+
+check: md5sum
+       ./md5sum \
+        --string="" \
+        --string="a" \
+        --string="abc" \
+        --string="message digest" \
+        --string="abcdefghijklmnopqrstuvwxyz" \
+        --string="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" \
+        --string="12345678901234567890123456789012345678901234567890123456789012345678901234567890" \
+       | diff -c $(srcdir)/md5-test.rfc -
+@end example
+
+The @file{doc} directory builds the info documentation for the
+textutils:
+
+@example
+info_TEXINFOS = textutils.texi
+@end example
+
+And, last, the @file{man} directory installs the man pages for all the
+textutils:
+
+@example
+man_MANS = cat.1 cksum.1 comm.1 csplit.1 cut.1 expand.1 fmt.1 fold.1 head.1 \
+join.1 md5sum.1 nl.1 od.1 paste.1 pr.1 sort.1 split.1 sum.1 tac.1 tail.1 \
+tr.1 unexpand.1 uniq.1 wc.1
+@end example
+
+You can now see how easy it is to handle even a largish project using
+Automake.
+
+
 @node Future
 @chapter Some ideas for the future
 
@@ -1137,6 +1470,7 @@ convenient locally, but for all distributions to be Unicode or
 
 @printindex cv
 
+
 @node Targets
 @unnumbered Index of Targets
 
index b3fc251306d171fe8891e96a06b3ba23fec8e07c..69013afd7dd0038f4c8b73406871c014635e920c 100644 (file)
@@ -20,7 +20,7 @@ VERSION = @VERSION@
 
 ## DIST_COMMON comes first so that README can be the very first file.
 DISTFILES = $(DIST_COMMON) $(SOURCES) $(BUILT_SOURCES) $(HEADERS) \
-       $(TEXINFOS) $(INFOS) $(MANS) $(DIST_OTHER) $(DATA)
+       $(TEXINFOS) $(INFOS) $(MANS) $(EXTRA_DIST) $(DATA)
 ## Like DISTFILES, but look at INFO_DEPS, not INFOS.
 DEP_DISTFILES = $(DIST_COMMON) $(SOURCES) $(BUILT_SOURCES) $(HEADERS) \
-       $(TEXINFOS) $(INFO_DEPS) $(MANS) $(DIST_OTHER) $(DATA)
+       $(TEXINFOS) $(INFO_DEPS) $(MANS) $(EXTRA_DIST) $(DATA)
index 0bce77c82d0b4e2fd575d27d5152e36c3e673ee0..205487c8840c91effc5466985c5c3e092cb234cb 100644 (file)
@@ -1,3 +1,7 @@
+Mon Mar  4 21:08:37 1996  Tom Tromey  <tromey@creche.cygnus.com>
+
+       * exdir.test: New file.
+
 Fri Mar  1 17:23:53 1996  Tom Tromey  <tromey@creche.cygnus.com>
 
        * depend.test: New file.
index e40098d8988018508ec02f26d0083881b060edc8..f36f32218c351fd666d9f0706e511c1dfca294dd 100644 (file)
@@ -2,10 +2,8 @@
 
 AUTOMAKE_OPTIONS = gnits
 
-## FIXME Ulrich has suggested implementing this in Automake.
-## Perhaps he is right.
 TESTS = mdate.test vtexi.test acoutput.test instexec.test checkall.test \
 acoutnoq.test acouttbs.test libobj.test proginst.test acoutqnl.test \
-confincl.test spelling.test prefix.test badprog.test depend.test
+confincl.test spelling.test prefix.test badprog.test depend.test exdir.test
 
-DIST_OTHER = defs
+EXTRA_DIST = defs
index bb8eeb3e37b3ee32d9abdb421aaae430de8c1145..9f0d76b87821cfb74620bba4766b1967b649d5fa 100644 (file)
@@ -42,9 +42,9 @@ AUTOMAKE_OPTIONS = gnits
 
 TESTS = mdate.test vtexi.test acoutput.test instexec.test checkall.test \
 acoutnoq.test acouttbs.test libobj.test proginst.test acoutqnl.test \
-confincl.test spelling.test prefix.test badprog.test depend.test
+confincl.test spelling.test prefix.test badprog.test depend.test exdir.test
 
-DIST_OTHER = defs
+EXTRA_DIST = defs
 DIST_COMMON = ChangeLog Makefile.am Makefile.in
 
 
@@ -52,9 +52,9 @@ PACKAGE = @PACKAGE@
 VERSION = @VERSION@
 
 DISTFILES = $(DIST_COMMON) $(SOURCES) $(BUILT_SOURCES) $(HEADERS) \
-       $(TEXINFOS) $(INFOS) $(MANS) $(DIST_OTHER) $(DATA)
+       $(TEXINFOS) $(INFOS) $(MANS) $(EXTRA_DIST) $(DATA)
 DEP_DISTFILES = $(DIST_COMMON) $(SOURCES) $(BUILT_SOURCES) $(HEADERS) \
-       $(TEXINFOS) $(INFO_DEPS) $(MANS) $(DIST_OTHER) $(DATA)
+       $(TEXINFOS) $(INFO_DEPS) $(MANS) $(EXTRA_DIST) $(DATA)
 default: all
 
 
diff --git a/tests/exdir.test b/tests/exdir.test
new file mode 100755 (executable)
index 0000000..dd438e5
--- /dev/null
@@ -0,0 +1,15 @@
+#! /bin/sh
+
+# Check to make sure new extended directory mechanism works.
+
+. $srcdir/defs || exit 1
+
+cat > Makefile.am << 'EOF'
+htmldir = $(prefix)/html
+html_DATA = zot.html
+pkgdata_DATA = qbert
+EOF
+
+$AUTOMAKE || exit 1
+
+grep ^DATA Makefile.in | grep html
index 796c3690557f17f1c01c916a4b86393ad50ad3d7..c1545599b2fae0ed2aa2f78d5a62559dc3dce9cb 100644 (file)
@@ -1,3 +1,3 @@
-@set UPDATED 2 March 1996
+@set UPDATED 4 March 1996
 @set EDITION 0.31
 @set VERSION 0.31