.PHONY: doc.ps doc.tex htmlman pdfman

pychart.texi: template.texi doc.py
	make -C../demos colorpng
	PYTHONPATH=..:../demos python doc.py template.texi >$@

htmlman: pychart.texi
	makeinfo --html pychart.texi
	cp *.png pychart/
	for f in pychart/*.html; do python markuphtml.py <$$f >foo.html; mv foo.html $$f; done 

pdf: pychart.texi
	pdftexinfo pychart.texi

winpdfman: template.texi doc.py
	make -C../demos pdf
	-mkdir pdf
	(cd pdf; PYTHONPATH="../..;../../demos" python ../doc.py --pdf ../template.texi >pychart.texi)
	$(MAKE) compile_pdf

compile_pdf:
	(cd pdf; pdftexinfo pychart.texi; texindex pychart.??)
	(cd pdf; pdftexinfo pychart.texi; pdftexinfo pychart.texi)

clean:
	rm -f *.pyc *~ *.html *.info tmp.texi 
	rm -rf examples html demos

demo:
	PYTHONPATH=..:../demos python demodoc.py 
ex:
	python examples.py
	rm -rf $(HTMLDIR)/examples

index.html: index.html $(GIFFILES)
	gtml index.gtml

install:
	rcp -r pychart/* spica:web/intweb/personal/Yasushi_Saito/pychart/doc
	rcp pychart.pdf spica:web/intweb/personal/Yasushi_Saito/pychart/
	rcp -r examples/* spica:web/intweb/personal/Yasushi_Saito/pychart/examples
