build.sh (634B)
1 #!/usr/bin/env bash 2 3 set -e 4 cd `dirname $0`/../.. 5 ROOT=`pwd` 6 NAME=monster 7 TMP=${ROOT}/build/tmp/samples/${NAME} 8 EX=${ROOT}/samples/${NAME} 9 10 CC=${CC:-cc} 11 CFLAGS_DEBUG="-g -I ${ROOT}/include" 12 CFLAGS_RELEASE="-O3 -DNDEBUG -I ${ROOT}/include" 13 ${ROOT}/scripts/build.sh 14 mkdir -p ${TMP} 15 rm -rf ${TMP}/* 16 bin/flatcc -a -o ${TMP} ${EX}/${NAME}.fbs 17 18 cp ${EX}/*.c ${TMP} 19 cd ${TMP} 20 21 echo "building $NAME example (debug)" 22 $CC $CFLAGS_DEBUG ${NAME}.c ${ROOT}/lib/libflatccrt_d.a -o ${NAME}_d 23 echo "building $NAME example (release)" 24 $CC $CFLAGS_RELEASE ${NAME}.c ${ROOT}/lib/libflatccrt.a -o ${NAME} 25 26 echo "running $NAME example (debug)" 27 ./${NAME}_d