#!/bin/sh
# This script is only used for developement. It is removed by the 
# distribution process. 

set -e

OCAMLBUILD=${OCAMLBUILD:="ocamlbuild -tag debug -classic-display \
                          -use-ocamlfind"}

action () 
{
    case $1 in
        default) $OCAMLBUILD react.cmx ;;
        tests)   $OCAMLBUILD test/tests.otarget ;;
        js_test) shift; 
                 jsoo-build $* `opam config var js_of_ocaml:lib`/weak.js \
                            test/js_test.ml 
                 ;;
        doc)     shift; pkg-doc $* doc/api.docdir ;;
        clean)   $OCAMLBUILD -clean ;;
        *)       $OCAMLBUILD $* ;;
    esac
}

if [ $# -eq 0 ]; 
then action default ; 
else action $*; fi
