: GRZSYSGEN - generate full GR-Z Version 3 or just S Support
: ${GRZ?}  ${SHOME?}  ${L?}
if test ! -f $SHOME/.GRZSTEP 
	then echo 1G >$SHOME/.GRZSTEP; fi
while true
	do
	case `cat $SHOME/.GRZSTEP` in
	1G)	echo Step 1G: Initialization for GR-Z Graphics
		if test ! -d $L
			then mkdir $L; fi
		if test ! -d $SHOME/graph; then mkdir $SHOME/graph $SHOME/graph/bin $SHOME/graph/lib; fi
		echo 2G >$SHOME/.GRZSTEP
		;;
	2G)	echo Step 2G: PSL Library to Support GR-Z
		PSLSYSGEN || exit 1
		echo 3G >$SHOME/.GRZSTEP
		;;
	3G)	echo Step 3G: Graphics Library - grz
		cd $GRZ
		if COMPILEALL && LIBRARY $L/grz.a
			then
			echo grz Library Created
			else
			echo ERROR in grz Library Creation; exit 1 
			fi
		echo 4G >$SHOME/.GRZSTEP
		;;
	4G)	if test $1x = QPE-Supportx; then exit 0; fi
		echo Step 4G: Graphics Library - device independent code
		cd $GRZ/../indsource
		if MAKE
			then
			echo Device Independent Library Created
			else
			echo ERROR in Device Independent Library Creation; exit 1 
			fi
		echo 5G >$SHOME/.GRZSTEP
		echo GR-Z is now sufficient to support S
		;;
	5G)	if test $1x = S-Supportx; then exit 0; fi
		echo Step 5G: Stand-alone Graphics Commands - pf, rdpen, show
		cd $GRZ/../pfsource
		if MAKEALL
			then
			echo Stand-alone Commands created
			else
			echo ERROR in Creating Stand-alone Commands; exit 1
			fi
		echo 6G >$SHOME/.GRZSTEP
		;;
	6G)	echo Step 6G: GR-Z Example Routine Library - ex
		cd $GRZ/../ex
		if COMPILEALL && LIBRARY ex
			then
			echo GR-Z Example library created
			else
			echo ERROR in Example Library creation exit 1 
			fi
		echo 7G >$SHOME/.GRZSTEP
		;;
	*)	break
	esac
	done
echo GR-Z is Complete
