#!/bin/bash

#
# lejoslink: Java tool to link java programs for LeJOS
#
# 12/12/02  created L. Griffiths

if [ -z "$LEJOS_HOME" ]; then 
  LEJOS_HOME="$(dirname $(dirname $0))"
fi

if [ $OSTYPE == "cygwin" ]; then
  SEP=";"
else
  SEP=":"
fi

THIRDPARTY_LIBS="$LEJOS_HOME/3rdparty/lib"
LINK_CLASSPATH=.$SEP$THIRDPARTY_LIBS/bcel-5.1.jar$SEP$THIRDPARTY_LIBS/commons-cli-1.0.jar$SEP$LEJOS_HOME/lib/jtools.jar$SEP$LEJOS_HOME/lib/classes.jar$SEP$LEJOS_HOME/lib/rcxcomm.jar

java -classpath "$LINK_CLASSPATH" js.tinyvm.TinyVM --writeorder BE --classpath "$LINK_CLASSPATH" "$@"
