makefile 849 B

12345678910111213141516171819202122232425262728
  1. exts := md png sh bib tex sty
  2. findopts := $(foreach ext,$(exts),-or -iname "*.$(ext)")
  3. all: pdf
  4. pdf: clean
  5. find ./* -type f | grep -v '/_.*.tex' | grep -v 'sandbox' | grep 'tex$$' > texfiles
  6. while read l ; do \
  7. latexmk -quiet -cd -lualatex -e '$$lualatex=q/lualatex %O --shell-escape %S/' $$l ; \
  8. done < texfiles
  9. while read l ; do \
  10. latexmk -c -cd -lualatex $$l ; \
  11. done < texfiles
  12. find -type d | grep -i "_minted.*" | xargs rm -rf
  13. clean:
  14. rm -rf .backup
  15. find -iname "*~" | xargs rm -rf
  16. find ./* -type f -iname "makefile" $(findopts) > ls-R
  17. find ./* -type d -iname "sandbox" >> ls-R
  18. rsync -avPr --files-from=ls-R . .backup
  19. rm -rf *
  20. cp -p -r .backup/* .
  21. rm -rf .backup
  22. pandoc -s README.tex -o README.md && sed -i 's/{#.*}//g' README.md && sed -i "s/’/\'/g" README.md
  23. pandoc -s README.tex -o about.html
  24. .PHONY: all pdf clean