POD=readme.pod
TITLE:="Html2Wml Documentation"

help: 
	@echo "available targets: "
	@echo "    doc        rebuild the documentation"
	@echo "    install    install the documentation"

install: 
	@install -m 444 *.pod *.html *.pdf $(DOCDIR)/

doc:
	@echo "[ writing html doc ]"
	@pod2html --infile="${POD}" --outfile="readme.html" --title=\"${TITLE}\" --norecurse --noindex --verbose
	@rm -f pod2htm*.x~~
	@perl -pi -e 's|^<LINK|<link rel="home" href="http://htmlwml.sourceforge.net/">\n<LINK|' readme.html
	@perl -pi -e 's|root\@law.uucp|mad\@maddingue.org|' readme.html
	@perl -pi -e 's|^<BODY|<style type="text/css"> BODY { background-color: white; } HR { margin-top: 3ex; } </style>\n<BODY|' readme.html
	@echo "[ writing text doc ]"
	@pod2text ${POD} > readme.txt
	@echo "[ writing nroff doc ]"
	@pod2man --center=\"${TITLE}\" --release=${VERSION} ${POD} > html2wml.man
	@echo "[ writing pdf doc ]"
	@perl -p -e '/=for html/ and <>, <>, next' ${POD} > Html2Wml
	@pod2pdf --verbose 1 --podfile Html2Wml
	@mv Html2Wml.pdf readme.pdf
	@rm Html2Wml
