File: count_total_lines_of_compiled_code.sh

package info (click to toggle)
lyx 2.0.3-3
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 96,552 kB
  • sloc: cpp: 388,556; python: 19,985; ansic: 9,725; sh: 5,696; makefile: 3,907; pascal: 1,388; objc: 985; perl: 319; yacc: 289; tcl: 163; xml: 23; sed: 16
file content (39 lines) | stat: -rwxr-xr-x 1,178 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash

qt=$QTDIR/include
build=../../../build

inc="-I$qt -I$qt/QtCore -I$qt/QtGui"
inc="$inc -I$build/src"
inc="$inc -I$build/src/frontends/qt4"
inc="$inc -I../../boost"
inc="$inc -I../../src"
inc="$inc -I../../src/frontends"
inc="$inc -I../../src/frontends/controllers"
inc="$inc -I../../src/frontends/qt4"

s=0
t=0
defines="-DQT_NO_STL -DQT_NO_KEYWORDS"
#for i in `find ../../src/frontends/qt4 -name '*.cpp'` ; do
#for i in `find ../../src/insets -name '*.cpp'` ; do
#for i in `find ../../src/mathed -name '*.cpp'` ; do
#for i in `find ../../src/support -name '*.cpp'` ; do
#for i in `find ../../src/graphics -name '*.cpp'` ; do
#for i in `find ../../src/graphics -name '*.cpp'` ; do
#for i in `find ../../src/support/chdir.cpp` ; do
for i in `find ../.. -name '*.cpp'` ; do
#for i in ../../src/frontends/qt4/GuiPrint.cpp ; do
#for i in ../../src/frontends/qt4/1.cpp ; do
	#echo $i
	#echo "g++ $inc $defines -E $i"
	#g++ $inc $defines -E $i > tmp/`basename $i`
	g++ $inc $defines -E $i > t
	l=`g++ $inc $defines -E $i | wc -l`
	f=`cat $i | wc -l`
	s=$[s + l]
	t=$[t + f]
	printf "%10d %10d  %-40s\n" $l $f $i
done
echo "Total: compiled: $s  real: $t  ratio:" $[s / t]