# A very simple makefile for the creation of the manual from the LaTeX sources
# and conversion to other formats.

CHICKEN=chicken

# Usually you want this as the default.
dvi: manual.dvi

ps: manual.ps

pdf: manual.pdf

html : manual.html.gen

all: manual.dvi manual.ps manual.pdf manual.html.gen

# the first latex command creates all of the reference files for things like
# the table of contents, the second latex command remakes the manual given the
# reference files so things like the table of contents can exist in the final
# version.
manual.dvi: manual.tex
	make clean
	latex manual.tex 
	makeindex manual.idx
	latex manual.tex -interaction=batchmode
	latex manual.tex -interaction=batchmode

manual.ps: manual.tex
	make dvi
	dvips manual.dvi -o manual.ps

manual2up.ps: manual.ps
	psnup -2 $< $@

manual.pdf: manual.tex
	make dvi
	pdflatex manual.tex

manual.html.gen: manual.tex
	mkdir -p manual
	./tex2page manual
	./tex2page manual
	touch manual.html.gen

clean:
	rm -rf *.toc *.log *.dvi *.aux *.ps *.pdf *.out manual/* *.html.gen
	rm -rf *.idx *.ilg *.ind
