1、下载GLOBAL
http://www.gnu.org/software/global/global.html
http://www.gnu.org/software/global/globaldoc.html
2、编译安装
./configure --prefix=[your install dir]
make
make install
3、使用时注意先gtags后htags,如果直接执行htags会提示找不到gtags。
如果是在普通用户权限安装global,比如--prefix=/work/yourname/usr目录下,安装以后有如下目录:bin,include,lib,share,需将bin目录设置到~/.bashrc中,这样就可以在任何路径下使用gtags和htags了。
$cd your_src_dir
$gtags # make tag files(GTAGS,GRTAGS,GSYMS)
$htags -v #make hypertext(HTML/)
这样,打开HTML下的index.html文件就可以开始浏览了。
"htags -fcFnvta"生成ghtml,并将它们放入apache的html目录。 -f(支持cgi动态搜索) -c(压缩生成html) -F(使用frame风格) -n(行号) -a(制作Function索引) -t(欢迎标题:随意输入"Welcome into kernel tour"). ",可以直接用htags -Fnvta或者gtags -v && htags -sofFnvaIht 'welcome to android eclair tour'
$ gtags -v $ htags -sanohITvt 'Welcome to XXX source tour!' $ firefox HTML/index.html $ htags --suggest $ cflow --tree --format=posix *.[ch] >cflow.out $ htags --cflow=cflow.out
4、gtags+htags+vim非常强大的功能!!此工具下,再多的源码都变得渺小了!相见恨晚啊!哈哈!
$ cp /work/yourname/usr /share/gtags/gtags.vim $HOME/.vim/plugin
$ cp /work/yourname/usr /share/gtags/gtags-cscope.vim $HOME/.vim/plugin
在使用前还需在src源码目录下执行gtags,否则,一样提示说找不到
Gtags-cscope: GTAGS not found.
Press ENTER or type command to continue
5、global+doxygen+firefox搭建
doxygen下载
http://www.stack.nl/~dimitri/doxygen/
HELP DOC:
http://www.gnu.org/software/global/globaldoc.html
You can use GLOBAL as the source browser of Doxygen.
Doxygen Release 1.4.3 or later has config option USE_HTAGS. When enabled in combination with SOURCE_BROWSER=YES, htags(1) is used as the source browser instead of Doxygen's own.
Here is an example.
(in source directory)
$ doxygen -g
$ vi Doxyfile
+---------------------------------
|...
|INPUT = .
|RECURSIVE = YES
|SOURCE_BROWSER = YES
|USE_HTAGS = YES
|...
$ doxygen
$ lynx html/index.html
http://hi.csdn.net/attachment/201006/1/0_1275399358An8n.gif
http://hi.csdn.net/attachment/201006/1/0_1275399399MamX.gif