#
# P_R_P_Q_# (C) COPYRIGHT IBM CORPORATION 1987
# LICENSED MATERIALS - PROPERTY OF IBM
# REFER TO COPYRIGHT INSTRUCTIONS FORM NUMBER G120-2083
#
#
#
#	@(#)Makefile	6.1 (ACIS) 5/27/87
#
#
# "make paper" formats the specified source file(s), prints one copy on the
# specified printer (Pusp), and creates the file paper.Pusp;
# the file paper.Pusp contains complete formatting instructions for the
# printer Pusp; as long as paper.Pusp exists, subsequent calls to "make paper"
# will not reformat the source files before printing, but will use
# the information in paper.Pusp to create a hard copy of the document;
# this is a very fast way to make multiple copies of the source file;
# the disadvantage is that the paper.Pusp file is large
#
# "make direct" formats the specified source file(s) and prints one copy
# on the specified printer (Pusp); it does not create the intermediate file
# paper.Pusp
#
# use "make paper" when you want the ability to print the same version of 
# the document without having to take the time to reformat it each time
# and if memory space is not a problem
#
# use "make direct" when you only need to print one copy of the document,
# when you will be making changes and printing, or when memory space needs 
# to be conserved
#
# use "make preview" to format the document with nroff and view it on the screen
#
#
# EQN & TBL are used in routines that create the intermediate # file paper.Pusp
#
# XEQN & XTBL are used in routines that format and print directly
# and do NOT create the intermediate paper.Pusp file
#

PRINTER=Pusp
SRCS=	checklist errata tnl
MACROS=	-me
EQN=	eqn -${PRINTER}
XEQN=	eqn
TBL=	tbl -${PRINTER}
XTBL=	tbl
TROFF=	ptroff -${PRINTER}
NROFF=	nroff

paper:	paper.${PRINTER}
	lpr -${PRINTER} -n paper.${PRINTER}

paper.${PRINTER}: ${SRCS}
	${TBL} ${SRCS} | ${TROFF} ${MACROS} -t > paper.${PRINTER}

clean:
	rm -f paper.[PT]* *.spell errs Errs make.out

spell:	${SRCS}
	@for i in ${SRCS}; do \
		echo $$i; spell $$i | sort | comm -23 - spell.ok > $$i.spell; \
	done

direct:	${SRCS}
	${XTBL} ${SRCS} | ${TROFF} ${MACROS}

preview:${SRCS}
	${XTBL} ${SRCS} | ${NROFF} ${MACROS}
	
