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

INPUT=/v/doc/coherent
TROFF="troff -p -mcohtext -rX0 -n1 -rNS1 -rNI1 -Z $INPUT/fonts.r $INPUT/top.r"
OUTPUT=/tmp/doc/driver

rm pgn.r driver.index driver.contents *.x $OUTPUT/*

troff -p $INPUT/fonts.r mantitle.r   >$OUTPUT/mantitle.out
troff -p $INPUT/fonts.r copyright.r >$OUTPUT/copyright.out

# Introduction
$TROFF intro.r \
	>  $OUTPUT/intro.out \
	2> driver.x

# Kernel internals
tail -1 driver.x >pgn.r
$TROFF pgn.r kernel.r \
	>  $OUTPUT/kernel.out \
	2>>driver.x

# Drivers in more detail
tail -1 driver.x >pgn.r
$TROFF pgn.r driver.r \
	>  $OUTPUT/driver.out \
	2>>driver.x

# Example of a block driver
tail -1 driver.x >pgn.r
$TROFF pgn.r block.r \
	>  $OUTPUT/block.out \
	2>>driver.x

# Example of a character driver
tail -1 driver.x >pgn.r
$TROFF pgn.r character.r \
	>  $OUTPUT/char.out \
	2>>driver.x

# Introduce the Lexicon
tail -1 driver.x >pgn.r
$TROFF pgn.r lex_intro.r \
	> $OUTPUT/lx_intro.out \
	2>>driver.x

# Lexicon articles
tail -1 driver.x >pgn.r
troff -p -rX0 -n1 -rNS1 -rNI1 -mcohlex -Z $INPUT/fonts.r $INPUT/top.r pgn.r lx/[a-z]* \
	> $OUTPUT/lx.out \
	2>>driver.x

# index
tail -1 driver.x >pgn.r
/v/doc/coherent/bin/index < driver.x >driver.index
troff -p -Z2 -rNS1 -rNI1 -mcohindex $INPUT/top.r $INPUT/fonts.r pgn.r driver.index \
	>  $OUTPUT/index.out \
	2>>driver.x

# table of contents
/v/doc/coherent/bin/contents < driver.x >driver.contents
troff -p -rX0 -rNS1 -rNI1 -Z2 -mcohcon $INPUT/fonts.r $INPUT/top.r driver.contents \
	>  $OUTPUT/contents.out \
	2>>driver.x
