There is a series of options that can be given to automake, to change its default behaviour to something that more suits the need of the single project.
These options are usually passed to the AM_INIT_AUTOMAKE
macro, but
most can also be passed via the variable
AUTOMAKE_OPTIONS
in the top-level Makefile.am
. In both
representation, it is just a space-separated list of tokens, described further on.
Since not all the options can be passed through Makefile.am
, it is
recommended to always pass the options through a call to AM_INIT_AUTOMAKE
.
Since each option (or option group) might require a different explanation in different contexts, you can use the following list as a reference for them.
1.8
, 1.9
, …,
1.12
The minimum (minor) version of automake needed to properly rebuild the current project.
This is usually only used to indicate that the project makes
use of features that have been introduced with a given
version, which means that it doesn't list micro/patch-level
versions (such as 1.12.4
), nor can it be
used to stop newer versions of
automake from rebuilding the
project.
gnu
, cygnus
,
gnits
, foreign
Choose the “flavour” to use, which specifies some further particular options and warning levels for the current project. See Section 1.1, “Automake flavours”.
silent-rules
Allows the use of Linux kernel-style “silent” output when building. See Section 3, “Silent Building with Automake”. As of automake 1.13, this option is implied by default, and is a complete no-op.
subdir-objects
Compile source files in the relative sub-directories, rather
than in the directory of the
Makefile.am
that declares them. See
Section 2, “Non-recursive Automake”.
dist-gzip
, dist-bzip2
,
dist-xz
, dist-zip
, …
Defines the archive format for the distribution of sources, as generated by make dist.
-Wgnu
, -Wportability
, …, -Werror
Enable (or disable) warning categories in automake. These options correspond to the warning options available on automake command line.
Among different projects, automake is
used with different options and settings. Some of the most
important projects have their own flavour settings supported by
automake directly, as a single
option, these are gnu
(the default),
cygnus
(removed in automake
1.13), gnits
and the final
foreign
which is meant as a "none of the
above" option.
Out of these, you generally ought to employ only two: the default
settings (which are gnu
) and the
foreign
setting. Most of your projects are
likely to use the latter, even though that is not the default,
because it relaxes some checks that are, otherwise, often worked
around in tutorials.
In particular, the gnits
standard is
non-existent, only exists as an historical reference in the GNU
web site – it may as well not exist at all for the scope of this
guide. Similarly the cygnus
flavour, used by
hierarchical tree projects such as GCC, has been deemed obsolete
starting from automake 1.12 and is no
longer accepted starting version 1.13, so it's similarly ignored
by the rest of the guide.
The two main differences between the gnu
and
foreign
flavours is that the former requires
the presence of a number of files in the top-level of the
projects, such as NEWS
,
COPYING
, AUTHORS
,
ChangeLog
,
README
. Often enough, at least the first
file in this list is just touch-ed to stop
automake from failing.
Even if you plan on using these files the way GNU does, it is
still recommended to use the foreign
flavour, and manually list these files in
Makefile.am
so that they are actually
installed in the correct place; the gnu
flavour only requires them to be distributed, not to be
actually installed.
Another important setting that changing the flavour achieves is disabling some of the portability warnings, letting you cleanly use the GNU make extensions, which makes it much cleaner, nicer and faster to write proper build systems.