From 592af901e2175b786b7e5e440c378ca9eac13b5f Mon Sep 17 00:00:00 2001 From: "Sunrin SHIMURA (keen)" <3han5chou7@gmail.com> Date: Sun, 18 Jan 2015 04:10:57 +0000 Subject: [PATCH] update profiling build script --- etc/build.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/etc/build.sh b/etc/build.sh index d8b62a10..d2312959 100755 --- a/etc/build.sh +++ b/etc/build.sh @@ -1,9 +1,12 @@ -#!/usr/bin/zsh -project_root=$(dirname $(pwd)) -for f in ${project_root}/src/*.c ${project_root}/extlib/benz/*.c ${project_root}/contrib/**/*.c;do - cc -c -O2 -pg -std=c99 -I${project_root}/extlib/benz/include $f -o `basename $f`.o & +#!/bin/sh +set -e +: ${GCC:=gcc} +project_root=$(cd $(dirname $0); cd ../; pwd) + +for f in ${project_root}/src/*.c ${project_root}/extlib/benz/*.c $(find ${project_root}/contrib/* -name '*.c');do + ${GCC} -c -O2 -pg -std=c99 -I${project_root}/extlib/benz/include $f -o `basename $f`.o & done wait -cc main.c.o $(find . -maxdepth 1 -name '*.o' | grep -v main.c.o | grep -v load_piclib.c.o | grep -v init_contrib.c.o) load_piclib.c.o init_contrib.c.o \ +${GCC} main.c.o $(find . -maxdepth 1 -name '*.o' | grep -v main.c.o | grep -v load_piclib.c.o | grep -v init_contrib.c.o) load_piclib.c.o init_contrib.c.o \ -O2 -I${project_root}/extlib/benz/include -std=c99 -pg -lm -lreadline -o picrin rm *.o