cscope

cscope” is an Linux utility that helps in searching files , patterns ,function definitions etc. within a source code repository.

source code can be of c, c++, Java, tcl scripting etc

  1. Goto Source code folder
  2. create a folder as “cscope”
  3. create a script as “bldcscope”
  4. add below content to the above script.

 

——————————-bldcscope——————————————

#!/bin/sh

#if you have clearcase view below if case is valid – else delete this fi-else block
CC_VIEW=cleartool pwv -s
if [ “$CC_VIEW” = “** NONE **” ]
then
echo “ERROR::No Clearcase view Set. Exiting…”
exit
fi

SRC_DIRS=”ADD PATH_SRC”
CSCOPE_FILES=/tmp/$CC_VIEW-cscope-files1.txt

echo “Creating tmp file $CSCOPE_FILES for Source files from $SRC_DIRS”
find $SRC_DIRS ( -iname “.c” -o -iname “.h” ) > $CSCOPE_FILES

echo “Building Cscope Index Files”
cscope -bqRi $CSCOPE_FILES

echo “Building Ctags Index Files”
rm -f ./tags
ctags -f ./tags -L $CSCOPE_FILES

echo “Removing tmp file $CSCOPE_FILES”
rm -f $CSCOPE_FILES

——————————-End——————————————