Debian Codegraph @

utils/scripts/klocs

raw
1 #!/bin/sh
2
3 # klocs
4 #
5 # Count the number of kilos of lines of code (klocs)
6 # in the directory src.
7 #
8 # This script should be run from the top level directory.
9
10 IMPL=`find dolfin -name '*.cpp' | xargs wc -l | grep total | awk '{ printf "%d", $1/1000 }'`
11 HEAD=`find dolfin -name '*.h' | grep -v elements | grep -v ffc-forms | xargs wc -l | grep total | awk '{ printf "%d", $1/1000 }'`
12
13 TOTAL=`echo $IMPL $HEAD | awk '{ print $1 + $2 }'`
14
15 echo $HEAD' klocs in .h files'
16 echo $IMPL' klocs in .cpp files'
17 echo $TOTAL' klocs total'