rules.mk 731 B

123456789101112131415161718192021222324252627
  1. REPORT := report
  2. DIAGRAM := data/diagram
  3. PDFLATEX_FLAGS = -halt-on-error -interaction=nonstopmode \
  4. -output-directory $(@D) -shell-escape
  5. LATEX = TEXINPUTS=$(d):$(b): pdflatex $(PDFLATEX_FLAGS)
  6. REF_WARNING := "Rerun to get cross-references right"
  7. .PHONY: docs report
  8. docs: report $(b)proposal.pdf $(b)presentation.pdf
  9. report: $(b)$(REPORT).pdf $(b)$(REPORT).bbl
  10. $(b)%.pdf: $(d)%.tex
  11. mkdir -p $(@D)
  12. $(LATEX) $^
  13. @while grep $(REF_WARNING) $(@:.pdf=.log) > /dev/null; do \
  14. echo "** Rerunning pdflatex for cross-references **"; \
  15. $(LATEX) $^; \
  16. done
  17. $(b)$(REPORT).pdf: $(d)$(DIAGRAM).tex
  18. $(b)$(REPORT).bbl: $(d)$(REPORT).bib
  19. BIBINPUTS=$(d) bibtex8 ${@:.bbl=.aux}
  20. $(LATEX) $(d)$(REPORT).tex
  21. $(LATEX) $(d)$(REPORT).tex