: 'Install -- edit directory names in source files'
:
: 'cd Xinu-directory/install ; Install [-f]'
:
PATH=/bin:/usr/bin
export PATH
cd ..
DIR=`pwd`
if test "x$1" = "x4.1"
then	echo 'Removing all 4.2 binaries'
	find . -name '*.o' -exec rm {} \;
	echo 'Finished removing 4.2 binaries.'
	echo 'Type "./Install -f > Install.out"'
	echo 'to initiate installation.'
	exit
fi
if test "x$1" != 'x-f' -a $DIR = '/usr/Xinu'
then	echo 'No recompilation needed when tape is installed in'
	echo 'directory /usr/Xinu.  Type   Install -f   to force'
	echo 'recompilation if the software has been moved into'
	echo 'this directory after being installed elsewhere.'
else
	EXECUTABLE=$DIR/install/.install
	echo Xinu directory is $DIR
	MDIR=`echo $DIR|sed 's/\//\\\\&/g'`
	echo "FNAME=\`echo \$1|sed 's/.RAW//'\`" >$EXECUTABLE
	echo 'echo Installing source file $1' >>$EXECUTABLE
	echo "sed 's/{Xinu-directory}/$MDIR/g' < \$1 > \$FNAME" >>$EXECUTABLE
	chmod 755 $EXECUTABLE
	find . -name '*.RAW' -exec $EXECUTABLE {} \;
	echo 'Finished installing Xinu source files.'
	echo
	echo 'To complete installation, change to directory'
	echo "$DIR/src and execute the shell script Makeall."
fi
