]> de.git.xonotic.org Git - xonotic/xonotic.wiki.git/blob - uploads/451835f6b1894145af06050915256048/cscope_createindex.sh
Upload attachment cscope_createindex.sh
[xonotic/xonotic.wiki.git] / uploads / 451835f6b1894145af06050915256048 / cscope_createindex.sh
1 #!/usr/bin bash
2
3 ##########################################
4 ###   user setting, change if needed   ###
5
6 compress=false
7
8 ##########################################
9
10
11
12 # NOTE: This script must reside in the main xonotic repo directory
13
14 prev_dir="$PWD"
15
16 cd $(dirname "$0")
17
18
19 cscope_args=" -b"
20
21 # don't compress
22 if ! $compress; then
23         cscope_args="$cscope_args"" -c"
24 fi
25
26 cscope_cmd="cscope"
27
28 # Windows: mingw version of cscope can't be used as it writes code path
29 # in Unix format to the index, making it broken for Windows apps that use it
30 if [ -e cscope.exe ] ; then
31         cscope_cmd="$PWD""/cscope.exe "
32         cscope_args="$cscope_args"" -X"
33 fi
34
35
36 echo 
37 echo Updating qcsrc index...
38
39 cd data/xonotic-data.pk3dir/qcsrc
40 find -name '*.inc' -or -name '*.q[ch]' > cscope.files
41 $cscope_cmd$cscope_args
42 if $compress; then
43         $cscope_cmd -L
44 fi
45 cd ../../..
46 echo " Done!"
47
48
49 echo 
50 echo Updating DP index...
51 cd darkplaces
52 $cscope_cmd$cscope_args
53 if $compress; then
54         $cscope_cmd -L
55 fi
56 cd ..
57 echo " Done!"
58
59
60 cd $prev_dir
61
62 echo 
63 read -n1 -r -p 'Press any key to exit.' key