#!/bin/sh

set -e

outdir=${ADT_ARTIFACTS-/tmp/pyml}
indir="debian/tests"
input="hello.ml"
mkdir -p ${outdir}
cp ${indir}/${input} ${outdir}
cd ${outdir}

ocamlfind ocamlc -package pyml -linkpkg -o hello.byte hello.ml
./hello.byte

if [ -x /usr/bin/ocamlopt ]; then
    ocamlfind ocamlopt -package pyml -linkpkg -o hello.opt hello.ml
    ./hello.opt
fi
