#! /bin/sh
#
#       hat-trans script for performing the trace transformation
#	on a Haskell'98 source file.  The original Module.hs
#	is supplemented with Module.T.hs.
#
# HATBINDIR is where to find driver scripts,
# HATLIBDIR is where to find executable programs and libraries,
# HATINCDIR is where to find the hx files for the standard libraries,
# MACHINE is used to choose which architecture's binaries and
#               libraries to use.

HATBINDIR=${NHC98BINDIR-/usr/bin}
HATLIBDIR=${NHC98LIBDIR-/usr/lib/hat}
MACHINE=alpha-Linux

# -- HATINCDIR is blank when building the hat library, but must be set to
# -- the installed location of the .hx files afterwards.
HATINCDIR=/usr/include/hat

# -- Determine whether any of the input files are literate haskell.
unlit=""
for arg in "$@"
do
  case $arg in
    *.lhs) unlit="-unlit";;
  esac
done

# -- Now call the real program.
exec $HATLIBDIR/$MACHINE/`basename $0` -P$HATINCDIR $unlit "$@"
exit 0	# never reached...
