#!/bin/bash

TARGET=main.native
INCLUDE_DIRS=src/frontend,src/pre,src/pre/interval,src/verify,src/vlang,src/util,src/checker,src/exploit,src/repair

function clean
{
	ocamlbuild -clean
	exit 0
}

while [ $# -ne 0 ] && [ ! -z $1 ]; do
	case $1 in
		debug|clean|rebuild) "$1" ;;
		*) echo "build: invalid argument $1" && exit 1 ;;
	esac
	shift
done


time ocamlbuild src/$TARGET -use-ocamlfind -tag thread -Is $INCLUDE_DIRS
