build.sh (1051B)
1 #!/usr/bin/env bash 2 3 set -e 4 cd `dirname $0`/../.. 5 ROOT=`pwd` 6 TMP=${ROOT}/build/tmp/samples/reflection 7 8 CC=${CC:-cc} 9 ${ROOT}/scripts/build.sh 10 mkdir -p ${TMP} 11 rm -rf ${TMP}/* 12 #bin/flatcc --schema --schema-length=yes -o ${TMP} test/monster_test/monster_test.fbs 13 bin/flatcc --schema -o ${TMP} test/monster_test/monster_test.fbs 14 15 cp samples/reflection/*.c ${TMP} 16 cd ${TMP} 17 # We don't need debug version, but it is always useful to have if we get 18 # assertions in the interface code. 19 $CC -g -I ${ROOT}/include bfbs2json.c -o bfbs2jsond 20 $CC -O3 -DNDEBUG -I ${ROOT}/include bfbs2json.c -o bfbs2json 21 cp bfbs2json ${ROOT}/bin/bfbs2json 22 echo "generating example json output from monster_test.fbs schema ..." 23 ${ROOT}/bin/bfbs2json ${TMP}/monster_test.bfbs > monster_test_schema.json 24 cat monster_test_schema.json | python -m json.tool > pretty_monster_test_schema.json 25 echo "test json file located in ${TMP}/monster_test_schema.json" 26 echo "pretty printed file located in ${TMP}/pretty_monster_test_schema.json" 27 echo "bfbs2json tool placed in ${ROOT}/bin/bfbs2json"