# $Header:$

##  A template makefile for documenting modules.  Not perfect -- some of
##  the formatting (in particular the single-file generated HTML) isn't
##  great -- but good enough.

##  Module name.  Must also be the name of the toplevel input file.
WHAT=		wizard
EXTRA_SRC=	lib$(WHAT).tex

# Where is the doc-builder program?
PYSRCDIR=	/home/rsalz/py/Python-2.1
MKHOWTO=	$(PYSRCDIR)/Doc/tools/mkhowto
#PAPER=		a4
PAPER=		letter

M=		$(WHAT)

SOURCES=	$M.tex $(EXTRA_SRC)


all:	ps pdf html
pdf:	$M.pdf
ps:	$M.ps
html:	$M.html
.PHONY: all pdf ps html

$M.pdf: $(SOURCES)
	$(MKHOWTO) --pdf $M.tex
$M.ps: $(SOURCES)
	$(MKHOWTO) --dvi $M.tex
	dvips -N0 -t $(PAPER) -o $@ $M.dvi
	@rm -f $M.dvi
$M.html: $(SOURCES) Makefile
	$(MKHOWTO) --html --split=1 $M.tex
	mv $M/$M.html $M/$M.css .
	rm -rf wizard

clean:
	rm -f *.aux *.idx *.ilg *.ind *.log *.toc *.bkm *.syn *.pla *.how
clobber: clean
	rm -f $M.ps $M.pdf $M.html $M.l2h $M.css
realclean: clobber
distclean: clobber
.PHONY: clean clobber realclean distclean