1GTAGS(1)                    General Commands Manual                   GTAGS(1)
2
3
4

NAME

6       gtags - create tag files for global.
7

SYNOPSIS

9       gtags [-ciIOqvw][-f file][-n number][dbpath]
10

DESCRIPTION

12       Gtags recursively collect the source files under the current directory,
13       pickup symbols and  write  the  cross-reference  data  into  tag  files
14       (´GTAGS´, ´GRTAGS´, ´GSYMS´ and ´GPATH´).  You should execute this com‐
15       mand at the root of the source tree.
16
17       C, C++, yacc, java, PHP and Assembly source files are supported.  Files
18       whose  names  end  in  ´.c´  or  ´.h´ are assumed to be C source files.
19       Files whose names end in ´.c++´ ´.cc´ ´.cpp´ ´.cxx´ ´.hxx´ ´.hpp´  ´.C´
20       ´.H´ are assumed to be C++ source files.  Files whose names end in ´.y´
21       are assumed to be YACC source files.  Files whose names end in  ´.java´
22       are  assumed  to be Java source files.  Files whose names end in ´.php´
23       ´.php3´ ´.phtml´ are assumed to be PHP source files.  Files whose names
24       end  in  ´.s´  or  ´.S´ are assumed to be Assembly source files.  Other
25       files are assumed to be text files.
26

OPTIONS

28       The following options are available:
29
30       -c, --compact
31              Make GTAGS in compact format.  This option  does  not  influence
32              GRTAGS  and  GSYMS, because they are always made in compact for‐
33              mat.
34
35       --config[=name]
36              Show the value of config variable name.  If name is  not  speci‐
37              fied then show whole of config entry.
38
39       -f, --file file
40              Read  from  file a list of file names which should be considered
41              as the candidate of source files.  By default, all  files  under
42              the  current directory are considered as the candidate.  If file
43              is ´-´, read from standard input.  File names must be  separated
44              by newline.
45
46       --gtagsconf file
47              Load user's configuration from file.
48
49       --gtagslabel label
50              label  is  used as the label of configuration file.  The default
51              is default.
52
53       -I, --idutils
54              Make index files for idutils(1) too.
55
56       -i, --incremental
57              Update tag files incrementally. You  had  better  use  global(1)
58              with the -u option.
59
60       -n, --max-args number
61              Maximum  number  of  arguments for gtags-parser(1).  By default,
62              gtags invokes gtags-parser with arguments as many as possible to
63              decrease the frequency of invoking.
64
65       -O, --objdir
66              Use  objdir as dbpath.  If ´$MAKEOBJDIRPREFIX´ directory exists,
67              gtags creates ´$MAKEOBJDIRPREFIX/<current directory>´  directory
68              and makes tag files in it.  If dbpath is specified, this options
69              is ignored.
70
71       -q, --quiet
72              Quiet mode.
73
74       -v, --verbose
75              Verbose mode.
76
77       -w, --warning
78              Print warning messages.
79
80       dbpath The directory in which tag files are generated.  The default  is
81              the  current directory.  It is useful when your source directory
82              is on a read only device like CDROM.
83

EXAMPLES

85            $ ls -F
86            Makefile      src/    lib/
87            $ gtags -v
88            $ global -x main
89            main              10 src/main.c  main (argc, argv) {
90

FILES

92       ´GTAGS´
93              Tag file for object definitions.
94
95       ´GRTAGS´
96              Tag file for object references.
97
98       ´GSYMS´
99              Tag file for other symbols.
100
101       ´GPATH´
102              Tag file for path of source files.
103
104       ´/etc/gtags.conf´, ´$HOME/.globalrc´
105              Configuration file.
106

ENVIRONMENT

108       The following environment variables affect the execution of gtags:
109
110       GTAGSCONF
111              If this variable is set, its value is used as the  configuration
112              file. The default is ´$HOME/.globalrc´.
113
114       GTAGSLABEL
115              If  this variable is set, its value is used as the label of con‐
116              figuration file. The default is default.
117
118       GTAGSCACHE
119              If this variable is set, its value is used as the size of B-tree
120              cache. The default is 50000000 (bytes).
121
122       GTAGSFORCECPP
123              If  this  variable  is  set,  each  file  whose suffix is 'h' is
124              treated as a C++ source file.
125
126       MAKEOBJDIRPREFIX
127              If this variable is  set,  ´$MAKEOBJDIRPREFIX´  is  used  as  an
128              object prefix directory. The default is ´/usr/obj´.
129

CONFIGURATION

131       The  following  configuration  variables affect the execution of gtags.
132       You can see the default value  for  each  variable  with  the  --config
133       option.
134
135       GTAGS(string)
136              If  this  variable is set, its value is used as the command line
137              of the parser for GTAGS. The default is ´gtags-parser %s´.
138
139       GRTAGS(string)
140              If this variable is set, its value is used as the  command  line
141              of the parser for GRTAGS. The default is ´gtags-parser -r %s´.
142
143       GSYMS(string)
144              If  this  variable is set, its value is used as the command line
145              of the parser for GSYMS. The default is ´gtags-parser -s %s´.
146
147       icase_path(boolean)
148              Ignore case  distinctions  in  the  path.   Suffixes  check  are
149              affected by this capability.
150
151       langmap(comma separated list)
152              Language  mapping. Each comma-separated map consists of the lan‐
153              guage name, a colon, and a list  of  file  extensions.   Default
154              mapping                                                       is
155              'c:.c.h,yacc:.y,asm:.s.S,java:.java,cpp:.c++.cc.cpp.cxx.hxx.hpp.C.H,php:.php.php3.phtml'.
156
157       skip(comma separated list)
158              Gtags  skips  files which are listed in this list.  As a special
159              exception, gtags collect values from  multiple  skip  variables.
160              If  the value ends with '/', it assumed as a directory and gtags
161              skips all files under it.  If  the  value  start  with  '/',  it
162              assumed relative path from the root of source directory.
163
164       suffixes(comma separated list)
165              Suffixes  of  target source file.  As a special exception, gtags
166              collect values from multiple suffixes variables.  This  variable
167              is obsoleted. If the langmap variable is defined gtags no longer
168              refers this.
169

DIAGNOSTICS

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

MESSAGE FORMAT

174       Verbose message has important level. The most important level is 0, the
175       second  is  1  and  so  on.  All  the message has level numbers leading
176       blanks.
177

SEE ALSO

179       gtags-parser(1), global(1), htags(1).
180
181       GNU GLOBAL source code tag system
182       (http://www.gnu.org/software/global/).
183

BUG

185       ´GTAGS´, ´GRTAGS´ and ´GSYMS´ are very large.  In advance of using this
186       command, check the space of your disk.
187
188       Assembly  support  is  far from complete.  It extracts only ENTRY() and
189       ALTENTRY() from source file.  Probably valid only for FreeBSD and Linux
190       kernel source.
191
192       There is no concurrency control about tag files.
193

AUTHOR

195       Tama Communications Corporation.
196

HISTORY

198       The gtags command appeared in FreeBSD 2.2.2.
199
200
201
202GNU Project                      January 2009                         GTAGS(1)
Impressum