Ubuntu 编程环境搭建

来源:互联网 发布:西安长城宽带网络 编辑:程序博客网 时间:2024/05/16 12:41

One,

apt-get install build-essential

 

http://hi.baidu.com/mrprogrammer/blog/item/294b512b17efb993023bf62f.html


Two,

1.
in synaptic install the cscope
2.
the dirctory of the project
# cscope -Rbkq
# vim file.c
then:
cs add cscope.out
...


http://dslab.lzu.edu.cn:8080/members/zhangwei/doc/cscope-HOWTO.txt
3.2 Build the database for cscope

3.2.1 the simpest method

>> cscope -Rbkq

[ -R makes Cscope parse all subdirectories, not just the current directory
  -b which tells Cscope to just build the database, then exit, otherwise,
     it will enter into the cscope comand line.
  -q causes an additional, 'inverted index' file to be created,
     which makes searches run much faster for large databases.
  -k sets Cscope's 'kernel' mode--it will not look in /usr/include for any
     header files that are #included in your source files]

3.2.2 the complex method

we can select what we want to add to the database for cscope, it is supported
with the option -i or the default file cscope.files.
in this method, we can exclude the files not useful, or include the files we
have interst on.
so we can use the command "find" to list the files you have interest on of
your
 project with the absolute path, just like this:


>> cd /
>> find /my/project/dir -name '*.java' >/my/cscope/dir/cscope.files

[by default Cscope only parses files with the .c, .h, .y, or .l extensions, so
we need to add these files have .java extensions to the cscope.files or other
files u want if u use the -i option instead]

After create a file including the "interest" files list with their absolute
paths, we can use the following command to generate the database cscope.out.

>> cscope -bkq // R?

3.2.3 Update the cscope database

if u have change some files in your project, u can use the "-U" option with
the
first method, and with the second method, u can update the file list in the
file
cscope.files or the filename u defined yourself with the "find" command. and

then
execute "cscope -bkq" command.