# Run
#
# Compile cohulip manual
#
TROFF="troff -p"
OUTPUT=/tmp/doc/cohulip
INPUT=/v/doc/coherent/manual

rm $OUTPUT/*

rm index.r contents.r

# do the title copyright pages
$TROFF $INPUT/fonts.r title.r 2>/dev/null >$OUTPUT/title.ps
#$TROFF $INPUT/fonts.r $INPUT/top.r copyright.r >$OUTPUT/copyright.ps

# do each chapter in turn
$TROFF -mcohtext $INPUT/fonts.r $INPUT/top.r \
	intro.r \
	2> Run.x > $OUTPUT/intro.ps
tail -1 Run.x >pgn.r

$TROFF -mcohtext $INPUT/fonts.r $INPUT/top.r pgn.r \
	basics.r \
	2>> Run.x > $OUTPUT/basics.ps
tail -1 Run.x >pgn.r

$TROFF -mcohtext $INPUT/fonts.r $INPUT/top.r pgn.r \
	install.r \
	2>> Run.x > $OUTPUT/install.ps
tail -1 Run.x >pgn.r

$TROFF -mcohtext $INPUT/fonts.r $INPUT/top.r pgn.r \
	config.r \
	2>> Run.x > $OUTPUT/config.ps
tail -1 Run.x >pgn.r

$TROFF -mcohtext $INPUT/fonts.r $INPUT/top.r pgn.r \
	running.r \
	2>> Run.x > $OUTPUT/running.ps
tail -1 Run.x >pgn.r

$TROFF -mcohtext $INPUT/fonts.r $INPUT/top.r pgn.r \
	advanced.r \
	2>> Run.x > $OUTPUT/advanced.ps
tail -1 Run.x >pgn.r

# compile the index
/v/doc/coherent/bin/index <Run.x >index.r
$TROFF -Z2 -mcohindex pgn.r $INPUT/fonts.r $INPUT/top.r pgn.r \
	index.r \
	2>> Run.x > $OUTPUT/index.ps

# compile the table of contents
/v/doc/coherent/bin/contents < Run.x > contents.r
$TROFF -mcohcon $INPUT/fonts.r $INPUT/top.r \
	contents.r \
	2>> Run.x > $OUTPUT/contents.ps
