#!/bin/sh
#
# usage:
#	mkbuild directoryname
#
# automates the process of generating build-tree link farms.

if [ ! "$1" ]; then
	echo
	echo "try something like"
	echo "	$0 xdvi.pl18"
	echo
	exit 1
fi

if [ ! -d "/afs/sipb/project/sipbsrc/src/$1" ]; then
	echo "oops! source directory doesn't exist!"
	exit 2
fi

if [ ! -r "/afs/sipb/project/sipbsrc/src/$1/.rconf" ]; then
	echo "Installing default '.rconf' file."
	cp "/afs/sipb/project/sipbsrc/rconf.default" "/afs/sipb/project/sipbsrc/src/$1/.rconf"
fi

if [ ! -d "/afs/sipb/project/sipbsrc/build/$1" ]; then
	echo "Creating /afs/sipb/project/sipbsrc/build/$1."
	mkdir "/afs/sipb/project/sipbsrc/build/$1"
fi

/usr/athena/etc/synctree -s "/afs/sipb/project/sipbsrc/src/$1"\
  -d "/afs/sipb/project/sipbsrc/build/$1"
