48 lines
1.3 KiB
Makefile
48 lines
1.3 KiB
Makefile
|
|
SHELL := bash
|
|
.ONESHELL:
|
|
.SHELLFLAGS := -eu -o pipefail -c
|
|
.DELETE_ON_ERROR:
|
|
MAKEFLAGS += --warn-undefined-variables
|
|
MAKEFLAGS += --no-builtin-rules
|
|
|
|
CHAPTERS := $(shell find -maxdepth 1 -type d -name 'chapter-*')
|
|
|
|
VERSION_STRING := $(shell git describe --always --tags --long)
|
|
|
|
all: thesis.pdf
|
|
|
|
# We need three runs for biblatex's defernumbers
|
|
%.pdf: %.tex common-packages.tex common-defs.tex main.bib version.tex
|
|
pdflatex -shell-escape -jobname thesis '\def\thesispreviewmode{}\input{$<}'
|
|
biber $*
|
|
pdflatex -shell-escape -jobname thesis '\def\thesispreviewmode{}\input{$<}'
|
|
pdflatex -shell-escape -jobname thesis '\def\thesispreviewmode{}\input{$<}'
|
|
echo
|
|
echo "Undefined biblatex references:"
|
|
grep -A2 'Package biblatex Warning: The following entry could not be found' thesis.log | sed -n '3~4{s/(biblatex) *//;p}' || echo "<None>"
|
|
|
|
#.PHONY: preview
|
|
final:
|
|
pdflatex -shell-escape $<
|
|
biber $*
|
|
pdflatex -shell-escape $<
|
|
pdflatex -shell-escape $<
|
|
|
|
version.tex: thesis.tex $(addsuffix /chapter.tex,${CHAPTERS})
|
|
echo "${VERSION_STRING}" > $@
|
|
|
|
.PHONY: update-figures
|
|
update-figures:
|
|
@for ch in ${CHAPTERS};\
|
|
do \
|
|
test -d $$ch/figures &&\
|
|
python update_figures.py $$ch/figures || true;\
|
|
done
|
|
|
|
.PHONY: clean
|
|
clean:
|
|
rm -f **.aux **.bbl **.bcf **.log **.blg **.lof **.lot
|
|
rm -f **.mtc **.mtc* **.maf **.toc
|
|
rm -f **.out **.run.xml **/texput.log
|
|
|