#!/bin/sh

# SYNOPSIS:
# benchmark problemfile executable1 executable2 ...

# Get OS name.
OS=`uname`

# get directory name of the call of this executable

DIR=`dirname $0`;
if [ "$DIR" = "" ]; then
	DIR="Bmtool"
else
	DIR="$DIR/Bmtool"
fi

TIME=/usr/bin/time
if [ ! -x $TIME ]; then 
    echo "$0: $TIME is no valid executable."
    exit 1
fi

RULEFILE="$DIR/bmtool-extractionrules.$OS"
if [ ! -r $RULEFILE ]; then
    echo "$0: $RULEFILE is not readable; perhaps we just do not know about $OS yet?"
    exit 1
fi

# start the real Tcl-script in place of this shellscript

exec $DIR/bmtool --prefix $TIME -e $RULEFILE ${1+"$@"}
