automake: Tags

1 
1 18.1 Interfacing to ‘etags’
1 ===========================
1 
1 Automake will generate rules to generate ‘TAGS’ files for use with GNU
1 Emacs under some circumstances.
1 
1    If any C, C++ or Fortran 77 source code or headers are present, then
1 ‘tags’ and ‘TAGS’ rules will be generated for the directory.  All files
1 listed using the ‘_SOURCES’, ‘_HEADERS’, and ‘_LISP’ primaries will be
1 used to generate tags.  Note that generated source files that are not
1 distributed must be declared in variables like ‘nodist_noinst_HEADERS’
1 or ‘nodist_PROG_SOURCES’ or they will be ignored.
1 
1    A ‘tags’ rule will be output at the topmost directory of a
1 multi-directory package.  When run from this topmost directory, ‘make
1 tags’ will generate a ‘TAGS’ file that includes by reference all ‘TAGS’
1 files from subdirectories.
1 
1    The ‘tags’ rule will also be generated if the variable ‘ETAGS_ARGS’
1 is defined.  This variable is intended for use in directories that
1 contain taggable source that ‘etags’ does not understand.  The user can
1 use the ‘ETAGSFLAGS’ to pass additional flags to ‘etags’;
1 ‘AM_ETAGSFLAGS’ is also available for use in ‘Makefile.am’.
1 
1    Here is how Automake generates tags for its source, and for nodes in
1 its Texinfo file:
1 
1      ETAGS_ARGS = automake.in --lang=none \
1       --regex='/^@node[ \t]+\([^,]+\)/\1/' automake.texi
1 
1    If you add file names to ‘ETAGS_ARGS’, you will probably also want to
1 define ‘TAGS_DEPENDENCIES’.  The contents of this variable are added
1 directly to the dependencies for the ‘tags’ rule.
1 
1    Automake also generates a ‘ctags’ rule that can be used to build
1 ‘vi’-style ‘tags’ files.  The variable ‘CTAGS’ is the name of the
1 program to invoke (by default ‘ctags’); ‘CTAGSFLAGS’ can be used by the
1 user to pass additional flags, and ‘AM_CTAGSFLAGS’ can be used by the
1 ‘Makefile.am’.
1 
1    Automake will also generate an ‘ID’ rule that will run ‘mkid’ on the
1 source.  This is only supported on a directory-by-directory basis.
1 
1    Similarly, the ‘cscope’ rule will create a list of all the source
1 files in the tree and run ‘cscope’ to build an inverted index database.
1 The variable ‘CSCOPE’ is the name of the program to invoke (by default
1 ‘cscope’); ‘CSCOPEFLAGS’ and ‘CSCOPE_ARGS’ can be used by the user to
1 pass additional flags and file names respectively, while
1 ‘AM_CSCOPEFLAGS’ can be used by the ‘Makefile.am’.  Note that,
1 currently, the Automake-provided ‘cscope’ support, when used in a VPATH
1 build, might not work well with non-GNU make implementations (especially
11 with make implementations performing ⇒VPATH rewrites
 (autoconf)Automatic Rule Rewriting.).
1 
1    Finally, Automake also emits rules to support the GNU Global Tags
1 program (https://www.gnu.org/software/global/).  The ‘GTAGS’ rule runs
1 Global Tags and puts the result in the top build directory.  The
1 variable ‘GTAGS_ARGS’ holds arguments that are passed to ‘gtags’.
1