aboutsummaryrefslogtreecommitdiff
path: root/flatcc/scripts/build.sh
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2023-07-16 02:03:33 +0200
committerToni Uhlig <matzeton@googlemail.com>2023-07-16 02:03:33 +0200
commitb31e4bc16d1df62b50c6f77a77041f9e7b6c906d (patch)
tree024c74c13d918aa6bde302aab6836fa33607613c /flatcc/scripts/build.sh
parentba6815ef8fb8ae472412b5af2837a7caba2799c2 (diff)
parent5a40295c4cf0af5ea8da9ced04a4ce7d3621a080 (diff)
Merge commit '5a40295c4cf0af5ea8da9ced04a4ce7d3621a080' as 'flatcc'
Diffstat (limited to 'flatcc/scripts/build.sh')
-rwxr-xr-xflatcc/scripts/build.sh37
1 files changed, 37 insertions, 0 deletions
diff --git a/flatcc/scripts/build.sh b/flatcc/scripts/build.sh
new file mode 100755
index 0000000..98cd41c
--- /dev/null
+++ b/flatcc/scripts/build.sh
@@ -0,0 +1,37 @@
+#!/bin/sh
+
+set -e
+
+HERE=`dirname $0`
+cd $HERE/..
+ROOT=`pwd`
+
+CFGFILE=${ROOT}/scripts/build.cfg
+
+if [ -e $CFGFILE ]; then
+ . $CFGFILE
+fi
+
+FLATCC_BUILD_CMD=${FLATCC_BUILD_CMD:-ninja}
+
+mkdir -p ${ROOT}/bin
+mkdir -p ${ROOT}/lib
+
+rm -f ${ROOT}/bin/flatcc
+rm -f ${ROOT}/bin/flatcc_d
+rm -f ${ROOT}/libflatcc
+rm -f ${ROOT}/libflatcc_d.a
+rm -f ${ROOT}/libflatccrt.a
+rm -f ${ROOT}/libflatccrt_d.a
+
+if [ ! -d ${ROOT}/build/Debug ] || [ ! -d ${ROOT}/build/Release ]; then
+ ${ROOT}/scripts/initbuild.sh
+fi
+
+echo "building Debug" 1>&2
+cd ${ROOT}/build/Debug && $FLATCC_BUILD_CMD
+
+if [ "$1" != "--debug" ]; then
+ echo "building Release" 1>&2
+ cd ${ROOT}/build/Release && $FLATCC_BUILD_CMD
+fi