GTAGS(29)

NAME
gtags - create tag files for global.

SYNOPSIS
gtags [-c][-i][-I][-o][-P][-q][-v][-w][dbpath]

DESCRIPTION
Gtags makes 'GTAGS', 'GRTAGS', 'GSYMS' and 'GPATH' file for global(1). Gtags trace subdirectories, read source files, locate symbols and save the information into tag files in current directory. You should execute this command at the root of the source tree. If your source directory is on a read only device like CDROM, specify dbpath of the directory on which make tag files.

C, C++, yacc, java and assembler source files are supported. Files whose names end in '.c' or '.h' are assumed to be C source files and are searched for C style routine and macro definitions. Files whose names end in '.c++' '.cc' '.cpp' '.cxx' '.hxx' '.C' '.H' are assumed to be C++ source files. Files whose names end in '.y' are assumed to be YACC source files. Files whose names end in '.java' are assumed to be Java source files. Files whose names end in '.s' or '.S' are assumed to be Assembler source files. Other files are searched for C style definitions.

OPTIONS
The following options are available:

-c, --compact
    Make tag files with compact format.

--config name
    Show the value of config variable name. If name is not specified then show whole of config entry.

--gtagsconf file
    Load user's configuration from file.

-i, --incremental
    Update tag files incrementally. You had better use global(1) with the -u option.

-I, --idutils
    Make index files for id-utils(1).

--info info
    Pass info string to external system. Currently you can use it with -P option.

-o, --omit-gsyms
    Suppress making 'GSYMS' file. Use this option if you don't use -s option of global(1).

-P, --postgres
    Use postgres database system instead of db(3). you can pass info string to PQconnectdb(3) using --info option.

-q, --quiet
    Quiet mode.

-v, --verbose
    Verbose mode.

-w, --warning
    Print warning messages.

EXAMPLES
	% ls -F
	Makefile      src/    lib/
	% gtags -v
	% global -x main
	main              10 src/main.c  main (argc, argv) {

FILES

'GTAGS'
    Tag file for function definitions.

'GRTAGS'
    Tag file for function references.

'GSYMS'
    Tag file for other symbols.

'GPATH'
    Tag file for path of source files.

'/etc/gtags.conf', '$HOME/.globalrc'
    Configuration file.

ENVIRONMENT
The following environment variables affect the execution of gtags:

GTAGSCONF
    If this variable is set, its value is used as the configuration file. The default is '$HOME/.globalrc'.

GTAGSLABEL
    If this variable is set, its value is used as the label of configuration file. The default is default.

CONFIGURATION
The following configuration variables affect the execution of gtags:

GTAGS(string)
    If this variable is set, its value is used as the command line of parser for GTAGS. The default is 'gctags %s'.

GRTAGS(string)
    If this variable is set, its value is used as the command line of parser for GRTAGS. The default is 'gctags -r %s'.

GSYMS(string)
    If this variable is set, its value is used as the command line of parser for GSYMS. The default is 'gctags -s %s'.

skip(comma separated list)
    Gtags skips files which listed in this list. As a special exception, gtags collect values from multiple skip variables. If the value ends with '/', it assumed as a directory and gtags skips all files under it. If the value start with '/', it assumed relative path from the root of source directory. By default, it assumes GPATH, GTAGS, GRTAGS, GSYMS, HTML/, tags, TAGS, ID, y.tab.c, y.tab.h, SCCS/, RCS/, CVS/, CVSROOT/, .deps/.

suffixes(comma separated list)
    Suffixes of target source file. As a special exception, gtags collect values from multiple suffixes variables. By default, it assumes c, h, y, c++, cc, cpp, cxx, hxx, C, H, s, S, java.

format(standard|compact)
    Format of tag files. The default is standard. Compact format is same to -c(--compact).

icase_path(boolean)
    Ignore case distinctions in the path. Suffixes check are affected by this capability.

sed_command(string)
    Use specified sed(1) command, which is used internally.

sort_command(string)
    Use specified sort(1) command, which is used internally.

DIAGNOSTICS
Gtags exits with a non 0 value if an error occurred, 0 otherwise.

SEE ALSO
btreeop(1), gctags(1), global(1), htags(1).

GNU GLOBAL source code tag system
(http://www.gnu.org/software/global/).

BUG
'GTAGS', 'GRTAGS' and 'GSYMS' are very large. In advance of using this command, check the space of your disk.

Assembler support is far from complete. It extracts only ENTRY() and ALTENTRY() from source file. Probably valid only for FreeBSD and Linux kernel source.

There is no concurrency control about tag files.

Symbols in assembler source files are not extracted for 'GSYMS'.

Please be careful of info string using --info option. Info string is passed to external system as is. If you mistake the value then program may abort with core dump.

AUTHOR
Shigio Yamaguchi

HISTORY
The gtags command appeared in FreeBSD 2.2.2.