#! /bin/csh -f

# This script installs the SunPro stuff for Sun3 systems

if (-d /usr.MC68020) then
# If this is a server we should deal with the specific directories
	set bin = /pub.MC68020/bin
	set include = /usr.MC68020/include
	set lib = /pub.MC68020/lib
	set man = /usr.MC68020/man
	set usrbin = /usr.MC68020/bin
	set sunpro = /usr.MC68020/sunpro
else 
# If this system is stand-alone we deal with the plain directories
	set bin = /bin
	set include = /usr/include
	set lib = /lib
	set man = /usr/man
	set usrbin = /usr/bin
	set sunpro = /usr/sunpro
endif

cd $sunpro

# First save the 3.2 stuff
if (-e 3.2) then
	echo Script has already been run
	exit 1
endif
mkdir 3.2
mv $lib/compile $lib/cpp $bin/ld $usrbin/m4 $bin/make 3.2
if (-f $man/man1/make.1) then
	mv $man/man1/make.1 3.2
endif

# Move the replacement progams in
mv compile $lib/compile
mv cpp $lib/cpp
mv ld $bin/ld
mv m4 $usrbin/m4
mv make $bin/make

# Install the new files we need
mv filemerge $usrbin/filemerge
if (-e $include/make == "0") then
	mkdir $include/make
endif
mv default.mk $include/make/default.mk
chmod 444 $include/make/default.mk
if (-d $man/man1) then
	mv make.1 filemerge.1 $man/man1
endif

if (-d /usr.MC68010) then
	if ($1 ==) then
		cd /usr.MC68010/sunpro
		install_sunpro recursive
	endif
endif
