diff --git a/.bin/maketags b/.bin/maketags new file mode 100755 index 0000000..3f5a358 --- /dev/null +++ b/.bin/maketags @@ -0,0 +1,51 @@ +#!/bin/sh + +set -xe + +# create files list +find "${PWD}/"* -type f \ + \( -iname "*.c" \ + -o -iname "*.cc" \ + -o -iname "*.cpp" \ + -o -iname "*.c" \ + -o -iname "*.h" \ + -o -iname "*.hh" \ + -o -iname "*.hpp" \ + -o -iname "*.lua" \ + -o -iname "*.gmk" \ + -o -iname "*.pl" \ + -o -iname "*.sh" \ + -o -name "Makefile" \ + \) > ${PWD}/.git/files + +# include extra directories +if [ ! -z "$1" ] +then + find $@ -type f \ + \( -iname "*.c" \ + -o -iname "*.cc" \ + -o -iname "*.cpp" \ + -o -iname "*.c" \ + -o -iname "*.h" \ + -o -iname "*.hh" \ + -o -iname "*.hpp" \ + -o -iname "*.lua" \ + -o -iname "*.gmk" \ + -o -iname "*.pl" \ + -o -iname "*.sh" \ + -o -name "Makefile" \ + \) >> ${PWD}/.git/files +fi + +# create cscope database +cscope -qbkCRv -P${PWD} -f ${PWD}/.git/cscope.out -i${PWD}/.git/files + +# create tags file +ectags --sort=yes \ + --languages=C,C++,Make,Lua,Perl,Sh \ + --tag-relative=no \ + --extra=fq \ + --totals=yes \ + --exclude=.git \ + -L ${PWD}/.git/files \ + -f ${PWD}/.git/tags