# !/bin/sh

VMLANG="vmlang"
VMASM="vmasm"
VMLINK="vmlink"
VMOBJDUMP="vmobjdump"
VMACHINED="vmachined"
VMLIBVMRT="libvmrt"
VMTEST="vm-test"
VMLIBTEST="vm-lib-test"
BIN="bin"
LN="ln"


if [ ! -e $VMLANG/$VMLANG ] || [ ! -e $VMASM/$VMASM ] || [ ! -e $VMLINK/$VMLINK ]; then
	echo "can't find executables"
	return 1
fi

if [ ! -e $VMOBJDUMP/$VMOBJDUMP ] || [ ! -e $VMACHINED/$VMACHINED ]  || [ ! -e $VMLIBVMRT/$VMTEST ] || [ ! -e $VMLIBVMRT/$VMLIBTEST ]; then
	echo "can't find executables"
	return 1
fi

if [ ! -d $BIN ] ; then
	echo "can't find bin folder"
	return 1
fi

$LN -s ../$VMLANG/$VMLANG $BIN/$VMLANG > /dev/null 2>&1
$LN -s ../$VMASM/$VMASM $BIN/$VMASM > /dev/null 2>&1
$LN -s ../$VMLINK/$VMLINK $BIN/$VMLINK > /dev/null 2>&1
$LN -s ../$VMOBJDUMP/$VMOBJDUMP $BIN/$VMOBJDUMP > /dev/null 2>&1
$LN -s ../$VMACHINED/$VMACHINED $BIN/$VMACHINED > /dev/null 2>&1
$LN -s ../$VMLIBVMRT/$VMTEST $BIN/$VMTEST > /dev/null 2>&1
$LN -s ../$VMLIBVMRT/$VMLIBTEST $BIN/$VMLIBTEST > /dev/null 2>&1

export PATH="$PATH:$PWD/$BIN"

