# opus-:mk032
#
#	Shell script for rebuilding the ns32000 specific UNIX System.
#	This version assumes that you have already run :mk
#	for the ns32332. It will add ".332" extensions to any
#	machine dependent files and then rebuild ns32032 versions
#	of the standalone libs. Then the machine dependent commands
#	will be remade as 032 versions.
#
REL=/usr/src/local/release

trap "rm /bin/ns32332; ln /bin/true /bin/ns32332; exit 1" 1 2 3 15

# make sure links are correct
	rm /bin/ns32332
	ln /bin/false /bin/ns32332

# Add .332 extension to machine dependent cmds
LIST=`grep '.332' ${REL}/master.list | grep -v '^:' | awk '{ print $1 }' | sed 's/\.332$//'`
# Save 332 versions
echo "Saving ns32332 versions ..."
for i in $LIST
do
	rm $i
done
echo

LIBS="shlibc"
CMDS="sdb ps crash fuser whodo opus"

echo "Remaking the header files..."
./:mksyshead

#echo "Remaking the kernel..."
#./:mkuts

for i in $LIBS
do
	./:mklib $i
done

for i in $CMDS
do
	./:mkcmd $i
done
# Save 032 versions
echo "Saving ns32000 versions ..."
for i in $LIST
do
	echo "	copying $i to $i.032"
	cp $i $i.032
done
echo

# Restore links
	rm /bin/ns32332
	ln /bin/true /bin/ns32332

# Restore 332 versions on this machine
echo "Restoring ns32332 versions ..."
for i in $LIST
do
	rm $i
	echo "	copying $i.332 to $i"
	cp $i.332 $i
done
echo
exit 0
