#!/bin/sh

# usage: compile.sh compiler exe source options...
cc="$1"
exe=`dirname "$2"`
exe=`cd "$exe" ; pwd`/`basename "$2"`
src="$3"
shift ; shift ; shift

root=`dirname "$0"`
root=`cd "$root" ; pwd`
"$cc" "$src" -o "$exe" $LOADLIBES "$@" || exit $?
if [ "X$exe" != "X$root/print_tokens2/source/print_tokens2.exe" ] ; then
    cp "$exe" "$root/print_tokens2/source/print_tokens2.exe"
fi
exit 0
