YDIST=/home2/munro/yorick-1.5

all:: notllnl

MANOPTS1=-init_file texi2html.init -split sections
MANOPTS2=-init_file texi2llnl.init -split sections

notllnl: doinfo
	cd manual; texi2html $(MANOPTS1) yorick.tex
	cd refcard; tar xzf qrefs.tgz
	cd refcard; for f in *.html;do grep -iv llnl $$f >$$f.x;mv $$f.x $$f;done
	yorick -batch htmldoc.i

llnl: doinfo
	cd manual; texi2html $(MANOPTS2) yorick.tex
	cd refcard; tar xzf qrefs.tgz
	yorick -batch htmldoc.i llnl
	rm -f index-raw.html

doinfo: getdocs
	cd manual; makeinfo yorick.tex; tar czf ../yorick-info.tgz yorick.inf*
	cd manual; rm yorick.inf*
	rm -f index-raw.html

getdocs: clean
	cp $(YDIST)/NEWS .
	cp $(YDIST)/doc/yorick.pdf .
	cp $(YDIST)/doc/yorick.tex manual/
	cp $(YDIST)/doc/{refs.pdf,refs.tex} refcard/
	cp $(YDIST)/emacs/yorick.el .

clean:
	rm -f NEWS yorick-info.tgz yorick.el yorick.pdf index-raw.html *~
	rm -f manual/*.html refcard/*.html
	rm -rf html_i html_xref

dist: clean
	cd ..; tar czvf yorick-html.tgz doc
