#
# Makefile for FPK-Pascal documentation.
#
ifndef LATEX
LATEX = latex
endif
ifndef LATEX2HTML
LATEX2HTML = latex2html
endif
ifndef LATEX2HTMLOPTS
LATEX2HTMLOPTS = -ascii_mode -split 2 -no_reuse
endif
ifndef DVIPS
DVIPS=dvips
endif

.PHONY: dvi help html ps

.SUFFIXES: .dvi .tex .ps

.dvi.ps:
	$(DVIPS) $<

.tex.dvi:
	$(LATEX) $<
	$(LATEX) $<

help:
	@echo 'Possible targets :'
	@echo ' dvi   : Make documentation using latex.'
	@echo ' ps    : Make documentation using latex and dvips.'
	@echo ' html  : Make documentation using latex2html.'
	@echo ' clean : Clean up the mess.';

dvi : crt.dvi linux.dvi printer.dvi getopts.dvi strings.dvi

html : dvi crt linux printer getopts

ps : dvi crt.ps linux.ps printer.ps getopts.ps strings.ps

crt :
	$(LATEX2HTML) $(LATEX2HTMLOPTS) -t "CRT unit for Linux FPK Pascal" crt.tex

linux :
	$(LATEX2HTML) $(LATEX2HTMLOPTS) -t "Linux unit for Linux FPK Pascal" linux.tex

printer :
	$(LATEX2HTML) $(LATEX2HTMLOPTS) -t "Printer unit for Linux FPK Pascal" printer.tex

getopts :
	$(LATEX2HTML) $(LATEX2HTMLOPTS) -t "Getopts unit for Linux FPK Pascal" getopts.tex

strings :
	$(LATEX2HTML) $(LATEX2HTMLOPTS) -t "Strings unit for Linux FPK Pascal" strings.tex

clean:
	-rm -f *.aux *.log *.dvi *.ps
	-rm -rf crt linux printer getopts strings
