blob: 5cd4a7e0241bbe4bb8008b5c4ac19cf452b5fdf2 (
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 -interaction=nonstopmode
.PHONY: all
all: tutorial.pdf
${BUILD_DIR}:
mkdir -p ${BUILD_DIR}
${BUILD_DIR}/%.tex: %.tex
./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
|