Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
GTAGS(1)		    General Commands Manual		      GTAGS(1)

NAME
       gtags - create tag files	for global.

SYNOPSIS
       gtags [-ciIOqvw][-d tag-file][-f	file][-n number][dbpath]

DESCRIPTION
       Gtags recursively collect the source files under	the current directory,
       pickup symbols and  write  the  cross-reference	data  into  tag	 files
       ('GTAGS', 'GRTAGS', 'GSYMS' and 'GPATH').  You should execute this com-
       mand at the root	of the source tree.

       C, C++, yacc, java, PHP and Assembly source files are supported.	 Files
       whose  names  end  in  '.c'  or	'.h' are assumed to be C source	files.
       Files whose names end in	'.c++' '.cc' '.cpp' '.cxx' '.hxx' '.hpp'  '.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	'.php'
       '.php3' '.phtml'	are assumed to be PHP source files.  Files whose names
       end  in	'.s'  or  '.S' are assumed to be Assembly source files.	 Other
       files are assumed to be text files.

OPTIONS
       The following options are available:

       -c, --compact
	      Make GTAGS in compact format.  This option  does	not  influence
	      GRTAGS  and  GSYMS, because they are always made in compact for-
	      mat.

       --config[=name]
	      Show the value of	config variable	name.  If name is  not	speci-
	      fied then	show whole of config entry.

       -d, --dump tag-file
	      Dump  a  tag file. The output format is 'key<tab>data'.  This is
	      for debugging.

       -f, --file file
	      Read from	file a list of file names which	should	be  considered
	      as  the  candidate of source files.  By default, all files under
	      the current directory are	considered as the candidate.  If  file
	      is  '-', read from standard input.  File names must be separated
	      by newline.

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

       --gtagslabel label
	      label is used as the label of configuration file.	  The  default
	      is default.

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

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

       -n, --max-args number
	      Maximum number of	arguments for  gtags-parser(1).	  By  default,
	      gtags invokes gtags-parser with arguments	as many	as possible to
	      decrease the frequency of	invoking.

       -O, --objdir
	      Use objdir as dbpath.  If	'$MAKEOBJDIRPREFIX' directory  exists,
	      gtags  creates '$MAKEOBJDIRPREFIX/<current directory>' directory
	      and makes	tag files in it.  If dbpath is specified, this options
	      is ignored.

       --single-update file
	      Update  tag  files  for single file.  It is considered that file
	      was updated, and other files were	not updated.  The file must be
	      relative	path name from the current directory.  This option im-
	      plies the	-i option.  If the file	is new then --single-update is
	      ignored,	and  the  processing  is automatically switched	to the
	      normal incremental updating.

       --statistics
	      Print statistics information.  This option  is  valid  only  for
	      normal creation of tag files.

       -q, --quiet
	      Quiet mode.

       -v, --verbose
	      Verbose mode.

       -w, --warning
	      Print warning messages.

       dbpath The  directory in	which tag files	are generated.	The default is
	      the current directory.  It is useful when	your source  directory
	      is on a read only	device like CDROM.

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

FILES
       'GTAGS'
	      Tag file for object definitions.

       'GRTAGS'
	      Tag file for object 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  con-
	      figuration file. The default is default.

       GTAGSCACHE
	      If this variable is set, its value is used as the	size of	B-tree
	      cache. The default is 50000000 (bytes).

       GTAGSFORCECPP
	      If this variable is set,	each  file  whose  suffix  is  'h'  is
	      treated as a C++ source file.

       MAKEOBJDIRPREFIX
	      If  this	variable is set, '$MAKEOBJDIRPREFIX' is	used as	an ob-
	      ject prefix directory. The default is '/usr/obj'.

CONFIGURATION
       The following configuration variables affect the	 execution  of	gtags.
       You  can	 see the default value for each	variable with the --config op-
       tion.

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

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

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

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

       langmap(comma separated list)
	      Language mapping.	Each comma-separated map consists of the  lan-
	      guage  name,  a  colon,  and a list of file extensions.  Default
	      mapping							    is
	      'c:.c.h,yacc:.y,asm:.s.S,java:.java,cpp:.c++.cc.cpp.cxx.hxx.hpp.C.H,php:.php.php3.phtml'.

       skip(comma separated list)
	      Gtags skips files	which are 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 as-
	      sumed relative path from the root	of source directory.

       suffixes(comma separated	list)
	      Suffixes of target source	file.  As a special  exception,	 gtags
	      collect  values from multiple suffixes variables.	 This variable
	      is obsoleted. If the langmap variable is defined gtags no	longer
	      refers this.

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

MESSAGE	FORMAT
       Verbose message has important level. The	most important level is	0, the
       second is 1 and so on.  All  the	 message  has  level  numbers  leading
       blanks.

SEE ALSO
       gtags-parser(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.

       Assembly	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.

AUTHOR
       Shigio YAMAGUCHI, Hideki	IWAMOTO	and others.

HISTORY
       The gtags command appeared in FreeBSD 2.2.2.

GNU Project			September 2009			      GTAGS(1)

NAME | SYNOPSIS | DESCRIPTION | OPTIONS | EXAMPLES | FILES | ENVIRONMENT | CONFIGURATION | DIAGNOSTICS | MESSAGE FORMAT | SEE ALSO | BUG | AUTHOR | HISTORY

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=gtags&sektion=1&manpath=FreeBSD+8.1-RELEASE+and+Ports>

home | help