make: Rerun xelatex to build ToC in PDFs

This commit is contained in:
Sam Whited 2017-03-20 09:40:28 -05:00
parent 860f1ab116
commit 86c83102f4
1 changed files with 6 additions and 1 deletions

View File

@ -10,6 +10,8 @@ HTMLDEPS=xep.xsl $(CSSTARGETS) $(JSTARGETS)
CSSTARGETS=$(OUTDIR)/xmpp.css $(OUTDIR)/prettify.css
JSTARGETS=$(OUTDIR)/prettify.js
DO_XELATEX=cd $(OUTDIR); xelatex --interaction=nonstopmode -no-shell-escape "$(notdir $(basename $@)).tex" >/dev/null
.PHONY: help
help:
@ -79,7 +81,10 @@ $(OUTDIR)/%.pdf: %.xml $(XMLDEPS) $(TEXMLDEPS)
sed -i -e 's|\([\s"]\)\([^"]http://[^ "]*\)|\1\\path{\2}|g' \
-e 's|\\hyperref\[#\([^}]*\)\]|\\hyperref\[\1\]|g' \
-e 's|\\pageref{#\([^}]*\)}|\\pageref{\1}|g' "$(@:.pdf=.tex)"
cd $(OUTDIR); xelatex -interaction=batchmode -no-shell-escape "$(notdir $(basename $@)).tex" && echo "Finished building $@"
while ($(DO_XELATEX) ; \
grep -q "Rerun to get" $(<:.xml=.log) ) do true; \
done
echo "Finished building $@"
$(JSTARGETS): $(OUTDIR)
cp "$(notdir $@)" "$@"