HOME = /mit/docsourc/doc/c.saber/appx
RMDIR = $(HOME)/.rm_dir/
FMTR = psroff -me -t
PRINT = lpr
IPRINT = lpr -v -Pimagen -F
NROFF = nroff -Tlpr -me $(EXPLAIN_FLAGS)
PREVIEW = /usr/local/bin/impv
PROFF = ../pre_nroff | expand -4 | tbl


.SUFFIXES: .r .onl .tout .nout .lpr .ipr .img .src .imp

#
# RULES FOR ASSEMBLYING THE USER GUIDE
#

appx.onl: appx.all appx_macros
	cat appx_macros appx.all | $(PROFF) > temp
	$(NROFF) temp 2> /dev/null > $@
	'rm' -f temp

release: appx.PS
	@echo "appx.PS is ready."

appx.PS: appx.all appx_macros
	cat appx_macros appx.all | $(PROFF) > temp
	$(FMTR) temp 2> errorfile > $@
	'rm' -f temp

appx.all : appx_title.r appx_text.r appx_contents.r
	cat appx_title.r appx_text.r appx_contents.r > appx.all

appx_text.r : ../src/errors.load ../src/errors.run ../src/hints.src \
	../src/port.src ../src/ansi.src
	touch -c appx_text.r

#
# MISCELLANEOUS AND DEFAULT RULES
#

.r.onl:
	cat reference_macros $< | $(PROFF) > $*.temp
	$(NROFF) $*.temp 2> /dev/null | cat -s > $@
	'rm' -f $*.temp

.r.tout:
	cat guide_macros $< | $(PROFF) > $*.tmp1
	$(DITROFF) $*.tmp1 2> /dev/null > $*.tmp2
	$(DIMP) $*.tmp2 > $@
	'rm' -f $*.tmp1 $*.tmp2

.nout.lpr:
	$(PRINT) $<

.onl.lpr:
	$(PRINT) $<

.nout.ipr:
	$(IPRINT) $<

.tout.img:
	$(IPRINT) $<

.tout.imp:
	imptool $<

beta: 
	tar cvf beta.tar $(ONLINE) saber.man


date:
	date
