pyramids.html.zip: pyramids/ch01.html pyramids/img
	rm -f $@
	zip -r $@ pyramids
pyramids/ch01.html: pyramids.1.html
	cd pyramids ; <../$< ../split_chapters ; ../add_start_end
pyramids.1.html: pyramids.0.html
	<$< perl -pe 's,src=",src="img/,g; s/.png/.jpg/g' >$@
pyramids/img: pyramids.0.html
	mkdir -p $@
	mv *.png *.jpg $@
	for A in $@/*.png; do <$$A pngtopnm | pnmtojpeg >$${A%.png}.jpg; echo $$A >&2; done
	rm $@/*.png
pyramids.0.html: Sun-Power_and_Pyramids.doc
	wvHtml $< pyramids.html
	mv pyramids.html $@
clean:
	rm html/*.jpg html*.png *.html
	rm -rf img
