公布生成cscope.out, cscope.files, tags的脚本文件

来源:互联网 发布:java子线程sleep 编辑:程序博客网 时间:2024/06/10 03:51

通过VIM搭建一个IDE,网上的文章有很多,这里就不献丑了。

下面记录下生成tags,cscope.out, cscope.files的脚本文件

一、windows版本(.bat)

del cscope.out cscope.files tagsecho del "cscope.out cscope.files tags" successful!echo "ctags create"ctags --languages=c --langmap=c:+.h --extra=+q -Recho "cscope create"dir /s /b *.c *.h > cscope.filescscope -bCkR -i cscope.files

注意:

1. 执行上面的脚本前,请确保正确安装了ctags.exe和cscope.exe,并配置到了环境变量PATH下。

2. windows下生成的cscope.files中的路径是绝对路径


针对lvr的生成脚本:

@echo offgoto start1. 获取当前路径2. 得到cscope.files的全路径3. 删除原来生成的文件4. 将lib的源文件加入cscope.files5. 将lvr的源文件加入cscope.files6. 利用cscope建立索引数据库:startset curpath=%cd%set csfile=%curpath%\cscope.filesdel tags cscope.out cscope.filesctags --languages=c --langmap=c:+.h --extra=+q -Rset libpath=%curpath%\..\..\lib_new_guicd %libpath%\trunk\platform_x2dir /s /b *.c *.h > %csfile%cd %curpath%dir /s /b *.c *.h >> %csfile%cscope -bCkR -i %csfile% -I%libpath%


-----------------------------------------------------------------------------------------------------------------------------


二、Linux版本(.sh)

#!/bin/bashecho "delete cscope.files, cscope.out, tags"rm -f cscope.files cscope.out tagsecho "create cscope.files"find . -name '*.h' -o -name '*.c' > cscope.filesecho "cscope add cscope.files"cscope -bCkR -i cscope.filesecho "create tags"ctags --languages=c --langmap=c:+.h --extra=+q -R


注意:

linux下生成的cscope.files中的路径是相对路径,由find后的路径决定,所以一般在vim的配置中不使用"set autochdir"!


原创粉丝点击