[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

12. Building documentation

Currently Automake provides support for Texinfo and man pages.

12.1 Texinfo  
12.2 Man pages  


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

12.1 Texinfo

If the current directory contains Texinfo source, you must declare it with the `TEXINFOS' primary. Generally Texinfo files are converted into info, and thus the info_TEXINFOS variable is most commonly used here. Any Texinfo source file must end in the `.texi', `.txi', or `.texinfo' extension. We recommend `.texi' for new manuals.

Automake generates rules to build `.info', `.dvi', `.ps', and `.pdf' files from your Texinfo sources. The `.info' files are built by make all and installed by make install (unless you use no-installinfo, see below). The other files can be built on request by make dvi, make ps, and make pdf.

If the `.texi' file @includes `version.texi', then that file will be automatically generated. The file `version.texi' defines four Texinfo flag you can reference using @value{EDITION}, @value{VERSION}, @value{UPDATED}, and @value{UPDATED-MONTH}.

EDITION
VERSION
Both of these flags hold the version number of your program. They are kept separate for clarity.

UPDATED
This holds the date the primary `.texi' file was last modified.

UPDATED-MONTH
This holds the name of the month in which the primary `.texi' file was last modified.

The `version.texi' support requires the mdate-sh program; this program is supplied with Automake and automatically included when automake is invoked with the --add-missing option.

If you have multiple Texinfo files, and you want to use the `version.texi' feature, then you have to have a separate version file for each Texinfo file. Automake will treat any include in a Texinfo file that matches `vers*.texi' just as an automatically generated version file.

When an info file is rebuilt, the program named by the MAKEINFO variable is used to invoke it. If the makeinfo program is found on the system then it will be used by default; otherwise missing will be used instead. The flags in the variables MAKEINFOFLAGS and AM_MAKEINFOFLAGS will be passed to the makeinfo invocation; the first of these is intended for use by the user (see section 2.5 Variables reserved for the user) and the second by the `Makefile.am' writer.

Sometimes an info file actually depends on more than one `.texi' file. For instance, in GNU Hello, `hello.texi' includes the file `gpl.texi'. You can tell Automake about these dependencies using the texi_TEXINFOS variable. Here is how GNU Hello does it:

 
info_TEXINFOS = hello.texi
hello_TEXINFOS = gpl.texi

By default, Automake requires the file `texinfo.tex' to appear in the same directory as the Texinfo source. However, if you used AC_CONFIG_AUX_DIR in `configure.in' (see section `Finding `configure' Input' in The Autoconf Manual), then `texinfo.tex' is looked for there. Automake supplies `texinfo.tex' if `--add-missing' is given.

If your package has Texinfo files in many directories, you can use the variable TEXINFO_TEX to tell Automake where to find the canonical `texinfo.tex' for your package. The value of this variable should be the relative path from the current `Makefile.am' to `texinfo.tex':

 
TEXINFO_TEX = ../doc/texinfo.tex

The option `no-texinfo.tex' can be used to eliminate the requirement for `texinfo.tex'. Use of the variable TEXINFO_TEX is preferable, however, because that allows the dvi, ps, and pdf targets to still work.

Automake generates an install-info target; some people apparently use this. By default, info pages are installed by `make install'. This can be prevented via the no-installinfo option.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

12.2 Man pages

A package can also include man pages (but see the GNU standards on this matter, section `Man Pages' in The GNU Coding Standards.) Man pages are declared using the `MANS' primary. Generally the man_MANS variable is used. Man pages are automatically installed in the correct subdirectory of mandir, based on the file extension.

File extensions such as `.1c' are handled by looking for the valid part of the extension and using that to determine the correct subdirectory of mandir. Valid section names are the digits `0' through `9', and the letters `l' and `n'.

Sometimes developers prefer to name a man page something like `foo.man' in the source, and then rename it to have the correct suffix, e.g. `foo.1', when installing the file. Automake also supports this mode. For a valid section named SECTION, there is a corresponding directory named `manSECTIONdir', and a corresponding `_MANS' variable. Files listed in such a variable are installed in the indicated section. If the file already has a valid suffix, then it is installed as-is; otherwise the file suffix is changed to match the section.

For instance, consider this example:
 
man1_MANS = rename.man thesame.1 alsothesame.1c

In this case, `rename.man' will be renamed to `rename.1' when installed, but the other files will keep their names.

By default, man pages are installed by `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 no-installman option will prevent the man pages from being installed by default. The user can still explicitly install them via `make install-man'.

Here is how the man pages are handled in GNU cpio (which includes both Texinfo documentation and man pages):

 
man_MANS = cpio.1 mt.1
EXTRA_DIST = $(man_MANS)

Man pages are not currently considered to be source, because it is not uncommon for man pages to be automatically generated. Therefore they are not automatically included in the distribution. However, this can be changed by use of the `dist_' prefix.

The `nobase_' prefix is meaningless for man pages and is disallowed.


[ << ] [ >> ]           [Top] [Contents] [Index] [ ? ]

This document was generated by Jeff Bailey on December, 24 2002 using texi2html