Saturday, February 20, 2010

How to create CTAGS



   CTAGS is one of the most important tool for C programmers. CTAGS allows us to traverse the code easily and very fastly.  A good programmer will feel his hands cuffed without the CTAGS setting.  The following guidelines tells how to create CTAGS.

1.  Dowload the CTAGS from the site: http://ctags.sourceforge.net/    You will get a file with the name ctags-5.8.tar.gz .

2. Unzip the file using the below command:

     #gunzip ctags-5.8.tar.gz


     On doing the above, ctags-5.8.tar will gets created.


3. Untar the tar file:

     # tar -xvf ctags-5.8.tar

4. On doing the above, a folder ctags-5.8 would have got created. And inside the folder, you would find a file named configure. Run the file:

     # ./configure


   [Note: if you get any error at this step, check at your command prompt to ensure these variables are not defiend: CC, CFLAGS, LDFLAGS]


 5. On doing the above, a Makefile gets created. Now run the make file:

   # make


6. The above step would have created an exe with the name ctags in the same folder. Do cd and reach the directory where the C files are present. Now, the ctags needs to be run on all the C files in the following way.

   # ctags *.c



No comments:

Post a Comment