Skip to content

Instantly share code, notes, and snippets.

@yunusemreayhan
Created August 15, 2019 20:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yunusemreayhan/40bbedd8dd7243eb18db3a0cb73ac09a to your computer and use it in GitHub Desktop.
Save yunusemreayhan/40bbedd8dd7243eb18db3a0cb73ac09a to your computer and use it in GitHub Desktop.
builds cscope database into project folder, this one is only for kernel
#!/bin/bash
cur_dir=`pwd`
project_dir=$1
cscope_dir=${project_dir}/cscope
rm -rf ${cscope_dir}
mkdir -p ${cscope_dir}
find ${project_dir}/ -type f \( \
-name *.c \
-o -name *.h \
-o -name *.hh \
-o -name *.cc \
-o -name *.cpp \
-o -name *.cxx \
-o -name *.hxx \
-o -name *.hpp \
\) > ${cscope_dir}/cscope.files
cd ${cscope_dir}
cscope -b -q -k -i ${cscope_dir}/cscope.files # at the directory with 'cscope.files'
cd ${cur_dir}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment