#
# $Id: Makefile,v 1.1 2002/03/06 04:20:54 joe Exp $
#

SCRATCH = *.hi *.o *.aux *.hp *.prof *.stat junk.*

default :: html

check :: validate

validate ::
	rxp -s doc.xml
	-nsgmls -s -mcatalog doc.xml

html ::
	mkdir -p ./htdocs
	cp hxml.css ./htdocs
	runhugs -P:.. mkSite.hs doc.xml

validate-html ::
	(cd htdocs ; nsgmls -sB *.html)

tex ::
	 mkdir -p fmt
	 costsh --spec=site-latex.spec --input=doc.xml > fmt/hxml.tex

dvi :: tex 
	 (cd fmt ; latex hxml ; makeindex hxml ; latex hxml)

pdf :: tex 
	 (cd fmt ; pdflatex hxml ; makeindex hxml ; pdflatex hxml)
	 mv fmt/hxml.pdf htdocs/hxml.pdf

PROF=-b
profrun ::
	(cd .. ; hmake -P. -p doc/mkSite)
	./mkSite +RTS -H4M $(PROF) -RTS doc.xml
	hp2graph mkSite

clean:: 
	-rm -f $(SCRATCH)

