add profiling build script

Usage:
cd build
../etc/build.sh
./picrin file
gprof picirn gmon.out | less
This commit is contained in:
Sunrim KIM (keen) 2014-10-02 11:39:58 +09:00
parent b7fca32f61
commit 3bc1369007
1 changed files with 8 additions and 0 deletions

8
etc/build.sh Executable file
View File

@ -0,0 +1,8 @@
#!/usr/bin/bash
project_root=$(dirname $(pwd))
for f in ${project_root}/src/*.c ${project_root}/extlib/benz/*.c ${project_root}/contrib/**/*.c ;do
gcc -c -O2 -pg -std=c99 -I${project_root}/extlib/benz/include $f -o `basename $f`.o &
done
wait
gcc *.o -O2 -I${project_root}/src -I${project_root}/extlib/benz/include -std=c99 -pg -lm -lreadline -o picrin
rm *.o