Makefile 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. TARGET=slides.pdf
  2. QRENCODE=qrencode -t svg --background=ffffff00
  3. SVGS=$(wildcard imgs/*.svg)
  4. SVG_PDFTEXS = $(patsubst imgs/%,imgs/pdf_tex/%,$(SVGS:.svg=.pdf_tex))
  5. SVG_PDF = $(patsubst imgs/%,imgs/pdf/%,$(SVGS:.svg=.pdf))
  6. AUTOGEN_SVGS_LIST=mac
  7. AUTOGEN_SVGS=$(addprefix imgs/_autogen/,$(AUTOGEN_SVGS_LIST))
  8. QR_NAMES=qr_slide.pdf qr_draft.pdf
  9. QR_IMGS=$(addprefix imgs/pdf/,$(QR_NAMES))
  10. all: $(SVG_PDFTEXS) $(SVG_PDF) $(AUTOGEN_SVGS) $(QR_IMGS) $(TARGET)
  11. %.pdf: %.tex
  12. latexmk -pdfxe $<
  13. imgs/_autogen/%: imgs/%.svg imgs/split_layers.py
  14. imgs/split_layers.py "$*.svg"
  15. cd "$@" ; inkscape --export-type=pdf *.svg
  16. imgs/pdf_tex/%.pdf_tex: imgs/%.svg
  17. mkdir -p "imgs/pdf_tex"
  18. inkscape "$<" -o "$(@:.pdf_tex=.pdf)" --export-latex 2>/dev/null
  19. sed -i 's#\($(patsubst imgs/pdf_tex/%,%,$(@:.pdf_tex=.pdf))\)#imgs/pdf_tex/\1#g' $@
  20. imgs/pdf/%.pdf: imgs/%.svg
  21. mkdir -p "imgs/pdf"
  22. inkscape "$<" -o "$@" 2>/dev/null
  23. imgs/pdf/qr_slide.pdf:
  24. $(QRENCODE) -o - "https://tobast.fr/files/ietf108-v40v6.pdf" \
  25. | inkscape --pipe -o "$@" 2>/dev/null
  26. imgs/pdf/qr_draft.pdf:
  27. $(QRENCODE) -o - "https://datatracker.ietf.org/doc/draft-bastian-babel-v4ov6/" \
  28. | inkscape --pipe -o "$@" 2>/dev/null
  29. .PHONY: clean
  30. clean:
  31. latexmk -C
  32. rm -rf "imgs/pdf_tex" "imgs/pdf"
  33. rm -rf imgs/_autogen
  34. upload:
  35. scp slides.pdf www.tobast:~/files/ietf108-v40v6.pdf