#!/bin/csh -f

# Install script for Site Swap Scribe
# Y. King / Summer 92

# The install program assumes you are in the directory
# with the source code. It prompts you for a directory
# in which to install the program. This should be an
# existing directory which is in your path (such as ~/bin).
# The source code is compiled and the executable left
# in the specified directory. The Postscript prologue file
# is also put in that directory, so it's a good idea to
# set up an alias so that sss will find the prologue file.

echo " "
echo "Site Swap Scribe Installation"
echo -n "Install in which directory: "

set sss_dir = $<

if (! -d $sss_dir) then
	echo $sss_dir "is not a directory. Installation aborted"
else
	if (! -e sss.c) then
		echo "Can't find sss.c. Installation aborted"
	else
		echo -n "Compiling ... "
		cc -o $sss_dir/sss sss.c
		echo "done"
		cp sss.ps $sss_dir

		echo "Recommended alias:"
		echo "      alias sss 'sss -pspath $sss_dir/'"
		echo "Remember to reinitialize your path before"
		echo "running sss (or else the shell won't know"
		echo "where to find it."
	endif
endif
