view doc/manual/Makefile.generic @ 75:a59ae4370202

- html manual: moved some generation steps to website build
author cslag
date Sun, 20 Mar 2016 18:44:41 +0100
parents 2b89d8497aad
children dcb7157392f1
line wrap: on
line source

all: manual.pdf

sources: *.tex callconvs/*.tex dyncall_logo.* dyncall_watermark.*

pdf: manual.pdf

html:: html/manual.html
#html-single: html/manual.html
#html-split: html/manual.html

clean:
	# pdf
	cd "${VPATH}" && for i in pdf aux lof log lol lot out toc; do rm -f manual.$$i || true; done
	# html
	cd "${VPATH}" && ( \
		for i in 4ct 4tc css dvi html idv lg tmp xref; do rm -f manual.$$i || true; done; \
		for i in manual*x.png manual*.html texput.log manual_*.log zzmanual.eps zzmanual.ps custom_tex4ht.env; do rm -f $$i || true; done; \
		rm -r html || true; \
	)


# Main target dependencies --->


html/manual.html: manual_tex4ht.cfg sources
	# Create tex4ht.env from default one, but with better bitmaps
	cd "${VPATH}" &&  ( \
		cp $$(dirname $$(which tex4ht))/../share/texmf-dist/tex4ht/base/unix/tex4ht.env ./custom_tex4ht.env; \
		sed -E -i '' 's/(Text|Graphics)(AlphaBits)=[1,2,3]([^0-9])/\1\2=4\3/g' custom_tex4ht.env; \
		mkdir -p ./html/; \
		htlatex manual.tex manual_tex4ht " -cunihtf -e./custom_tex4ht.env -utf8" "-e./custom_tex4ht.env -d./html/"; \
		rm ./html/*.css; \
	)
	# Postprocessing. Inject menu into output html pages. Replace some pieces, etc..
	for f in "${VPATH}/html/"*.html; do \
		sed -E -i '' $$'s/([[:space:]]class=["\'])lstlisting(["\'])/\\1ttDiv\\2/' "$$f"; \
	done

manual.pdf: sources
	# run twice for toc on some tex installs
	cd "${VPATH}" && for i in 1 2; do pdflatex -output-directory="${PWD}" manual.tex; done