#!/bin/csh
#
# jasmin - runs the Jasmin assembler
# 
# Usage:
#     jasmin [-d <directory>] <filename> [<filename> ...]
#

#
# JASMIN needs to be set to the directory containing the
# Jasmin distribution. We try:
#
#     /usr/pkg/jasmin
#     ~/jasmin
#     `pwd`
#
#

if (-e /usr/pkg/jasmin) then
    set JASMIN=/usr/pkg/jasmin
else if (-e $HOME/jasmin) then
    # try the home directory
    set JASMIN=$HOME/jasmin
else
    # try the current directory
    set JASMIN=`pwd`
endif

if (! -e $JASMIN/bin/jasmin) then
    echo "Cannot find Jasmin! Check the jasmin script is looking in the right place."
else
    setenv CLASSPATH $JASMIN/classes
    exec java jasmin.Main $*
endif
