rules.mk 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. PRESENTATION := final_presentation
  2. PRESENTATIONDIAGRAMS := data/presentationdiagrams
  3. REPORT := report
  4. DIAGRAMS := data/diagrams
  5. LATEX = TEXINPUTS=$(d):$(b): pdflatex -halt-on-error -interaction=nonstopmode \
  6. -output-directory $(@D) -shell-escape
  7. REF_WARNING := "Rerun to get cross-references right"
  8. .PHONY: docs bibclean upload
  9. docs: $(b)$(REPORT).pdf $(b)proposal.pdf $(b)presentation.pdf \
  10. $(b)$(PRESENTATION).pdf
  11. $(b)%.pdf: $(d)%.tex
  12. mkdir -p $(@D)
  13. $(LATEX) $^
  14. @while grep $(REF_WARNING) $(@:.pdf=.log) > /dev/null; do \
  15. echo "** Rerunning pdflatex for cross-references **"; \
  16. $(LATEX) $^; \
  17. done
  18. $(b)$(PRESENTATION).pdf: $(d)$(PRESENTATIONDIAGRAMS).tex
  19. $(b)$(REPORT).pdf: $(d)$(DIAGRAMS).tex $(b)$(REPORT).bbl
  20. $(b)$(REPORT).bbl: $(d)$(REPORT).bib
  21. mkdir -p $(@D)
  22. $(LATEX) $(^:.bib=.tex)
  23. BIBINPUTS=$(d) bibtex8 $(@:.bbl=.aux)
  24. $(LATEX) $(^:.bib=.tex)
  25. $(LATEX) $(^:.bib=.tex)
  26. upload: $(b)upload_$(REPORT) $(b)upload_$(PRESENTATION)
  27. $(b)upload_$(PRESENTATION): $(b)$(PRESENTATION).pdf
  28. scp $^ mv:tk.nl && touch $@
  29. $(b)upload_$(REPORT): $(b)$(REPORT).pdf
  30. scp $^ mv:tk.nl && touch $@
  31. bibclean:
  32. rm -f $(d)report.bib~*