# Common to all document makefiles.

ROFF=psroff

# Psroff does the spooling for us, so make PRINT a no-op.
PRINT=cat
INC=../include
VERSION=$(INC)/contact $(INC)/copying.ms $(INC)/copyright.me \
	$(INC)/copyright.ms $(INC)/version.me $(INC)/version.ms

doc:
	tbl $(FILES) | $(ROFF) $(MACROSET) | $(PRINT)

ps:	$(DOC).ps
	@echo Document is $(DOC).ps

$(DOC).ps:	$(FILES) $(VERSION)
	tbl $(FILES) | $(ROFF) -t $(MACROSET) > $(DOC).ps

txt text:	$(DOC).txt $(VERSION)
	@echo Document is $(DOC).txt

$(DOC).txt:	$(FILES) $(VERSION)
	tbl $(FILES) | nroff $(MACROSET) > $(DOC).txt

clean:
	@rm -f \#*\# *~ core 

distclean:	clean
	@rm -f *.bak

remake:
	@rm -f *.ps *.txt
	make ps
	make text
