summaryrefslogtreecommitdiff
path: root/docs/Makefile
blob: 0b05cb085419ca1072ba268bb67dc73505a6d7d7 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
BUILD_DIR = build

FILES = $(wildcard *.tex *.py)
BUILD_FILES = $(patsubst %,${BUILD_DIR}/%,${FILES})

LATEX=xelatex
LATEX_FLAGS=-shell-escape

.PHONY: all

all: tutorial.pdf

${BUILD_DIR}:
	mkdir -p ${BUILD_DIR}

${BUILD_DIR}/%.tex: %.tex ${BUILD_DIR}
	./jinja2 --latex < $< > $@

${BUILD_DIR}/%.py: %.py
	ln $< $@

tutorial.pdf: ${BUILD_DIR}/tutorial.tex ${BUILD_FILES}
	cd "${BUILD_DIR}" && \
	${LATEX} ${LATEX_FLAGS} tutorial && \
	${LATEX} ${LATEX_FLAGS} tutorial && \
	${LATEX} ${LATEX_FLAGS} tutorial
	mv -f "${BUILD_DIR}/tutorial.pdf" tutorial.pdf