Makefile 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. .PHONY: diff clean remote
  2. MAINFILE = <<FILENAME>>
  3. FOLDER = <<FOLDERNAME>>
  4. REMOTE = <<USER@DOMAIN>>
  5. all: build/$(MAINFILE).pdf
  6. # to build a diff from the current one to the git tag abcdxxx run "make prev=abcdxxx diff"
  7. # similarly if building all, then run "make prev=abcdxxx"
  8. diff:
  9. git show $(prev):$(MAINFILE).tex > prev.tex && \
  10. latexdiff prev.tex $(MAINFILE).tex > diff.tex && \
  11. echo -e "\n\n" && \
  12. texfot pdflatex -output-directory=build diff.tex && \
  13. echo -e "" && \
  14. texfot pdflatex -output-directory=build diff.tex && \
  15. echo -e "" && \
  16. rm prev.tex diff.tex
  17. build/$(MAINFILE).pdf: $(MAINFILE).tex build/ figures/lineWithCircles.asy figures/comb.asy
  18. echo -e "\n\n" && \
  19. scp -r Makefile $(MAINFILE).tex figures $(REMOTE):$(FOLDER) && \
  20. ssh $(REMOTE) "cd $(FOLDER); make local" && \
  21. scp $(REMOTE):$(FOLDER)/build/*.pdf ./build/ && \
  22. echo -e "\n\n";
  23. local: $(MAINFILE).tex build/ lineWithCircles.pdf comb.pdf
  24. echo -e "\n\n" && \
  25. texfot pdflatex -output-directory=build $(MAINFILE).tex && \
  26. echo -e "" && \
  27. texfot pdflatex -output-directory=build $(MAINFILE).tex && \
  28. echo -e "\n\n";
  29. lineWithCircles.pdf: figures/lineWithCircles.asy
  30. asy figures/lineWithCircles.asy
  31. comb.pdf: figures/comb.asy
  32. asy figures/comb.asy
  33. build/:
  34. mkdir -p build
  35. clean:
  36. rm -rf build/*
  37. rm -f prev.tex diff.tex
  38. rm -f lineWithCircles.pdf comb.pdf