#! /bin/sh
#
#

prog=/home2/nlt/LangLAB/src/commands
path=/home2/nlt/FSE/LangLAB-Grm
tdir=grmV62

if [ "$#" -eq 0 ]
then
	echo "Usage:  auto_make -l[Number_of_Level]"
	exit 1
fi

case "$1" in
	-l1) level=1 ;;
	-l2) level=2 ;;
	-l3) level=3 ;;
	-l4) level=4 ;;
	-l5) level=5 ;;
	-l6) level=6 ;;
	-l7) level=7 ;;
	-l8) level=8 ;;
	-l9) level=9 ;;
	-l10) level=10 ;;
	-l11) level=11 ;;
	-l12) level=12 ;;
	*) echo "Bad argument; please specify a number from amoung 1 to 12."
	   exit 1 ;;
esac

cpath="$path"/"$tdir"/

if [ "$#" -eq 1 ]
then
	echo ">> Grammar File: $cpath``LUG_L_L$level.dcg <<"
	"$prog"/gtr "$cpath"LUG_L_L"$level".dcg
	echo ">> Dictioanary File: $cpath``DICT_L_L$level.dcg <<"
	"$prog"/dtr "$cpath"DICT_L_L"$level".dcg
else
	echo ">> Ignored the command <<"
fi
