#! /bin/sh
# The SPIMS software is covered by a license. The use of the software
# represents acceptance of the terms and conditions in the license.
# ******************************************************************
# Copyright (c) 1989, Swedish Institute of Computer Science
# Parameter 1: relative path name
# parameter 2: path name
CONSTANT="Makefile RCS README TAGS autoconf benchmarks bin composers \
config dist doc filters h infile initiators make outfile \
protoaddrs protocols responders runs src test"
PROTOCOLS="ftam ftp isoros null psap ssap sunrpc tcprpc tcp tsap udp vmtp"

if [ $# != 2 ]; then
	echo 'Usage: new_machine <origin directory> <OBJ directory>'
	exit 1
fi
if [ -d $1 ]; then
	for i in $CONSTANT; do
		ln -s $1/$i .
	done
	for i in $PROTOCOLS; do
		mkdir $i
		(cd $i; ln -s ../$1/$i/Makefile .
		ln -s ../$1/$i/make .; echo >makefile.conf) 
	done
	if [ -d $2 ]; then
		ln -s $2 OBJ
	else
		echo 'Not a directory' $2
		exit 2
	fi
else
	echo 'Not a directory' $1
	exit 2
fi
