#!/bin/bash
DIR="$(dirname "$(readlink -f "$0")")"
SRC_ROOT=$DIR/../..

compiler="gcc"
build_type="debug"

case "$1" in
    release)
	build_type="release"
	SPARK_ARGS="${@:2}"
        ;;
    debug)
	SPARK_ARGS="${@:2}"
        ;;
    *)
	SPARK_ARGS="${@:1}"
        ;;
esac
build_path="$($DIR/../sparkd_path.sh build $compiler $build_type)"
(cd $build_path/server && ./sparkd $SPARK_ARGS)

