summaryrefslogtreecommitdiff
path: root/paper/Makefile
blob: 1d417d40d27c9e995f3d884e92a93376b66532d4 (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
28
29
30
31
32
33
34
35
36
37
LAB_PATH ?= ../lab-windows

SHELL := bash
.ONESHELL:
.SHELLFLAGS := -eu -o pipefail -c
.DELETE_ON_ERROR:
MAKEFLAGS += --warn-undefined-variables
MAKEFLAGS += --no-builtin-rules

main_tex ?= safety-reset-paper

VERSION_STRING := $(shell git describe --tags --long --dirty)

all: ${main_tex}.pdf

%.pdf: %.tex safety-reset.bib version.tex
	pdflatex -shell-escape $<
	biber $* 
	pdflatex -shell-escape $<

.PHONY: once
once: safety-reset-paper.tex safety-reset.bib version.tex
	biber safety-reset-paper
	pdflatex -shell-escape $<

version.tex: ${main_tex}.tex safety-reset.bib
	echo "${VERSION_STRING}" > $@

resources/%.pdf: $(LAB_PATH)/%.ipynb
	jupyter-nbconvert --to=pdf --output-dir=resources --output=$* --LatexExporter.template_file=resources/nbexport.tplx $^

.PHONY: clean
clean:
	rm -f ${main_tex}.aux ${main_tex}.bbl ${main_tex}.bcf ${main_tex}.log ${main_tex}.blg
	rm -f ${main_tex}.out ${main_tex}.run.xml texput.log