case $# in
0)echo "Usage: S LIBRARY library [files ...]"; exit 1;;
1)	lib=$1; what=*.o
	;;
*)	lib=$1; shift
	what=$*
	;;
esac
rm -f $lib
case $OpSys in
ATT)
#	The ar command on the ardent messes up if given too many .o files.
#	ar crl $lib $what
	rm -f $lib
	echo $what | tr ' ' '\012' | xargs ar cql $lib
	ar ts $lib > /dev/null
	;;
Research|Berkeley)
	ar crl $lib $what
	ranlib $lib
	;;
*)
	ar crl $lib `lorder $what | tsort`
	ranlib $lib >/dev/null 2>&1 || true
	;;
esac
