]> git.lyx.org Git - lyx.git/blob - development/tools/count_total_lines_of_compiled_code.sh
add -DQT_NO_KEYWORDS to the statistic scripts, since that's what we use in
[lyx.git] / development / tools / count_total_lines_of_compiled_code.sh
1 #!/bin/bash
2
3 qt=/usr/include/qt4
4 build=../../../build
5
6 inc="-I$qt -I$qt/QtCore -I$qt/QtGui"
7 inc="$inc -I$build/src"
8 inc="$inc -I$build/src/frontends/qt4"
9 inc="$inc -I../../boost"
10 inc="$inc -I../../src"
11 inc="$inc -I../../src/frontends"
12 inc="$inc -I../../src/frontends/controllers"
13 inc="$inc -I../../src/frontends/qt4"
14
15 s=0
16 t=0
17 #for i in `find ../../src/frontends/qt4 -name '*.cpp'` ; do
18 #for i in `find ../../src/insets -name '*.cpp'` ; do
19 #for i in `find ../../src/mathed -name '*.cpp'` ; do
20 #for i in `find ../../src/support -name '*.cpp'` ; do
21 #for i in `find ../../src/graphics -name '*.cpp'` ; do
22 #for i in `find ../../src/graphics -name '*.cpp'` ; do
23 #for i in `find ../../src/support/chdir.cpp` ; do
24 defines=-DQT_NO_STL -DQT_NO_KEYWORDS
25 for i in `find ../.. -name '*.cpp'` ; do
26         #echo $i
27         #echo "g++ $inc $defines -E $i"
28         #g++ $inc $defines -E $i > tmp/`basename $i`
29         g++ $inc $defines -E $i > t
30         l=`g++ $inc $defines -E $i | wc -l`
31         f=`cat $i | wc -l`
32         s=$[s + l]
33         t=$[t + f]
34         printf "%10d %10d  %-40s\n" $l $f $i
35 done
36 echo "Total: compiled: $s  real: $t  ratio:" $[s / t]
37