REPORT := report DIAGRAMS := data/diagrams LATEX = TEXINPUTS=$(d):$(b): pdflatex -halt-on-error -interaction=nonstopmode \ -output-directory $(@D) -shell-escape REF_WARNING := "Rerun to get cross-references right" .PHONY: docs report docs: report $(b)proposal.pdf $(b)presentation.pdf report: $(b)$(REPORT).pdf $(b)$(REPORT).bbl $(b)%.pdf: $(d)%.tex mkdir -p $(@D) $(LATEX) $^ @while grep $(REF_WARNING) $(@:.pdf=.log) > /dev/null; do \ echo "** Rerunning pdflatex for cross-references **"; \ $(LATEX) $^; \ done $(b)$(REPORT).pdf: $(d)$(DIAGRAMS).tex $(b)$(REPORT).bbl $(b)$(REPORT).bbl: $(d)$(REPORT).bib BIBINPUTS=$(d) bibtex8 $(@:.bbl=.aux) $(LATEX) $(d)$(REPORT).tex $(LATEX) $(d)$(REPORT).tex