mktags find cpp
[arrow.git] / conf_slk120 / bin / .bin / shell / mktags
blob61ad3707d588dff0a8e6308ea0e23bfd53f98be3
1 #! /bin/sh
2 # pls put it under /usr/local/bin
3 # mktags [cscope [-k]]
4 #now do cscope
5 [ -a tags ] && rm -f tags
6 #rm -f tags
7 [ -a cscope.out ] && rm -f cscope.out
8 if [ "$1" = "cscope" ]; then
9 shift
10 containkernel=$1
11 flagscscope="-R -b "
12 if [ "$containkernel" = "-k" ]; then
13 #if mode include kernel path, in cscope did not contain -k will searh kernel path default
14 cscope $flagscscope 2>/dev/null
15 else
16 cscope $flagscscope -k 2>/dev/null
18 ret=$?
19 if [ "$ret" != "0" ]; then
20 echo "can not make cscope here"
21 #echo "$ret"
22 exit 1
23 else
24 echo "make cscope success -_-"
28 #now do ctags
29 find . -name "*.[ch]" -o -name "*.cpp" | xargs ctags -a 2>/dev/null
30 ret=$?
31 if [ "$ret" != "0" ]; then
32 echo "here not exists soure files"
33 exit 2
35 echo "make ctags success :-)"
36 exit 0