#!/bin/tcsh -f
#(ie run the tshell on this but don't read the .cshrc or .tcshrc)

echo version = 1.01 of compile-evj 2017 Dec 17
# 2017 Dec 17, 1.01: remove LECB
# 2005 Jul 12, 1.00: origin 

set msg1 = "See the Download and Compile instructions at"
set msg2 = "https://alum.mit.edu/www/toms/paper/ev/evj"

echo
echo "Compile the Evj program."
echo "For help, see $msg2."
echo
echo "First we check that this is the evjava directory."

set pwd = `pwd|tr '/' '\n'| tail -1`

if ("$pwd" != "evjava") then
   echo
   echo "***** We are in the directory"
   echo "***** `pwd`"
   echo "***** which is not the evjava directory."
   echo "***** Can we see the evjava directory from here?"
   if (-d evjava) then
      echo "***** Yes\!  Let's go there:"
      cd evjava
      set pwd = `pwd|tr '/' '\n'| tail -1`
      if ("$pwd" != "evjava") then
         echo "***** No, something went wrong."
         echo "***** $msg1"
         echo "***** $msg2"
         exit
      else
         echo "***** That worked\!"
      endif
   else
      echo "***** No.  Giving up."
      echo "***** $msg1"
      echo "***** $msg2"
      exit
   endif
   echo
endif
echo "Compiling in directory"
echo "`pwd`"
echo

echo "Removing the previously compiled class files of Evj."

rm -f *.class

echo "Compiling Evj ---------------------"

javac -deprecation -source 1.3 -target 1.3 Evj.java

echo "Running Evj   ---------------------"
# java -enableassertions Evj &
java Evj &

echo done at `date`

