#
# Create manual for the Mark Williams COHERENT Driver Kit.
# by fwb, 6/91
#
# copyright (c) 1991 by Mark Williams Company, Northbrook Ill.

OUTPUT=/tmp/doc
#OUTPUT=/w/fred/output

troff -p -mroff fonts.r mantitle.r   >$OUTPUT/mantitle.p

troff -p -mroff fonts.r copyright.r >$OUTPUT/copyright.p

# Introduction
troff -p -rX0 -n1 -mcohtext -mroff fonts.r top.r intro.r \
	>  $OUTPUT/intro.p \
	2> driver.x

# List of compatible hardware
tail -1 driver.x >pgn.r
echo ".nr Nh 2" >>pgn.r
troff -p -rX0 -mcohtext -mroff fonts.r pgn.r rpage.r top.r \
	../rel.notes/hardware.r \
	>  $OUTPUT/hardware.p \
	2>>driver.x

# Writing a Driver section
tail -1 driver.x >pgn.r
echo ".nr Nh 3" >>pgn.r
troff -p -rX0 -mcohtext -mroff fonts.r pgn.r rpage.r top.r writing.r \
	>  $OUTPUT/writing.p \
	2>>driver.x

# Example driver
tail -1 driver.x >pgn.r
echo ".nr Nh 4" >>pgn.r
troff -p -rX0 -mcohtext -mroff fonts.r pgn.r rpage.r top.r examples.r \
	>  $OUTPUT/examples.p \
	2>>driver.x

# Introduce the Lexicon articles
tail -1 driver.x >pgn.r
echo ".nr Nh 5" >>pgn.r
troff -p -rX0 -mcohtext -mroff fonts.r pgn.r rpage.r top.r lexicon.r \
	>  $OUTPUT/lex_intro.p \
	2>>driver.x

# Lexicon articles need to be broken up into two parts to avoid
# running out of memory in the printer. Sad, but true.
#
tail -1 driver.x >pgn.r
troff -p -rX0 -mcohlex -mroff fonts.r pgn.r top.r ../lx/KERNEL/[_a-l]* \
	>  $OUTPUT/lexicon.p \
	2>>driver.x

# Lexicon articles, second part.
tail -1 driver.x >pgn.r
troff -p -rX0 -mcohlex -mroff fonts.r pgn.r top.r ../lx/KERNEL/[m-z]* \
	>> $OUTPUT/lexicon.p \
	2>>driver.x

# index
tail -1 driver.x >pgn.r
../bin/index <driver.x >driver.index
troff -p -rX0 -mcohindex -mroff fonts.r pgn.r rpage.r top.r driver.index \
	>  $OUTPUT/index.p \
	2>>driver.x

# create the table of contents
../bin/contents <driver.x >driver.contents
troff -p -rX0 -mcohcon -mroff fonts.r top.r driver.contents \
	>  $OUTPUT/contents.p \
	2>>driver.x
