fixlet
[automake.git] / automake.texi
bloba20ee721263dd04365aa5f0f858dfba1142e541a
1 \input texinfo   @c -*-texinfo-*-
2 @c %**start of header
3 @setfilename automake.info
4 @settitle automake
5 @setchapternewpage off
6 @c %**end of header
8 @include version.texi
10 @c Yes, this appears in many Texinfo files.  He's just a likeable guy.
11 @ifinfo
12 @set Francois Franc,ois
13 @end ifinfo
14 @tex
15 @set Francois Fran\noexpand\ptexc cois
16 @end tex
18 @ifinfo
19 @format
20 START-INFO-DIR-ENTRY
21 * automake: (automake).         Making Makefile.in's
22 END-INFO-DIR-ENTRY
23 @end format
24 @end ifinfo
26 @ifinfo
27 This file documents GNU automake @value{VERSION}
29 Copyright (C) 1995 Free Software Foundation, Inc.
31 Permission is granted to make and distribute verbatim copies of
32 this manual provided the copyright notice and this permission notice
33 are preserved on all copies.
35 @ignore
36 Permission is granted to process this file through TeX and print the
37 results, provided the printed document carries copying permission
38 notice identical to this one except for the removal of this paragraph
41 @end ignore
42 Permission is granted to copy and distribute modified versions of this
43 manual under the conditions for verbatim copying, provided that the entire
44 resulting derived work is distributed under the terms of a permission
45 notice identical to this one.
47 Permission is granted to copy and distribute translations of this manual
48 into another language, under the above conditions for modified versions,
49 except that this permission notice may be stated in a translation approved
50 by the Foundation.
51 @end ifinfo
54 @titlepage
55 @title GNU Automake
56 @subtitle For version @value{VERSION}, @value{UPDATED}
57 @c copyright page
58 @page
59 @vskip 0pt plus 1filll
60 Copyright @copyright{} 1995 Free Software Foundation, Inc.
61 @sp 2
62 This is the first edition of the GNU Automake documentation,@*
63 and is consistent with GNU Automake @value{VERSION}.@*
64 @sp 2
65 Published by the Free Software Foundation @*
66 59 Template Place - Suite 330, @*
67 Boston, MA 02111-1307 USA @*
69 Permission is granted to make and distribute verbatim copies of
70 this manual provided the copyright notice and this permission notice
71 are preserved on all copies.
73 Permission is granted to copy and distribute modified versions of this
74 manual under the conditions for verbatim copying, provided that the entire
75 resulting derived work is distributed under the terms of a permission
76 notice identical to this one.
78 Permission is granted to copy and distribute translations of this manual
79 into another language, under the above conditions for modified versions,
80 except that this permission notice may be stated in a translation
81 approved by the Free Software Foundation.
82 @end titlepage
84 @c Define an index of configure variables.
85 @defcodeindex cv
86 @c Define an index of options.
87 @defcodeindex op
88 @c Define an index of targets.
89 @defcodeindex tr
91 @ifinfo
92 @node Top, Introduction, (dir), (dir)
93 @comment  node-name,  next,  previous,  up
94 @top GNU Automake
96 This file documents the GNU Automake package for creating GNU
97 Standards-compliant Makefiles from template files.  This edition
98 documents version @value{VERSION}.
100 @menu
101 * Introduction::                Automake's purpose
102 * Invoking Automake::           Creating a Makefile.in
103 * Generalities::                General ideas
104 * configure::                   Scanning configure.in
105 * Top level::                   The top-level Makefile.am
106 * Programs::                    Building programs and libraries
107 * Other objects::               Other derived objects
108 * Other GNU Tools::             Other GNU Tools
109 * Documentation::               Building documentation
110 * Install::                     What gets installed
111 * Clean::                       What gets cleaned
112 * Dist::                        What goes in a distribution
113 * Tests::                       Support for test suites
114 * Options::                     Changing Automake's behavior
115 * Miscellaneous::               Miscellaneous rules
116 * Gnits::                       The effect of --gnu and --gnits
117 * Extending::                   Extending Automake
118 * Distributing::                Distributing the Makefile.in
119 * Examples::                    Some example packages
120 * Future::                      Some ideas for the future
121 * Variables::                   Index of variables
122 * Configure variables::         Index of configure variables and macros
123 * Targets::                     Index of targets
124 @end menu
126 @end ifinfo
128 @node Introduction
129 @chapter Introduction
131 Automake is a tool for automatically generating
132 @file{Makefile.in}s from files called @file{Makefile.am}.  The
133 @file{Makefile.am} is basically a series of @code{make} macro
134 definitions (with rules being thrown in occasionally).  The generated
135 @file{Makefile.in}s are compliant with the GNU Makefile standards.
137 The GNU Makefile Standards Document
138 (@pxref{Makefile Conventions, , , standards.info, The GNU Coding Standards})
139 is long, complicated, and subject to change.  The goal of Automake is to
140 remove the burden of Makefile maintenance from the back of the
141 individual GNU maintainer (and put it on the back of the Automake
142 maintainer).
144 The typical Automake input files is simply a series of macro
145 definitions.  Each such file is processed to create a
146 @file{Makefile.in}.  There should generally be one @file{Makefile.am}
147 per directory of a project.
149 Automake does constrain a project in certain ways; for instance it
150 assumes that the project uses Autoconf
151 (@pxref{Top, , The Autoconf Manual, autoconf.info, The Autoconf Manual}),
152 and enforces certain restrictions on the @file{configure.in} contents.
154 @code{Automake} requires @code{perl} in order to generate the
155 @file{Makefile.in}s.  However, the distributions created by Automake are
156 fully GNU standards-compliant, and do not require @code{perl} in order
157 to be built.
159 Mail suggestions and bug reports for Automake to
160 bug-gnu-utils@@prep.ai.mit.edu.
163 @node Invoking Automake
164 @chapter Creating a @file{Makefile.in}
166 To create all the @file{Makefile.in}s for a package, run the
167 @code{automake} program in the top level directory, with no arguments.
168 @code{automake} will automatically find each appropriate
169 @file{Makefile.am} (by scanning @file{configure.in}; @pxref{configure})
170 and generate the corresponding @file{Makefile.in}.
172 You can optionally give @code{automake} an argument; @samp{.am} is
173 appended to the argument and the result is used as the name of the input
174 file.  This feature is generally only used to automatically rebuild an
175 out-of-date @file{Makefile.in}.  Note that @code{automake} must always
176 be run from the topmost directory of a project, even if being used to
177 regenerate the @file{Makefile.in} in some subdirectory.  This is
178 necessary because @code{automake} must scan @file{configure.in}, and
179 because @code{automake} uses the knowledge that a @file{Makefile.in} is
180 in a subdirectory to change its behavior in some cases.
182 @code{automake} accepts the following options:
184 @table @code
185 @item -a
186 @item --add-missing
187 Automake requires certain common files to exist in certain situations;
188 for instance @file{config.guess} is required if @file{configure.in} runs
189 @code{AC_CANONICAL_HOST}.  Automake is distributed with several of these
190 files; this option will cause the missing ones to be automatically added
191 to the package, whenever possible.  In general if Automake tells you a
192 file is missing, try using this option.
194 @item --amdir=@var{dir}
195 Look for Automake data files in directory @var{dir} instead of in the
196 installation directory.  This is typically used for debugging.
198 @item --build-dir=@var{dir}
199 Tell Automake where the build directory is.  This option is used when
200 including dependencies into a @file{Makefile.in} generated by @code{make
201 dist}; it should not be used otherwise.
203 @item --foreign
204 An alias for @samp{--strictness=foreign}.
206 @item --gnits
207 An alias for @samp{--strictness=gnits}.
209 @item --gnu
210 An alias for @samp{--strictness=gnu}.
212 @item --help
213 Print a summary of the command line options and exit.
215 @item -i
216 @item --include-deps
217 Include all automatically generated dependency information
218 (@pxref{Dependencies}) in the generated
219 @file{Makefile.in}.  This is generally done when making a distribution;
220 see @ref{Dist}.
222 @item -o @var{dir}
223 @item --output-dir=@var{dir}
224 Put the generated @file{Makefile.in} in the directory @var{dir}.
225 Ordinarily each @file{Makefile.in} is created in the directory of the
226 corresponding @file{Makefile.am}.  This option is used when making
227 distributions.
229 @item --srcdir-name=@var{dir}
230 Tell Automake the name of the source directory used in the current
231 build.  This option is used when including dependencies into a
232 @file{Makefile.in} generated by @code{make dist}; it should not be used
233 otherwise.
235 @item -s @var{level}
236 @item --strictness=@var{level}
237 Set the global strictness to @var{level}; this can be overridden in each
238 @file{Makefile.am} if required.  @xref{Generalities} for more
239 information.
241 @item -v
242 @item --verbose
243 Cause Automake to print information about which files are being read or
244 created.
246 @item --version
247 Print the version number of Automake and exit.
248 @end table
251 @node Generalities
252 @chapter General ideas
254 There are a few basic ideas that will help understand how Automake
255 works.
257 @menu
258 * General Operation::           General operation of Automake
259 * Depth::                       The kinds of packages
260 * Strictness::                  Standards conformance checking
261 * Uniform::                     The Uniform Naming Scheme
262 * Canonicalization::            How derived variables are named
263 @end menu
265 @node General Operation
266 @section General Operation
268 Automake essentially works by reading a @file{Makefile.am} and
269 generating a @file{Makefile.in}.
271 The macro definitions and targets in the @file{Makefile.am} are copied
272 into the generated file.  This allows you to add essentially arbitrary
273 code into the generated @file{Makefile.in}.  For instance the Automake
274 distribution includes a non-standard @code{cvs-dist} target, which the
275 Automake maintainer uses to make distributions from his source control
276 system.
278 Note that GNU make extensions are not recognized by Automake.  Using
279 such extensions in a @file{Makefile.am} will lead to errors or confusing
280 behavior.
282 Automake tries to group comments with adjoining targets (or variable
283 definitions) in an intelligent way.
285 A target defined in @file{Makefile.am} generally overrides any such
286 target of a similar name that would be automatically generated by
287 @code{automake}.  Although this is a supported feature, it is generally
288 best to avoid making use of it, as sometimes the generated rules are
289 very particular.
291 When examining a variable definition, Automake will recursively examine
292 variables referenced in the definition.  Eg if Automake is looking at
293 the content of @samp{foo_SOURCES} in this snippet
295 @example
296 xs = a.c b.c
297 foo_SOURCES = c.c $(xs)
298 @end example
300 it would use the files @file{a.c}, @file{b.c}, and @file{c.c} as the
301 contents of @samp{foo_SOURCES}.
303 Automake also allows a form of comment which is @emph{not} copied into
304 the output; all lines beginning with @samp{##} are completely ignored by
305 Automake.
307 It is customary to make the first line of @file{Makefile.am} read:
309 @example
310 ## Process this file with automake to produce Makefile.in
311 @end example
313 @c FIXME discuss putting a copyright into Makefile.am here?  I would but
314 @c I don't know quite what to say.
316 @c FIXME document customary ordering of Makefile.am here!
320 @node Depth
321 @section Depth
322 @code{automake} supports three kinds of directory hierarchy: ``flat'',
323 ``shallow'', and ``deep''.
325 A @dfn{flat} package is one in which all the files are in a single
326 directory.  The @file{Makefile.am} for such a package by definition
327 lacks a @code{SUBDIRS} macro.  An example of such a package is
328 @code{termutils}.
329 @vindex SUBDIRS
331 A @dfn{deep} package is one in which all the source lies in
332 subdirectories; the top level directory contains mainly configuration
333 information.  GNU cpio is a good example of such a package, as is GNU
334 @code{tar}.  The top level @file{Makefile.am} for a deep package will
335 contain a @code{SUBDIRS} macro, but no other macros to define objects
336 which are built.
338 A @dfn{shallow} package is one in which the primary source resides in
339 the top-level directory, while various parts (typically libraries)
340 reside in subdirectories.  @code{automake} is one such package (as is
341 GNU @code{make}, which does not currently use @code{automake}).
344 @node Strictness
345 @section Strictness
346 While Automake is intended to be used by maintainers of GNU packages, it
347 does make some effort to accommodate those who wish to use it, but do
348 not want to use all the GNU conventions.
350 To this end, Automake supports three levels of @dfn{strictness} -- the
351 strictness indicating how stringently Automake should check standards
352 conformance.
354 The valid strictness levels are:
356 @table @samp
357 @item foreign
358 Automake will check for only those things which are absolutely
359 required for proper operations.  For instance, whereas GNU standards
360 dictate the existence of a @file{NEWS} file, it will not be required in
361 this mode.  The name comes from the fact that Automake is intended to be
362 used for GNU programs; these relaxed rules are not the standard mode of
363 operation.
365 @item gnu
366 Automake will check -- as much as possible -- for compliance to the GNU
367 standards for packages.  This is the default.
369 @item gnits
370 Automake will check for compliance to the as-yet-unwritten GNITS
371 standards.  These are based on the GNU standards, but are even more
372 detailed.  Unless you are a GNITS standards contributor, it is
373 recommended that you avoid this option until such time as the GNITS
374 standard is actually published.
375 @end table
377 For more information on the precise implications of the strictness
378 level, see @xref{Gnits}.
381 @node Uniform
382 @section The Uniform Naming Scheme
383 Automake variables generally follow a uniform naming scheme that makes
384 it easy to decide how programs (and other derived objects) are built,
385 and how they are installed.  This scheme also supports @code{configure}
386 time determination of what should be built.
388 At @code{make} time, certain variables are used to determine which
389 objects are to be built.  These variables are called @dfn{primary}
390 variables.  For instance, the primary variable @code{PROGRAMS} holds a
391 list of programs which are to be compiled and linked.
392 @vindex PROGRAMS
394 A different set of variables is used to decide where the built objects
395 should be installed.  These variables are named after the primary
396 variables, but have a prefix indicating which standard directory should
397 be used as the installation directory.  The standard directory names are
398 given in the GNU standards
399 (@pxref{Directory Variables, , , standards.info, The GNU Coding
400 Standards}).
401 @code{automake} extends this list with @code{pkglibdir},
402 @code{pkgincludedir}, and @code{pkgdatadir}; these are the same as the
403 non-@samp{pkg} versions, but with @samp{@@PACKAGE@@} appended.
404 @cvindex PACKAGE
406 For each primary, there is one additional variable named by prepending
407 @samp{EXTRA_} to the primary name.  This variable is used to list
408 objects which may or may not be built, depending on what
409 @code{configure} decides.  This variable is required because Automake
410 must know the entire list of objects to be built in order to generate a
411 @file{Makefile.in} that will work in all cases.
413 For instance, @code{cpio} decides at configure time which programs are
414 built.  Some of the programs are installed in @code{bindir}, and some
415 are installed in @code{sbindir}:
417 @example
418 EXTRA_PROGRAMS = mt rmt
419 bin_PROGRAMS = cpio pax
420 sbin_PROGRAMS = @@PROGRAMS@@
421 @end example
423 Defining a primary variable is an error.
425 Note that the common @samp{dir} suffix is left off when constructing the
426 variable names; thus one writes @samp{bin_PROGRAMS} and not
427 @samp{bindir_PROGRAMS}.
429 Not every sort of object can be installed in every directory.  Automake
430 will flag those attempts it finds in error.  Automake will also diagnose
431 obvious misspellings in directory names.
433 Sometimes the standard directories -- even as augmented by Automake --
434 are not enough.  In particular it is sometimes useful, for clarity, to
435 install objects in a subdirectory of some predefined directory.  To this
436 end, Automake allows you to extend the list of possible installation
437 directories.  A given prefix (eg @samp{zar}) is valid if a variable of
438 the same name with @samp{dir} appended is defined (eg @samp{zardir}).
440 For instance, until HTML support is part of Automake, you could use this
441 to install raw HTML documentation:
443 @example
444 htmldir = $(prefix)/html
445 html_DATA = automake.html
446 @end example
448 The special prefix @samp{noinst} indicates that the objects in question
449 should not be installed at all.
451 The special prefix @samp{check} indicates that the objects in question
452 should not be built until the @code{make check} command is run.
454 Possible primary names are @samp{PROGRAMS}, @samp{LIBRARIES},
455 @samp{LISP}, @samp{SCRIPTS}, @samp{DATA}, @samp{HEADERS}, @samp{MANS},
456 and @samp{TEXINFOS}.
457 @vindex PROGRAMS
458 @vindex LIBRARIES
459 @vindex LISP
460 @vindex SCRIPTS
461 @vindex DATA
462 @vindex HEADERS
463 @vindex MANS
464 @vindex TEXINFOS
467 @node Canonicalization
468 @section How derived variables are named
470 Sometimes a Makefile variable name is derived from some text the user
471 supplies.  For instance program names are rewritten into Makefile macro
472 names.  Automake canonicalizes this text, so that it does not have to
473 follow Makefile variable naming rules.  All characters in the name
474 except for letters, numbers, and the underscore are turned into
475 underscores when making macro references.  Eg, if your program is named
476 @code{sniff-glue}, the derived variable name would be
477 @code{sniff_glue_SOURCES}, not @code{sniff-glue_SOURCES}.
480 @node configure
481 @chapter Scanning @file{configure.in}
483 Automake scans the package's @file{configure.in} to determine certain
484 information about the package.  Some @code{autoconf} macros are required
485 and some variables must be defined in @file{configure.in}.  Automake
486 will also use information from @file{configure.in} to further tailor its
487 output.
489 @menu
490 * Requirements::                Configuration requirements
491 * Optional::                    Other things Automake recognizes
492 * Invoking aclocal::            Auto-generating aclocal.m4
493 * Macros::                      Autoconf macros supplied with Automake
494 * Extending aclocal::           Writing your own aclocal macros
495 @end menu
498 @node Requirements
499 @section Configuration requirements
501 The simplest way to meet the basic Automake requirements is to use the
502 macro @code{AM_INIT_AUTOMAKE} (FIXME: xref).  But if you prefer, you can
503 do the required steps by hand:
504 @cvindex AM_INIT_AUTOMAKE
506 @itemize @bullet
507 @item
508 Define the variables @code{PACKAGE} and @code{VERSION} with
509 @code{AC_SUBST}.
510 @cvindex PACKAGE
511 @cvindex VERSION
512 @code{PACKAGE} should be the name of the package as it appears when
513 bundled for distribution.  For instance, Automake defines @code{PACKAGE}
514 to be @samp{automake}.  @code{VERSION} should be the version number of
515 the release that is being developed.  We recommend that you make
516 @file{configure.in} the only place in your package where the version
517 number is defined; this makes releases simpler.
519 Automake doesn't do any interpretation of @code{PACKAGE} or
520 @code{VERSION}, except in @samp{Gnits} mode (FIXME xref).
522 @item
523 Use the macro @code{AC_ARG_PROGRAM} if a program or script is installed.
524 @cvindex AC_ARG_PROGRAM
526 @item
527 Use @code{AC_PROG_MAKE_SET} if the package is not flat.
528 @cvindex AC_PROG_MAKE_SET
530 @item
531 Use @code{AM_PROG_INSTALL} if any scripts (@pxref{Scripts}) are
532 installed by the package.  Otherwise, use @code{AC_PROG_INSTALL}.
533 @cvindex AC_PROG_INSTALL
534 @cvindex AM_PROG_INSTALL
535 @end itemize
538 Here are the other macros which Automake requires but which are not run
539 by @code{AM_INIT_AUTOMAKE}:
541 @table @code
542 @item AC_OUTPUT
543 Automake uses this to determine which files to create.  Listed files
544 named @code{Makefile} are treated as @file{Makefile}s.  Other listed
545 files are treated differently.  Currently the only difference is that a
546 @file{Makefile} is removed by @code{make distclean}, while other files
547 are removed by @code{make clean}.
548 @c FIXME: this is in violation of standards!
549 @cvindex AC_OUTPUT
550 @end table
552 @node Optional
553 @section Other things Automake recognizes
555 Automake will also recognize the use of certain macros and tailor the
556 generated @file{Makefile.in} appropriately.  Currently recognized macros
557 and their effects are:
559 @table @code
560 @item AC_CONFIG_HEADER
561 Automake will generate rules to automatically regenerate the config
562 header.  If you do use this macro, you must create the file
563 @file{stamp-h.in} in your source directory.  It can be empty.  Also, the
564 @code{AC_OUTPUT} command in @file{configure.in} must create
565 @file{stamp-h}, eg:
566 @example
567 AC_OUTPUT(Makefile,
568 [test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h])
569 @end example
570 @cvindex AC_CONFIG_HEADER
571 Note that Automake does not currently currently check to make sure the
572 @code{AC_OUTPUT} command is correct.  Hopefully a future version of
573 @code{autoconf} will let Automake handle this automatically.
575 @item AC_CONFIG_AUX_DIR
576 Automake will look for various helper scripts, such as
577 @file{mkinstalldirs}, in the directory named in this macro invocation.
578 If not seen, the scripts are looked for in their ``standard'' locations
579 (either the top source directory, or in the source directory
580 corresponding to the current @file{Makefile.am}, whichever is
581 appropriate).
582 @cvindex AC_CONFIG_AUX_DIR
583 FIXME: give complete list of things looked for in this directory
585 @item AC_PATH_XTRA
586 Automake will insert definitions for the variables defined by
587 @code{AC_PATH_XTRA} into each @file{Makefile.in} that builds a C program
588 or library.
589 @cvindex AC_PATH_XTRA
591 @item AC_CANONICAL_HOST
592 @item AC_CHECK_TOOL
593 Automake will ensure that @file{config.guess} and @file{config.sub}
594 exist.  Also, the @file{Makefile} variables @samp{host_alias} and
595 @samp{host_triplet} are introduced.
596 @c fixme xref autoconf docs.
597 @cvindex AC_CANONICAL_HOST
598 @cvindex AC_CHECK_TOOL
599 @vindex host_alias
600 @vindex host_triplet
602 @item AC_CANONICAL_SYSTEM
603 This is similar to @code{AC_CANONICAL_HOST}, but also defines the
604 @file{Makefile} variables @samp{build_alias} and @samp{target_alias}.
605 @cvindex AC_CANONICAL_SYSTEM
606 @vindex build_alias
607 @vindex target_alias
609 @item AC_FUNC_ALLOCA
610 @item AC_FUNC_GETLOADAVG
611 @item AC_FUNC_MEMCMP
612 @item AC_STRUCT_ST_BLOCKS
613 @item AM_FUNC_FNMATCH
614 @item AM_FUNC_STRTOD
615 @item AC_REPLACE_FUNCS
616 @item AC_REPLACE_GNU_GETOPT
617 @item AM_WITH_REGEX
618 Automake will ensure that the appropriate source files are part of the
619 distribution, and will ensure that the appropriate dependencies are
620 generated for these objects.  @xref{A Library} for more
621 information.
622 @cvindex AC_FUNC_ALLOCA
623 @cvindex AC_FUNC_GETLOADAVG
624 @cvindex AC_FUNC_MEMCMP
625 @cvindex AC_STRUCT_ST_BLOCKS
626 @cvindex AM_FUNC_FNMATCH
627 @cvindex AC_FUNC_FNMATCH
628 @cvindex AC_REPLACE_FUNCS
629 @cvindex AC_REPLACE_GNU_GETOPT
630 @cvindex AM_FUNC_STRTOD
631 @cvindex AM_WITH_REGEX
633 @item LIBOBJS
634 Automake will detect statements which put @samp{.o} files into
635 @code{LIBOBJS}, and will treat these additional files as if they were
636 discovered via @code{AC_REPLACE_FUNCS}.
637 @cvindex LIBOBJS
639 @item AC_PROG_RANLIB
640 This is required if any libraries are built in the package.
641 @cvindex AC_PROG_RANLIB
643 @item AC_PROG_CXX
644 This is required if any C++ source is included.
645 @cvindex AC_PROG_CXX
647 @c @item AM_PROG_LIBTOOL
648 @c Automake will turn on processing for @code{libtool} (@pxref{Top, , The
649 @c Libtool Manual, libtool.info, The Libtool Manual}).  This work is
650 @c still preliminary.
651 @c @cvindex AM_PROG_LIBTOOL
653 @item AC_PROG_YACC
654 If a Yacc source file is seen, then you must either use this macro or
655 declare the variable @samp{YACC} in @file{configure.in}.  The former is
656 preferred.
657 @cvindex AC_PROG_YACC
658 @cvindex YACC
660 @item AC_DECL_YYTEXT
661 This macro is required if there is Yacc source in the package.
662 @cvindex AC_DECL_YYTEXT
664 @item AC_PROG_LEX
665 If a Lex source file is seen, then this macro must be used.
666 @cvindex AC_PROG_LEX
668 @item ALL_LINGUAS
669 If Automake sees that this variable is set in @file{configure.in}, it
670 will check the @file{po} directory to ensure that all the named
671 @samp{.po} files exist, and that all the @samp{.po} files that exist are
672 named.
673 @cvindex ALL_LINGUAS
675 @item AM_C_PROTOTYPES
676 This is required when using automatic de-ANSI-fication, see @ref{ANSI}.
677 @cvindex AM_C_PROTOTYPES
679 @item ud_GNU_GETTEXT
680 This macro is required for packages which use GNU gettext
681 (@pxref{gettext}).  It is distributed with gettext.  Automake uses this
682 macro to ensure that the package meets some of gettext's requirements.
683 @cvindex ud_GNU_GETTEXT
685 @item AM_MAINTAINER_MODE
686 This macro adds a @samp{--enable-maintainer-mode} option to
687 @code{configure}.  If this is used, @code{automake} will cause
688 ``maintainer-only'' rules to be turned off by default in the generated
689 @file{Makefile.in}s.  This macro is disallowed in @samp{Gnits} mode.
690 FIXME xref.
691 @cvindex jm_MAINTAINER_MODE
692 @end table
695 @node Invoking aclocal
696 @section Auto-generating aclocal.m4
698 The @code{aclocal} program will automatically generate @file{aclocal.m4}
699 files based on the contents of @file{configure.in}.
701 ... explain why on earth you'd want to do this
703 @code{aclocal} accepts the following options:
705 @table @code
706 @item --acdir=@var{dir}
707 Look for the macro files in @var{dir} instead of the installation
708 directory.  This is typically used for debugging.
710 @item --help
711 Print a summary of the command line options and exit.
713 @item --output=@var{file}
714 Cause the output to be put into @var{file} instead of @file{aclocal.m4}.
716 @item --verbose
717 Print the names of the files it examines.
719 @item --version
720 Print the version number of Automake and exit.
721 @end table
724 @node Macros
725 @section Autoconf macros supplied with Automake
727 @c consider generating this node automatically from m4 files.
729 @table @code
730 @item AM_FUNC_FNMATCH
731 If the @code{fnmatch} function is not available, or does not work
732 correctly (like the one on SunOS 5.4), add @samp{fnmatch.o} to output
733 variable @code{LIBOBJS}.
735 @item AM_FUNC_STRTOD
736 If the @code{strtod} function is not available, or does not work
737 correctly (like the one on SunOS 5.4), add @samp{strtod.o} to output
738 variable @code{LIBOBJS}.
740 @item AM_C_PROTOTYPES
741 @item AM_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL
742 @item AM_INIT_AUTOMAKE
743 @item AM_MAINTAINER_MODE
744 @item AM_PATH_LISPDIR
745 @item AM_PROG_CC_STDC
746 @item AM_PROG_INSTALL
747 @item AM_SANITY_CHECK_CC
748 @item AM_SYS_POSIX_TERMIOS
749 @item AM_TYPE_PTRDIFF_T
750 @item AM_WITH_DMALLOC
751 @item AM_WITH_REGEX
752 @end table
755 @node Extending aclocal
756 @section Writing your own aclocal macros
758 ... explain format of macro files
759 ... explain how to get your own macros installed (using acinstall)
760 ... explain situations where this is actually useful (eg gettext)
763 @node Top level
764 @chapter The top-level @file{Makefile.am}
766 In non-flat packages, the top level @file{Makefile.am} must tell
767 Automake which subdirectories are to be built.  This is done via the
768 @code{SUBDIRS} variable.
769 @vindex SUBDIRS
771 The @code{SUBDIRS} macro holds a list of subdirectories in which
772 building of various sorts can occur.  Many targets (eg @code{all}) in
773 the generated @file{Makefile} will run both locally and in all specified
774 subdirectories.  Note that the directories listed in @code{SUBDIRS} are
775 not required to contain @file{Makefile.am}s; only @file{Makefile}s
776 (after configuration).  This allows inclusion of libraries from packages
777 which do not use Automake (such as @code{gettext}).
779 In a deep package, the top-level @file{Makefile.am} is often very short.
780 For instance, here is the @file{Makefile.am} from the textutils
781 distribution:
783 @example
784 SUBDIRS = lib src doc man
785 EXTRA_DIST = @@README_ALPHA@@
786 @end example
788 @code{SUBDIRS} can contain configure substitutions (eg @samp{@@DIRS@@});
789 Automake itself does not actually examine the contents of this variable.
791 If @code{SUBDIRS} is defined, then your @file{configure.in} must include
792 @code{AC_PROG_MAKE_SET}.
794 The use of @code{SUBDIRS} is not restricted to just the top-level
795 @file{Makefile.am}.  Automake can be used to construct packages of
796 arbitrary depth.
799 @node Programs
800 @chapter Building Programs and Libraries
802 A large part of Automake's functionality is dedicated to making it easy
803 to build C programs and libraries.
805 @menu
806 * A Program::                   Building a program
807 * A Library::                   Building a library
808 * LIBOBJS::                     Special handling for LIBOBJS and ALLOCA
809 * Program variables::           Variables used when building a program
810 * Yacc and Lex::                Yacc and Lex support
811 * C++::                         C++ and other languages
812 * ANSI::                        Automatic de-ANSI-fication
813 * Dependencies::                Automatic dependency tracking
814 @end menu
817 @node A Program
818 @section Building a program
820 In a directory containing source that gets built into a program (as
821 opposed to a library), the @samp{PROGRAMS} primary is used.  Programs
822 can be installed in @code{bindir}, @code{sbindir}, @code{libexecdir},
823 @code{pkglibdir}, or not at all.
825 For instance:
827 @example
828 bin_PROGRAMS = hello
829 @end example
831 In this simple case, the resulting @file{Makefile.in} will contain code
832 to generate a program named @code{hello}.  The variable
833 @code{hello_SOURCES} is used to specify which source files get built
834 into an executable:
836 @example
837 hello_SOURCES = hello.c
838 @end example
840 This causes @file{hello.c} to be compiled into @file{hello.o}, and then
841 linked to produce @file{hello}.
843 If @samp{prog_SOURCES} is needed, but not specified, then it defaults to
844 the single file @file{prog.c}.  In the example above, the definition of
845 @code{hello_SOURCES} is actually redundant.
846 @vindex _SOURCES
847 @vindex SOURCES
849 Multiple programs can be built in a single directory.  Multiple programs
850 can share a single source file.  The source file must be listed in each
851 @samp{_SOURCES} definition.
853 Header files listed in a @samp{_SOURCES} definition will be included in
854 the distribution but otherwise ignored.  In case it isn't obvious, you
855 should not include the header file generated by @file{configure} in an
856 @samp{_SOURCES} variable; this file should not be distributed.
857 Lex (@samp{.l}) and yacc (@samp{.y}) files can also be listed; support
858 for these should work but is still preliminary.
859 @c lex & yacc should have a separate section
861 Sometimes it is useful to determine the programs that are to be built at
862 configure time.  For instance, GNU @code{cpio} only builds @code{mt} and
863 @code{rmt} under special circumstances.
865 In this case, you must notify @code{Automake} of all the programs that
866 can possibly be built, but at the same time cause the generated
867 @file{Makefile.in} to use the programs specified by @code{configure}.
868 This is done by having @code{configure} substitute values into each
869 @samp{_PROGRAMS} definition, while listing all optionally built programs in
870 @code{EXTRA_PROGRAMS}.
871 @vindex EXTRA_PROGRAMS
873 If you need to link against libraries that are not found by
874 @code{configure}, you can use @code{LDADD} to do so.  This variable
875 actually can be used to add any options to the linker command line.
876 @vindex LDADD
878 Sometimes, multiple programs are built in one directory but do not share
879 the same link-time requirements.  In this case, you can use the
880 @samp{@var{prog}_LDADD} variable (where @var{PROG} is the name of the
881 program as it appears in some @samp{_PROGRAMS} variable, and usually
882 written in lowercase) to override the global @code{LDADD}.  (If this
883 variable exists for a given program, then that program is not linked
884 using @code{LDADD}.)
885 @vindex _LDADD
887 For instance, in GNU cpio, @code{pax}, @code{cpio}, and @code{mt} are
888 linked against the library @file{libcpio.a}.  However, @code{rmt} is
889 built in the same directory, and has no such link requirement.  Also,
890 @code{mt} and @code{rmt} are only built on certain architectures.  Here
891 is what cpio's @file{src/Makefile.am} looks like (abridged):
893 @example
894 bin_PROGRAMS = cpio pax @@MT@@
895 libexec_PROGRAMS = @@RMT@@
896 EXTRA_PROGRAMS = mt rmt
898 LDADD = ../lib/libcpio.a @@INTLLIBS@@
899 rmt_LDADD =
901 cpio_SOURCES = @dots{}
902 pax_SOURCES = @dots{}
903 mt_SOURCES = @dots{}
904 rmt_SOURCES = @dots{}
905 @end example
907 It is also occasionally useful to have a program depend on some other
908 target which is not actually part of that program.  This can be done
909 using the @samp{prog_DEPENDENCIES} variable.  Each program depends on
910 the contents of such a variable, but no further interpretation is done.
912 If @samp{prog_DEPENDENCIES} is not supplied, it is computed by Automake.
913 The automatically-assigned value is the contents of @samp{prog_LDADD}
914 with all the @samp{-l} and @samp{-L} options removed.  Be warned that
915 @file{configure} substitutions are preserved; this can lead to bad
916 dependencies if you are not careful.
919 @node A Library
920 @section Building a library
922 Building a library is much like building a program.  In this case, the
923 name of the primary is @samp{LIBRARIES}.  Libraries can be installed in
924 @code{libdir} or @code{pkglibdir}.
926 Each @samp{_LIBRARIES} variable is a list of the base names of
927 libraries to be built.  For instance to create a library named
928 @file{libcpio.a}, but not install it, you would write:
930 @example
931 noinst_LIBRARIES = cpio
932 @end example
934 The sources that go into a library are determined exactly as they are
935 for programs, via the @samp{_SOURCES} variables.  Note that programs and
936 libraries share a namespace, so one cannot have a program (@file{lob}) and
937 a library (@file{liblob.a}) with the same name in one directory.
939 Extra objects can be added to a library using the @samp{library_LIBADD}
940 variable.  This should be used for objects determined by
941 @code{configure}.  Again from cpio:
942 @vindex _LIBADD
943 @vindex LIBADD
945 @example
946 cpio_LIBADD = @@LIBOBJS@@ @@ALLOCA@@
947 @end example
950 @node LIBOBJS
951 @section Special handling for LIBOBJS and ALLOCA
953 Automake explicitly recognizes the use of @code{@@LIBOBJS@@} and
954 @code{@@ALLOCA@@}, and uses this information, plus the list of
955 @code{LIBOBJS} files derived from @file{configure.in} to automatically
956 include the appropriate source files in the distribution (@pxref{Dist}).
957 These source files are also automatically handled in the
958 dependency-tracking scheme, see @xref{Dependencies}.
960 @code{@@LIBOBJS@@} and @code{@@ALLOCA@@} are specially recognized in any
961 @samp{_LDADD} or @samp{_LIBADD} variable.
964 @node Program variables
965 @section Variables used when building a program
967 Occasionally it is useful to know which @file{Makefile} variables
968 Automake uses for compilations; for instance you might need to do your
969 own compilation in some special cases.
971 Some variables are inherited from Autoconf; these are @code{CC},
972 @code{CFLAGS}, @code{CPPFLAGS}, @code{DEFS}, @code{LDFLAGS}, and
973 @code{LIBS}.
976 There are some additional variables which Automake itself defines:
978 @table @code
979 @item INCLUDES
980 A list of @samp{-I} options.  This can be set in your @file{Makefile.am}
981 if you have special directories you want to look in.
983 @item COMPILE
984 This is the command used to actually compile a C source file.  The
985 filename is appended to form the complete command line.
987 @item LINK
988 This is the command used to actually link a C program.
989 @end table
992 @node Yacc and Lex
993 @section Yacc and Lex support
995 Automake has somewhat idiosyncratic support for Yacc and Lex.
996 FIXME: describe it here.
999 @node C++
1000 @section C++ and other languages
1002 Automake includes full support for C++, and rudimentary support for
1003 other languages.  Support for other languages will be improved based on
1004 demand.
1006 Any package including C++ code must use @code{AC_PROG_CXX} in its
1007 @file{configure.in}.
1009 A few additional variables are defined when a C++ source file is seen:
1011 @table @code
1012 @item CXX
1013 The name of the C++ compiler.
1015 @item CXXFLAGS
1016 Any flags to pass to the C++ compiler.
1018 @item CXXCOMPILE
1019 The command used to actually compile a C++ source file.  The file name
1020 is appended to form the complete command line.
1022 @item CXXLINK
1023 The command used to actually link a C++ program.
1024 @end table
1027 @node ANSI
1028 @section Automatic de-ANSI-fication
1030 Although the GNU standards prohibit it, some GNU programs are written in
1031 ANSI C; see FIXME.  This is possible because each source file can be
1032 ``de-ANSI-fied'' before the actual compilation takes place.
1034 If the @file{Makefile.am} variable @code{AUTOMAKE_OPTIONS}
1035 @vindex AUTOMAKE_OPTIONS
1036 (@ref{Options}) contains the option @code{ansi2knr}
1037 @opindex ansi2knr
1038 then code to handle de-ANSI-fication is inserted into the generated
1039 @file{Makefile.in}.
1041 This causes each source file to be treated as ANSI C.  If an ANSI C
1042 compiler is available, it is used.
1044 This support requires the source files @file{ansi2knr.c} and
1045 @file{ansi2knr.1} to be in the same directory as the ANSI C source;
1046 these files are distributed with Automake.
1047 Also, the package @file{configure.in} must call the macro
1048 @code{AM_C_PROTOTYPES}.
1049 @cvindex AM_C_PROTOTYPES
1051 Automake also handles finding the @code{ansi2knr} support files in some
1052 other directory in the current package.  This is done by prepending the
1053 relative path to the appropriate directory to the @code{ansi2knr}
1054 option.  For instance, suppose the package has ANSI C code in the
1055 @file{src} and @file{lib} subdirs.  The files @file{ansi2knr.c} and
1056 @file{ansi2knr.1} appear in @file{lib}.  Then this could appear in
1057 @file{src/Makefile.am}:
1059 @example
1060 AUTOMAKE_OPTIONS = ../lib/ansi2knr
1061 @end example
1063 Note that the directory holding the @code{ansi2knr} support files must
1064 be built before all other directories using these files.  Automake does
1065 not currently check that this is the case.
1068 @node Dependencies
1069 @section Automatic dependency tracking
1071 As a developer it is often painful to continually update the
1072 @file{Makefile.in} whenever the include-file dependencies change in a
1073 project.  @code{automake} supplies a way to automatically track
1074 dependency changes, and distribute the dependencies in the generated
1075 @file{Makefile.in}.
1077 Currently this support requires the use of GNU @code{make} and
1078 @code{gcc}.  It might become possible in the future to supply a
1079 different dependency generating program, if there is enough demand.
1081 This mode is enabled by default if any C program or library is defined
1082 in the current directory.
1084 When you decide to make a distribution, the @code{dist} target will
1085 @trindex dist
1086 re-run @code{automake} with the @samp{--include-deps} option.  This
1087 @c FIXME XREF?
1088 causes the previously generated dependencies to be inserted into the
1089 generated @file{Makefile.in}, and thus into the distribution.
1090 @samp{--include-deps} also turns off inclusion of the dependency
1091 generation code.
1093 This mode can be suppressed by putting @code{no-dependencies} in the
1094 variable @code{AUTOMAKE_OPTIONS}.
1095 @vindex AUTOMAKE_OPTIONS
1096 @opindex no-dependencies
1098 If you unpack a distribution made by @code{make dist}, and you want to
1099 turn on the dependency-tracking code again, simply run @code{automake}
1100 with no arguments.
1103 @node Other objects
1104 @chapter Other Derived Objects
1106 Automake can handle derived objects which are not C programs.  Sometimes
1107 the support for actually building such objects must be explicitly
1108 supplied, but Automake will still automatically handle installation and
1109 distribution.
1111 @menu
1112 * Scripts::                     Executable scripts
1113 * Headers::                     Header files
1114 * Data::                        Architecture-independent data files
1115 * Sources::                     Derived sources
1116 @end menu
1119 @node Scripts
1120 @section Executable Scripts
1122 It is possible to define and install programs which are scripts.  Such
1123 programs are listed using the @samp{SCRIPTS} primary name.
1124 @code{automake} doesn't define any dependencies for scripts; the
1125 @file{Makefile.am} should include the appropriate rules.
1126 @vindex SCRIPTS
1128 @code{automake} does not assume that scripts are derived objects; such
1129 objects must be deleted by hand; see @ref{Clean} for more information.
1131 @code{automake} itself is a script that is generated at configure time
1132 from @file{automake.in}.  Here is how this is handled:
1134 @example
1135 bin_SCRIPTS = automake
1136 @end example
1138 Since @code{automake} appears in the @code{AC_OUTPUT} macro, a target
1139 for it is automatically generated.
1141 Script objects can be installed in @code{bindir}, @code{sbindir},
1142 @code{libexecdir}, or @code{pkgdatadir}.
1145 @node Headers
1146 @section Header files
1148 Header files are specified by the @samp{HEADERS} family of variables.
1149 Generally header files are not installed, so the @code{noinst_HEADERS}
1150 variable will be the most used.
1151 @vindex HEADERS
1153 All header files must be listed somewhere; missing ones will not appear
1154 in the distribution.  Often it is clearest to list uninstalled headers
1155 with the rest of the sources for a program.  @xref{A Program}.  Headers
1156 listed in a @samp{_SOURCES} variable need not be listed in any
1157 @samp{_HEADERS} variable.
1159 Headers can be installed in @code{includedir}, @code{oldincludedir}, or
1160 @code{pkgincludedir}.
1163 @node Data
1164 @section Architecture-independent data files
1166 Automake supports the installation of miscellaneous data files using the
1167 @samp{DATA} family of variables.
1168 @vindex DATA
1170 Such data can be installed in the directories @code{datadir},
1171 @code{sysconfdir}, @code{sharedstatedir}, @code{localstatedir}, or
1172 @code{pkgdatadir}.
1174 All such data files are included in the distribution.
1176 Here is how @code{automake} installs its auxiliary data files:
1178 @example
1179 pkgdata_DATA = clean-kr.am clean.am compile-kr.am compile-vars.am \
1180 compile.am data.am depend.am dist-subd-top.am dist-subd-vars.am \
1181 dist-subd.am dist-vars.am dist.am footer.am header-vars.am header.am \
1182 libscripts.am libprograms.am libraries-vars.am libraries.am library.am \
1183 mans-vars.am mans.am packagedata.am program.am programs.am remake-hdr.am \
1184 remake-subd.am remake.am scripts.am subdirs.am tags.am tags-subd.am \
1185 texinfos-vars.am texinfos.am hack-make.sed nl-remove.sed
1186 @end example
1189 @node Sources
1190 @section Built sources
1192 Occasionally a file which would otherwise be called ``source'' (eg a C
1193 @samp{.h} file) is actually derived from some other file.  Such files
1194 should be listed in the @code{BUILT_SOURCES} variable.
1195 @vindex BUILT_SOURCES
1197 Files listed in @code{BUILT_SOURCES} are built before any automatic
1198 dependency tracking is done.  Built sources are included in a
1199 distribution.
1202 @node Other GNU Tools
1203 @chapter Other GNU Tools
1205 Since Automake is primarily intended to generate @file{Makefile.in}s for
1206 use in GNU programs, it tries hard to interoperatoe with other GNU
1207 tools.
1209 @menu
1210 * Emacs Lisp::                  Emacs Lisp
1211 * gettext::                     Gettext
1212 @end menu
1214 @node Emacs Lisp
1215 @section Emacs Lisp
1217 Automake provides some support for Emacs Lisp.  The @samp{LISP} primary
1218 is used to hold a list of @samp{.el} files.  Possible prefixes for this
1219 primary are @samp{lisp_} and @samp{noinst_}.  Note that if
1220 @code{lisp_LISP} is defined, then @file{configure.in} must run
1221 @code{AM_PATH_LISPDIR} (fixme xref).
1222 @vindex LISP
1223 @vindex lisp_LISP
1224 @vindex noinst_LISP
1226 By default Automake will byte-compile all Emacs Lisp source files using
1227 the Emacs found by @code{AM_PATH_LISPDIR}.  If you wish to avoid
1228 byte-compiling, simply define the variable @samp{ELCFILES} to be empty.
1229 @vindex ELCFILES
1231 @node gettext
1232 @section Gettext
1234 If @code{ud_GNU_GETTEXT} is seen in @file{configure.in}, then Automake
1235 turns on support for GNU gettext, a message catalog system for
1236 internationalization
1237 (@pxref{GNU Gettext, , , gettext.info, GNU gettext utilities}).
1239 The @code{gettext} support in Automake requires the addition of two
1240 subdirectories to the package, @file{intl} and @file{po}.  Automake
1241 ensure that these directories exist and are mentioned in @code{SUBDIRS}.
1243 Furthermore, Automake checks that the definition of @samp{ALL_LINGUAS}
1244 in @file{configure.in} corresponds to all the valid @samp{.po} files,
1245 and nothing more.
1248 @node Documentation
1249 @chapter Building documentation
1251 Currently Automake provides support for Texinfo and man pages.
1253 @menu
1254 * Texinfo::                     Texinfo
1255 * Man pages::                   Man pages
1256 @end menu
1259 @node Texinfo
1260 @section Texinfo
1262 If the current directory contains Texinfo source, you must declare it
1263 with the @samp{TEXINFOS} primary.  Generally Texinfo files are converted
1264 into info, and thus the @code{info_TEXINFOS} macro is most commonly used
1265 here.  Note that any Texinfo source file must end in the @samp{.texi} or
1266 @samp{.texinfo} extension.
1267 @vindex TEXINFOS
1268 @vindex info_TEXINFOS
1270 If the @samp{.texi} file @code{@@include}s @file{version.texi}, then that
1271 file will be automatically generated.  @file{version.texi} defines three
1272 Texinfo macros you can reference: @code{EDITION}, @code{VERSION}, and
1273 @code{UPDATED}.  The first two hold the version number of your package
1274 (but are kept separate for clarity); the last is the date the primary
1275 file was last modified.  The @file{version.texi} support requires the
1276 @code{mdate-sh} program; this program is supplied with Automake.
1278 Sometimes an info file actually depends on more than one @samp{.texi}
1279 file.  For instance, in the @code{xdvik} distribution,
1280 @file{kpathsea.texi} includes the files @file{install.texi},
1281 @file{copying.texi}, and @file{freedom.texi}.  You can tell Automake
1282 about these dependencies using the @samp{texi_TEXINFOS} variable.  Here
1283 is how @code{xdvik} could do it:
1284 @vindex TEXINFOS
1285 @vindex _TEXINFOS
1287 @example
1288 info_TEXINFOS = kpathsea.texi
1289 kpathsea_TEXINFOS = install.texi copying.texi freedom.texi
1290 @end example
1292 By default, Automake requires the file @file{texinfo.tex} to appear in
1293 the same directory as the Texinfo source.  However, if you used
1294 @code{AC_CONFIG_AUX_DIR} in @file{configure.in}, then @file{texinfo.tex}
1295 is looked for there.  Automake supplies @file{texinfo.tex}.
1297 Automake generates an @code{install-info} target; some people apparently
1298 use this.  By default, info pages are installed by @samp{make install}.
1299 This can be prevented via the @code{no-installinfo} option.
1302 @node Man pages
1303 @section Man pages
1305 A package can also include man pages.  (Though see the GNU standards on
1306 this matter, @ref{Man Pages, , , standards.info, The GNU Coding
1307 Standards}.)  Man pages are declared using the @samp{MANS} primary.
1308 Generally the @code{man_MANS} macro is used.  Man pages are
1309 automatically installed in the correct subdirectory of @code{mandir},
1310 based on the file extension.
1311 @vindex MANS
1312 @vindex man_MANS
1314 @c Use @samp{make install} per documentation: (texi.info)code.
1315 By default, man pages are installed by @samp{make install}.  However,
1316 since the GNU project does not require man pages, many maintainers do
1317 not expend effort to keep the man pages up to date.  In these cases, the
1318 @code{no-installman} option will prevent the man pages from being
1319 installed by default.  The user can still explicitly install them via
1320 @samp{make install-man}.
1321 @opindex no-installman
1322 @trindex install-man
1324 Here is how the documentation is handled in GNU @code{cpio} (which
1325 includes both Texinfo documentation and man pages):
1327 @example
1328 info_TEXINFOS = cpio.texi
1329 man_MANS = cpio.1 mt.1
1330 @end example
1332 Texinfo source, info pages and man pages are all considered to be source
1333 for the purposes of making a distribution.
1336 @node Install
1337 @chapter What Gets Installed
1339 Naturally, Automake handles the details of actually installing your
1340 program once it has been built.  All @code{PROGRAMS}, @code{SCRIPTS},
1341 @code{LIBRARIES}, @code{LISP}, @code{DATA} and @code{HEADERS} are
1342 automatically installed in the appropriate places.
1344 Automake also handles installing any specified info and man pages.
1346 Automake generates separate @code{install-data} and @code{install-exec}
1347 targets, in case the installer is installing on multiple machines which
1348 share directory structure -- these targets allow the machine-independent
1349 parts to be installed only once.  The @code{install} target depends on
1350 both of these targets.
1351 @trindex install-data
1352 @trindex install-exec
1353 @trindex install
1355 Automake also generates an @code{uninstall} target, and an
1356 @code{installdirs} target.
1357 @trindex uninstall
1358 @trindex installdirs
1360 It is possible to extend this mechanism by defining an
1361 @code{install-exec-local} or @code{install-data-local} target.  If these
1362 targets exist, they will be run at @samp{make install} time.
1363 @trindex install-exec-local
1364 @trindex install-data-local
1367 @node Clean
1368 @chapter What Gets Cleaned
1370 The GNU Makefile Standards specify a number of different clean rules.
1371 @c FIXME xref
1372 Generally the files that can cleaned are determined automatically by
1373 Automake.  Of course, Automake also recognizes some variables that can
1374 be defined to specify additional files to clean.  These variables are
1375 @code{MOSTLYCLEANFILES}, @code{CLEANFILES}, @code{DISTCLEANFILES}, and
1376 @code{MAINTAINERCLEANFILES}.
1377 @vindex MOSTLYCLEANFILES
1378 @vindex CLEANFILES
1379 @vindex DISTCLEANFILES
1380 @vindex MAINTAINERCLEANFILES
1383 @node Dist
1384 @chapter What Goes in a Distribution
1386 The @code{dist} target in the generated @file{Makefile.in} can be used
1387 to generate a gzip'd @code{tar} file for distribution.  The tar file is
1388 named based on the @var{PACKAGE} and @var{VERSION} variables; more
1389 precisely it is named @samp{@var{PACKAGE}-@var{VERSION}.tar.gz}.
1390 @cvindex PACKAGE
1391 @cvindex VERSION
1392 @trindex dist
1394 For the most part, the files to distribute are automatically found by
1395 Automake: all source files are automatically included in a distribution,
1396 as are all @file{Makefile.am}s and @file{Makefile.in}s.  Automake also
1397 has a built-in list of commonly used files which, if present in the
1398 current directory, are automatically included.  This list is printed by
1399 @samp{automake --help}.  Also, files which are read by @code{configure}
1400 (ie, the source files corresponding to the files specified in the
1401 @code{AC_OUTPUT} invocation) are automatically distributed.
1403 Still, sometimes there are files which must be distributed, but which
1404 are not covered in the automatic rules.  These files should be listed in
1405 the @code{EXTRA_DIST} variable.
1406 @vindex EXTRA_DIST
1408 Occasionally it is useful to be able to change the distribution before
1409 it is packaged up.  If the @code{dist-hook} target exists, it is run
1410 after the distribution directory is filled, but before the actual tar
1411 (or shar) file is created.  One way to use this is for distributing file
1412 in subdirectories for which a new @file{Makefile.am} is overkill:
1414 @example
1415 dist-hook:
1416         mkdir $(distdir)/random
1417         cp -p random/a1 random/a2 $(distdir)/random
1418 @end example
1420 Automake also generates a @code{distcheck} target which can be help to
1421 ensure that a given distribution will actually work.  @code{distcheck}
1422 makes a distribution, and then tries to do a @code{VPATH} build.
1423 @trindex distcheck
1424 @c FIXME: document distcheck-hook here
1426 @node Tests
1427 @chapter Support for test suites
1429 Automake supports a two forms of test suite.
1431 If the variable @code{TESTS} is defined, its value is taken to be a list
1432 of programs to run in order to do the testing.  The programs can either
1433 be derived objects or source objects; the generated rule will look both
1434 in @var{srcdir} and @file{.}.  The number of failures will be printed at
1435 the end of the run.  The variable @code{TESTS_ENVIRONMENT} can be used
1436 to set environment variables for the test run; the environment variable
1437 @code{srcdir} is set in the rule.
1438 @vindex TESTS
1439 @vindex TESTS_ENVIRONMENT
1441 If @samp{dejagnu} appears in @code{AUTOMAKE_OPTIONS}, then the a
1442 @code{dejagnu}-based test suite is assumed.  The value of the variable
1443 @code{DEJATOOL} is passed as the @code{--tool} argument to
1444 @code{runtest}; it defaults to the name of the package.  The variables
1445 @code{EXPECT}, @code{RUNTEST} and @code{RUNTESTFLAGS} can also be
1446 overridden to provide project-specific values.  For instance, you will
1447 need to do this if you are testing a compiler toolchain, because the
1448 default values do not take into account host and target names.
1449 @opindex dejagnu
1450 @vindex DEJATOOL
1451 @vindex EXPECT
1452 @vindex RUNTEST
1453 @vindex RUNTESTFLAGS
1454 @c FIXME xref dejagnu
1456 In either case, the testing is done via @samp{make check}.
1459 @node Options
1460 @chapter Changing Automake's Behavior
1462 Various features of Automake can be controlled by options in the
1463 @file{Makefile.am}.  Such options are listed in a special variable named
1464 @code{AUTOMAKE_OPTIONS}.  Currently understood options are:
1465 @vindex AUTOMAKE_OPTIONS
1467 @table @asis
1468 @item @code{gnits}
1469 @itemx @code{gnu}
1470 @itemx @code{foreign}
1471 The same as the corresponding @samp{--strictness} option.
1473 @item @code{no-installman}
1474 The generated @file{Makefile.in} will not cause man pages to be
1475 installed by default.  However, an @code{install-man} target will still
1476 be available for optional installation.  This option is disallowed at
1477 @samp{GNU} strictness and above.
1478 @trindex install-man
1480 @item @code{no-installinfo}
1481 The generated @file{Makefile.in} will not cause info pages to be built
1482 or installed by default.  However, @code{info} and @code{install-info}
1483 targets will still be available.  This option is disallowed at
1484 @samp{GNU} strictness and above.
1485 @trindex info
1486 @trindex install-info
1488 @item @code{ansi2knr}
1489 @item @code{path/ansi2knr}
1490 Turn on automatic de-ANSI-fication.  @xref{ANSI}.  If preceeded by a
1491 path, the generated @file{Makefile.in} will look in the specified
1492 directory to find the @file{ansi2knr} program.  Generally the path
1493 should be a relative path to another directory in the same distribution
1494 (though Automake currently does not check this).  It is up to you to
1495 make sure that the specified directory is built before the current
1496 directory; if @file{ansi2knr} does not exist then the build will fail.
1498 @item @code{dejagnu}
1499 Cause @code{dejagnu}-specific rules to be generated.  @xref{Tests}.
1501 @item @code{dist-shar}
1502 Generate a @code{dist-shar} target as well as the ordinary @code{dist}
1503 target.  This new target will create a shar archive of the
1504 distribution.
1505 @trindex dist-shar
1507 @item @code{dist-zip}
1508 Generate a @code{dist-zip} target as well as the ordinary @code{dist}
1509 target.  This new target will create a zip archive of the distribution.
1510 @trindex dist-zip
1512 @item @code{dist-tarZ}
1513 Generate a @code{dist-tarZ} target as well as the ordinary @code{dist}
1514 target.  This new target will create a compressed tar archive of the
1515 distribution; a traditional @code{tar} and @code{compress} will be
1516 assumed.  Warning: if you are actually using @code{GNU tar}, then the
1517 generated archive might contain nonportable constructs.
1518 @trindex dist-tarZ
1520 @item @code{no-dependencies}
1521 This is similar to using @samp{--include-deps} on the command line, but
1522 is useful for those situations where you don't have the necessary bits
1523 to make automatic dependency tracking work @xref{Dependencies}.  In this
1524 case the effect is to effectively disable automatic dependency tracking.
1526 @item @var{version}
1527 A version number (eg @samp{0.30}) can be specified.  If Automake is not
1528 newer than the version specified, creation of the @file{Makefile.in}
1529 will be suppressed.
1530 @end table
1532 Unrecognized options are diagnosed by @code{automake}.
1535 @node Miscellaneous
1536 @chapter Miscellaneous Rules
1538 There are a few rules and variables that didn't fit anywhere else.
1540 @menu
1541 * Tags::                        Interfacing to etags and mkid
1542 * Suffixes::                    Handling new file extensions
1543 * Built::                       Built sources
1544 @end menu
1547 @node Tags
1548 @section Interfacing to @code{etags}
1550 @code{automake} will generate rules to generate @file{TAGS} files for
1551 use with GNU Emacs under some circumstances.
1553 If any C source code or headers are present, then a @code{tags} target
1554 will be generated for the directory.
1555 @trindex tags
1557 At the topmost directory of a multi-directory package, a @code{tags}
1558 target file will be generated which, when run, will generate a
1559 @file{TAGS} file that includes by reference all @file{TAGS} files from
1560 subdirectories.
1562 Also, if the variable @code{ETAGS_ARGS} is defined, a @code{tags} target
1563 will be generated.  This variable is intended for use in directories
1564 which contain taggable source that @code{etags} does not understand.
1565 @vindex ETAGS_ARGS
1567 Here is how Automake generates tags for its source, and for nodes in its
1568 Texinfo file:
1570 @example
1571 ETAGS_ARGS = automake.in --lang=none \
1572  --regex='/^@@node[ \t]+\([^,]+\)/\1/' automake.texi
1573 @end example
1575 If you add filenames to @var{ETAGS_ARGS}, you will probably also
1576 want to set @var{TAGS_DEPENDENCIES}.  The contents of this variable
1577 are added directly to the dependencies for the @code{tags} target.
1578 @vindex TAGS_DEPENDENCIES
1580 Automake will also generate an @code{ID} target which will run
1581 @code{mkid} on the source.  This is only supported on a
1582 directory-by-directory basis.
1583 @trindex id
1586 @node Suffixes
1587 @section Handling new file extensions
1589 It is sometimes useful to introduce a new implicit rule to handle a file
1590 type that Automake does not know about.  If this is done, you must
1591 notify GNU Make of the new suffixes.  This can be done by putting a list
1592 of new suffixes in the @code{SUFFIXES} variable.
1593 @vindex SUFFIXES
1596 @node Built
1597 @section Built sources
1599 FIXME write this
1602 @node Gnits
1603 @chapter The effect of --gnu and --gnits
1605 The @samp{--gnu} option (or @samp{gnu} in the @samp{AUTOMAKE_OPTIONS}
1606 variable) causes @code{automake} to check the following:
1608 @itemize @bullet
1609 @item
1610 The files @file{INSTALL}, @file{NEWS}, @file{README}, @file{COPYING},
1611 @file{AUTHORS}, and @file{ChangeLog} are required at the topmost
1612 directory of the package.
1614 @item
1615 The options @samp{no-installman} and @samp{no-installinfo} are
1616 prohibited.
1617 @end itemize
1619 Note that this option will be extended in the future to do even more
1620 checking; it is advisable to be familiar with the precise requirements
1621 of the GNU standards.  Also, @samp{--gnu} can require certain
1622 non-standard GNU programs to exist for use by various maintainer-only
1623 targets; for instance in the future @code{pathchk} might be required for
1624 @samp{make dist}.
1626 The @samp{--gnits} option does everything that @samp{--gnu} does, and
1627 checks the following as well:
1629 @itemize @bullet
1630 @item
1631 @samp{make dist} will check to make sure the @file{NEWS} file has been
1632 updated to the current version.
1634 @item
1635 The file @file{COPYING.LIB} is prohibited.
1637 @item
1638 @samp{VERSION} is checked to make sure its format complies with Gnits
1639 standards.
1640 @c FIXME xref when standards are finished
1642 @item
1643 If @samp{VERSION} indicates that this is an alpha release, and the file
1644 @file{README-alpha} appears in the topmost directory of a package, then
1645 it is included in the distribution.
1647 @item
1648 The file @file{THANKS} is required.
1649 @end itemize
1652 @node Extending
1653 @chapter When Automake Isn't Enough
1655 Sometimes @code{automake} isn't enough.  Then you just lose.
1657 Actually, @code{automake}s implicit copying semantics means that many
1658 problems can be worked around by simply adding some @code{make} targets
1659 and rules to @file{Makefile.in}.  @code{automake} will ignore these
1660 additions.
1662 There are some caveats to doing this.  Although you can overload a
1663 target already used by @code{automake}, it is often inadvisable,
1664 particularly in the topmost directory of a non-flat package.  However,
1665 various useful targets have a @samp{-local} version you can specify in your
1666 @file{Makefile.in}.  Automake will supplement the standard target with
1667 these user-supplied targets.
1669 The targets that support a local version are @code{all}, @code{info},
1670 @code{dvi}, @code{check}, @code{install-data}, @code{install-exec}, and
1671 @code{uninstall}.  Note that there are no @code{uninstall-exec-local} or
1672 @code{uninstall-data-local} targets; just use @code{uninstall-local}.
1673 It doesn't make sense to uninstall just data or just executables.
1674 @trindex all
1675 @trindex info
1676 @trindex dvi
1677 @trindex check
1678 @trindex install-data
1679 @trindex install-exec
1680 @trindex uninstall
1682 For instance, here is how to install a file in @file{/etc}:
1684 @example
1685 install-data-local:
1686         $(INSTALL_DATA) $(srcdir)/afile /etc/afile
1687 @end example
1689 Some targets also have a way to run another target, called a @dfn{hook},
1690 after their work is done.  The hook is named after the principal target,
1691 with @samp{-hook} appended.  The targets allowing hooks are
1692 @code{install-data}, @code{install-exec}, @code{dist}, and
1693 @code{distcheck}.
1694 @trindex install-data-hook
1695 @trindex install-exec-hook
1696 @trindex dist-hook
1698 For instance, here is how to create a hard link to an installed program:
1700 @example
1701 install-exec-hook:
1702         ln $(bindir)/program $(bindir)/proglink
1703 @end example
1705 @c FIXME should include discussion of variables you can use in these
1706 @c rules
1709 @node Distributing
1710 @chapter Distributing @file{Makefile.in}s
1712 Automake places no restrictions on the distribution of the resulting
1713 @file{Makefile.in}s.  We still encourage software authors to distribute
1714 their work under terms like those of the GPL, but doing so is not
1715 required to use Automake.
1717 Some of the files that can be automatically installed via the
1718 @samp{--add-missing} switch do fall under the GPL; examine each file
1719 to see.
1722 @node Examples
1723 @chapter Some example packages
1725 Here are some examples of how Automake can be used.
1727 @menu
1728 * Hello::                       The simplest GNU program
1729 * Tricky::                      A trickier example
1730 * Automake::                    Automake's own use
1731 * Textutils::                   A deep hierarchy
1732 @end menu
1734 @node Hello
1735 @section The simplest GNU program
1737 @code{hello} is renowned for its classic simplicity and versatility.
1738 What better place to begin a tour?  The below shows what could be used
1739 as the Hello distribution's @file{Makefile.am}.
1741 @example
1742 bin_PROGRAMS = hello
1743 hello_SOURCES = hello.c version.c getopt.c getopt1.c getopt.h
1744 hello_LDADD = @@ALLOCA@@
1745 info_TEXINFOS = hello.texi
1746 hello_TEXINFOS = gpl.texi
1748 EXTRA_DIST = testdata
1750 check-local: hello
1751         @@echo expect no output from diff
1752         ./hello > test.out
1753         diff -c $(srcdir)/testdata test.out
1754         rm -f test.out
1755 @end example
1757 Of course, Automake also requires some minor changes to
1758 @file{configure.in}.  The new @file{configure.in} would read:
1760 @example
1761 dnl Process this file with autoconf to produce a configure script.
1762 AC_INIT(hello.c)
1763 AM_INIT_AUTOMAKE(hello, 1.3)
1764 AC_PROG_CC
1765 AC_PROG_CPP
1766 AC_PROG_INSTALL
1767 AC_STDC_HEADERS
1768 AC_HAVE_HEADERS(string.h fcntl.h sys/file.h)
1769 AC_ALLOCA
1770 AC_OUTPUT(Makefile)
1771 @end example
1773 If Hello were really going to use Automake, the @file{version.c} file
1774 would probably be deleted, or changed so as to be automatically
1775 generated.
1778 @node Tricky
1779 @section A tricker example
1781 Here is another, trickier example.  It shows how to generate two
1782 programs (@code{ctags} and @code{etags}) from the same source file
1783 (@file{etags.c}).  The difficult part is that each compilation of
1784 @file{etags.c} requires different @code{cpp} flags.
1786 @example
1787 bin_PROGRAMS = etags ctags
1788 ctags_SOURCES =
1789 ctags_LDADD = ctags.o
1790 ctags_DEPENDENCIES = ctags.o
1792 etags.o:
1793         $(COMPILE) -DETAGS_REGEXPS etags.c
1795 ctags.o:
1796         $(COMPILE) -DCTAGS -o ctags.o etags.c
1797 @end example
1799 Note that @code{ctags_SOURCES} is defined to be empty -- that way no
1800 implicit value is substituted.  The implicit value, however, is used to
1801 generate @code{etags} from @file{etags.o}.
1803 @code{ctags_LDADD} is used to get @file{ctags.o} into the link line,
1804 while @code{ctags_DEPENDENCIES} exists to make sure that @file{ctags.o}
1805 gets built in the first place.
1807 This is a somewhat pathological example.
1810 @node Automake
1811 @section Automake uses itself
1813 Automake, of course, uses itself to generate its @file{Makefile.in}.
1814 Since Automake is a shallow package, it has more than one
1815 @file{Makefile.am}.  Here is the top-level @file{Makefile.am}:
1817 @example
1818 ## Process this file with automake to create Makefile.in
1820 AUTOMAKE_OPTIONS = gnits
1821 MAINT_CHARSET = latin1
1822 PERL = @@PERL@@
1824 SUBDIRS = tests
1826 bin_SCRIPTS = automake
1827 info_TEXINFOS = automake.texi
1829 pkgdata_DATA = clean-kr.am clean.am compile-kr.am compile-vars.am \
1830 compile.am data.am depend.am \
1831 dist-vars.am footer.am header.am header-vars.am \
1832 kr-vars.am libraries-vars.am \
1833 libraries.am library.am mans-vars.am \
1834 program.am programs.am remake-hdr.am \
1835 remake-subd.am remake.am scripts.am subdirs.am tags.am tags-subd.am \
1836 tags-clean.am \
1837 texi-version.am texinfos-vars.am texinfos.am \
1838 libraries-clean.am programs-clean.am data-clean.am \
1839 COPYING INSTALL texinfo.tex \
1840 ansi2knr.c ansi2knr.1 \
1841 aclocal.m4
1843 ## These must all be executable when installed.
1844 pkgdata_SCRIPTS = config.guess config.sub install-sh mdate-sh mkinstalldirs
1846 # The following requires a fixed version of the Emacs 19.30 etags.
1847 ETAGS_ARGS = automake.in --lang=none \
1848  --regex='/^@@node[ \t]+\([^,]+\)/\1/' automake.texi
1850 ## `test -x' is not portable.  So we use Perl instead.  If Perl
1851 ## doesn't exist, then this test is meaningless anyway.
1852 # Check to make sure some installed files are executable.
1853 installcheck-local:
1854         $(PERL) -e "exit ! -x '$(pkgdatadir)/config.guess';"
1855         $(PERL) -e "exit ! -x '$(pkgdatadir)/config.sub';"
1856         $(PERL) -e "exit ! -x '$(pkgdatadir)/install-sh';"
1857         $(PERL) -e "exit ! -x '$(pkgdatadir)/mdate-sh';"
1858         $(PERL) -e "exit ! -x '$(pkgdatadir)/mkinstalldirs';"
1860 # Some simple checks:
1861 # * syntax check with perl4 and perl5.
1862 # * make sure the scripts don't use 'true'
1863 # * expect no instances of '$@{...@}'
1864 # These are only really guaranteed to work on my machine.
1865 maintainer-check: automake check
1866         $(PERL) -c -w automake
1867         @@if grep '^[^#].*true' $(srcdir)/[a-z]*.am; then \
1868           echo "can't use 'true' in GNU Makefile" 1>&2; \
1869           exit 1;                               \
1870         else :; fi
1871         @@if test `fgrep '$$@{' $(srcdir)/[a-z]*.am | wc -l` -ne 0; then \
1872           echo "found too many uses of '\$$@{'" 1>&2; \
1873           exit 1;                               \
1874         fi
1875         if $(SHELL) -c 'perl4.036 -v' >/dev/null 2>&1; then \
1876           perl4.036 -c -w automake; \
1877         else :; fi
1879 # Tag before making distribution.  Also, don't make a distribution if
1880 # checks fail.  Also, make sure the NEWS file is up-to-date.
1881 cvs-dist: maintainer-check
1882         @@if sed 1q NEWS | grep -e "$(VERSION)" > /dev/null; then :; else \
1883           echo "NEWS not updated; not releasing" 1>&2; \
1884           exit 1;                               \
1885         fi
1886         cvs tag `echo "Release-$(VERSION)" | sed 's/\./-/g'`
1887         $(MAKE) dist
1888 @end example
1890 As you can see, Automake defines many of its own rules, to make the
1891 maintainer's job easier.  For instance the @code{cvs-dist} rule
1892 automatically tags the current version in the CVS repository, and then
1893 makes a standard distribution.
1895 Automake consists primarily of one program, @code{automake}, and a
1896 number of auxiliary scripts.  Automake also installs a number of
1897 programs which are possibly installed via the @samp{--add-missing}
1898 option; these scripts are listed in the @code{pkgdata_SCRIPTS} variable.
1900 Automake also has a @file{tests} subdirectory, as indicated in the
1901 @code{SUBDIRS} variable above.  Here is @file{tests/Makefile.am}:
1903 @example
1904 ## Process this file with automake to create Makefile.in
1906 AUTOMAKE_OPTIONS = gnits
1908 TESTS = mdate.test vtexi.test acoutput.test instexec.test checkall.test \
1909 acoutnoq.test acouttbs.test libobj.test proginst.test acoutqnl.test \
1910 confincl.test spelling.test prefix.test badprog.test depend.test
1912 EXTRA_DIST = defs
1913 @end example
1915 This is where all the tests are really run.  @file{defs} is an
1916 initialization file used by each test script; it is explicitly mentioned
1917 because @code{automake} has no way of automatically finding it.
1920 @node Textutils
1921 @section A deep hierarchy
1923 The GNU textutils are a collection of programs for manipulating text
1924 files.  They are distributed as a deep package.  The textutils have only
1925 recently been modified to use Automake; the examples come from a
1926 prerelease.
1928 Here is the top-level @file{Makefile.am}:
1930 @example
1931 SUBDIRS = lib src doc man
1932 @end example
1934 In the @file{lib} directory, a library is built which is used by each
1935 textutil.  Here is @file{lib/Makefile.am}:
1937 @example
1938 noinst_LIBRARIES = tu
1940 EXTRA_DIST = rx.c regex.c
1942 tu_SOURCES = error.h getline.h getopt.h linebuffer.h \
1943 long-options.h md5.h regex.h rx.h xstrtod.h xstrtol.h xstrtoul.h \
1944 error.c full-write.c getline.c getopt.c getopt1.c \
1945 linebuffer.c long-options.c md5.c memchr.c safe-read.c \
1946 xmalloc.c xstrtod.c xstrtol.c xstrtoul.c
1948 tu_LIBADD = @@REGEXOBJ@@ @@LIBOBJS@@ @@ALLOCA@@
1949 @end example
1951 The @file{src} directory contains the source for all the textutils -- 23
1952 programs in all.  The @file{Makefile.am} for this directory also
1953 includes some simple checking code, and constructs a @file{version.c}
1954 file on the fly:
1956 @example
1957 bin_PROGRAMS = cat cksum comm csplit cut expand fmt fold head join md5sum \
1958 nl od paste pr sort split sum tac tail tr unexpand uniq wc
1960 noinst_HEADERS = system.h version.h
1961 DISTCLEANFILES = stamp-v version.c
1963 INCLUDES = -I$(top_srcdir)/lib
1965 LDADD = version.o ../lib/libtu.a
1967 $(PROGRAMS): version.o ../lib/libtu.a
1969 AUTOMAKE_OPTIONS = ansi2knr
1971 version.c: stamp-v
1972 stamp-v: Makefile
1973         rm -f t-version.c
1974         echo '#include <config.h>' > t-version.c
1975         echo '#include "version.h"' >> t-version.c
1976         echo 'const char *version_string = "'GNU @@PACKAGE@@ @@VERSION@@'";' \
1977                 >> t-version.c
1978         if cmp -s version.c t-version.c; then   \
1979           rm t-version.c;                       \
1980         else                                    \
1981           mv t-version.c version.c;             \
1982         fi
1983         echo timestamp > $@@
1985 check: md5sum
1986         ./md5sum \
1987          --string="" \
1988          --string="a" \
1989          --string="abc" \
1990          --string="message digest" \
1991          --string="abcdefghijklmnopqrstuvwxyz" \
1992          --string="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" \
1993          --string="12345678901234567890123456789012345678901234567890123456789012345678901234567890" \
1994        | diff -c $(srcdir)/md5-test.rfc -
1995 @end example
1997 The @file{doc} directory builds the info documentation for the
1998 textutils:
2000 @example
2001 info_TEXINFOS = textutils.texi
2002 @end example
2004 And, last, the @file{man} directory installs the man pages for all the
2005 textutils:
2007 @example
2008 man_MANS = cat.1 cksum.1 comm.1 csplit.1 cut.1 expand.1 fmt.1 fold.1 head.1 \
2009 join.1 md5sum.1 nl.1 od.1 paste.1 pr.1 sort.1 split.1 sum.1 tac.1 tail.1 \
2010 tr.1 unexpand.1 uniq.1 wc.1
2011 @end example
2013 You can now see how easy it is to handle even a largish project using
2014 Automake.
2017 @node Future
2018 @chapter Some ideas for the future
2020 Here are some things that might happen in the future:
2022 @itemize @bullet
2023 @item
2024 HTML support.
2026 @item
2027 The output will be cleaned up.  For instance, only variables which are
2028 actually used will appear in the generated @file{Makefile.in}.
2030 @item
2031 There will be support for automatically recoding a distribution.  The
2032 intent is to allow a maintainer to use whatever character set is most
2033 convenient locally, but for all distributions to be Unicode or
2034 @w{ISO 10646} with the UTF-8 encoding.
2035 @end itemize
2038 @node Variables
2039 @unnumbered Index of Variables
2041 @printindex vr
2044 @node Configure variables
2045 @unnumbered Index of Configure Variables and Macros
2047 @printindex cv
2050 @node Targets
2051 @unnumbered Index of Targets
2053 @printindex tr
2056 @bye