Go to the first, previous, next, last section, table of contents.


Miscellaneous Rules

There are a few rules and variables that didn't fit anywhere else.

Interfacing to etags

Automake will generate rules to generate `TAGS' files for use with GNU Emacs under some circumstances.

If any C, C++ or Fortran 77 source code or headers are present, then tags and TAGS targets will be generated for the directory.

At the topmost directory of a multi-directory package, a tags target file will be generated which, when run, will generate a `TAGS' file that includes by reference all `TAGS' files from subdirectories.

The tags target will also be generated if the variable ETAGS_ARGS is defined. This variable is intended for use in directories which contain taggable source that etags does not understand.

Here is how Automake generates tags for its source, and for nodes in its Texinfo file:

ETAGS_ARGS = automake.in --lang=none \
 --regex='/^@node[ \t]+\([^,]+\)/\1/' automake.texi

If you add filenames to `ETAGS_ARGS', you will probably also want to set `TAGS_DEPENDENCIES'. The contents of this variable are added directly to the dependencies for the tags target.

Automake will also generate an ID target which will run mkid on the source. This is only supported on a directory-by-directory basis.

Automake also supports the GNU Global Tags program. The GTAGS target runs Global Tags automatically and puts the result in the top build directory. The variable GTAGS_ARGS holds arguments which are passed to gtags.

Handling new file extensions

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 SUFFIXES variable.

For instance, suppose you had a compiler which could compile `.foo' files to `.o' files. Then you would add `.foo' to your suffix list:

SUFFIXES = .foo

Then you could directly use a `.foo' file in a `_SOURCES' variable and expect the correct results:

bin_PROGRAMS = doit
doit_SOURCES = doit.foo

Any given SUFFIXES go at the start of the generated suffixes list, followed by automake generated suffixes not already in the list.

Support for Multilibs

Automake has support for an obscure feature called multilibs. A multilib is a library which is built for multiple different ABIs at a single time; each time the library is built with a different target flag combination. This is only useful when the library is intended to be cross-compiled, and it is almost exclusively used for compiler support libraries.

The multilib support is still experimental. Only use it if you are familiar with multilibs and can debug problems you might encounter.


Go to the first, previous, next, last section, table of contents.