Next: Handling new file extensions, Up: Miscellaneous Rules [Contents][Index]
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
rules will be generated for the directory.
All files listed using the _SOURCES
, _HEADERS
, and
_LISP
primaries will be used to generate tags. Note that
generated source files that are not distributed must be declared in
variables like nodist_noinst_HEADERS
or
nodist_prog_SOURCES
or they will be ignored.
At the topmost directory of a multi-directory package, a tags
rule will be output which, when run, will generate a TAGS file
that includes by reference all TAGS files from subdirectories.
The tags
rule 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. The user can use the ETAGSFLAGS
to pass additional
flags to etags
; AM_ETAGSFLAGS
is also available for use
in Makefile.am.
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
rule.
Automake also generates a ctags
rule which can be used to
build vi
-style tags files. The variable CTAGS
is the name of the program to invoke (by default ‘ctags’);
CTAGSFLAGS
can be used by the user to pass additional flags,
and AM_CTAGSFLAGS
can be used by the Makefile.am.
Automake will also generate an ID
rule 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
rule runs Global Tags
automatically and puts the result in the top build directory. The
variable GTAGS_ARGS
holds arguments which are passed to
gtags
.
Next: Handling new file extensions, Up: Miscellaneous Rules [Contents][Index]