Makefile 682 B

123456789101112131415161718192021222324
  1. TPLS := $(patsubst %.tpl,../latex/skeleton/%.tplx,$(wildcard *.tpl))
  2. all: clean $(TPLS)
  3. # Convert standard Jinja2 syntax to LaTeX safe Jinja2
  4. # see http://flask.pocoo.org/snippets/55/ for more info
  5. ../latex/skeleton/%.tplx: %.tpl
  6. @echo 'generating tex equivalent of $^: $@'
  7. @echo '((=- Auto-generated template file, DO NOT edit directly!\n' \
  8. ' To edit this file, please refer to ../../skeleton/README.md' \
  9. '-=))\n\n' > $@
  10. @sed \
  11. -e 's/{%/((*/g' \
  12. -e 's/%}/*))/g' \
  13. -e 's/{{/(((/g' \
  14. -e 's/}}/)))/g' \
  15. -e 's/{#/((=/g' \
  16. -e 's/#}/=))/g' \
  17. -e "s/tpl'/tplx'/g" \
  18. $^ >> $@
  19. clean:
  20. @echo "cleaning generated tplx files..."
  21. @-rm ../latex/skeleton/*.tplx