~njansson/dolfin/hpc

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh

# klocs
#
# Count the number of kilos of lines of code (klocs)
# in the directory src.
#
# This script should be run from the top level directory.
                                                                                                    
IMPL=`find dolfin -name '*.cpp' | xargs wc -l | grep total | awk '{ printf "%d", $1/1000 }'`
HEAD=`find dolfin -name '*.h'   | xargs wc -l | grep total | awk '{ printf "%d", $1/1000 }'`

TOTAL=`echo $IMPL $HEAD | awk '{ print $1 + $2 }'`

echo $HEAD' klocs in .h files'
echo $IMPL' klocs in .cpp files'
echo $TOTAL' klocs total'