talk-v4ov6-ietf108/Makefile

47 lines
1.3 KiB
Makefile

TARGET=slides.pdf
QRENCODE=qrencode -t svg --background=ffffff00
SVGS=$(wildcard imgs/*.svg)
SVG_PDFTEXS = $(patsubst imgs/%,imgs/pdf_tex/%,$(SVGS:.svg=.pdf_tex))
SVG_PDF = $(patsubst imgs/%,imgs/pdf/%,$(SVGS:.svg=.pdf))
AUTOGEN_SVGS_LIST=mac
AUTOGEN_SVGS=$(addprefix imgs/_autogen/,$(AUTOGEN_SVGS_LIST))
QR_NAMES=qr_slide.pdf qr_draft.pdf
QR_IMGS=$(addprefix imgs/pdf/,$(QR_NAMES))
all: $(SVG_PDFTEXS) $(SVG_PDF) $(AUTOGEN_SVGS) $(QR_IMGS) $(TARGET)
%.pdf: %.tex
latexmk -pdfxe $<
imgs/_autogen/%: imgs/%.svg imgs/split_layers.py
imgs/split_layers.py "$*.svg"
cd "$@" ; inkscape --export-type=pdf *.svg
imgs/pdf_tex/%.pdf_tex: imgs/%.svg
mkdir -p "imgs/pdf_tex"
inkscape "$<" -o "$(@:.pdf_tex=.pdf)" --export-latex 2>/dev/null
sed -i 's#\($(patsubst imgs/pdf_tex/%,%,$(@:.pdf_tex=.pdf))\)#imgs/pdf_tex/\1#g' $@
imgs/pdf/%.pdf: imgs/%.svg
mkdir -p "imgs/pdf"
inkscape "$<" -o "$@" 2>/dev/null
imgs/pdf/qr_slide.pdf:
$(QRENCODE) -o - "https://tobast.fr/files/ietf108-v40v6.pdf" \
| inkscape --pipe -o "$@" 2>/dev/null
imgs/pdf/qr_draft.pdf:
$(QRENCODE) -o - "https://datatracker.ietf.org/doc/draft-bastian-babel-v4ov6/" \
| inkscape --pipe -o "$@" 2>/dev/null
.PHONY: clean
clean:
latexmk -C
rm -rf "imgs/pdf_tex" "imgs/pdf"
rm -rf imgs/_autogen
upload:
scp slides.pdf www.tobast:~/files/ietf108-v40v6.pdf