#!/bin/sh
# makeman - script to build manual pages one at a time.
# -p indicates "pretty" - do not filter out boldface and underscoring.
# -t indicates "troff" - troff a file and send it to the printer.
#
BASE=/v/doc/coherent/manual

if [ $# -lt 1 -o $# -gt 2 ]; then
	echo Usage: makeman [-pt] filename
	exit 1
fi

if [ $# -eq 2 ]; then
	case $1 in 
		-p)	PRETTY=1
			shift;;
		-t)	TROFF=1
			shift;;
		*)	echo "makeman [-pt] filename"
			exit 1;;
	esac
fi

if [ $PRETTY ]; then
	/usr/local/bin/nroff -x -mcohman $BASE/top.r $1 > ./`basename $1`.out
else
	if [ $TROFF ]; then
		/usr/local/bin/troff -p -mcohlex $BASE/top.r $BASE/fonts.r $1 > ./`basename $1`.out
	else
		/usr/local/bin/nroff -x -mcohman $BASE/top.r $1 | sift > ./`basename $1`.out
	fi
fi

# end makeman
