22 lines
808 B
Makefile
22 lines
808 B
Makefile
.PHONY: main.pdf clean redo test_git versioned
|
|
|
|
main.pdf: main.tex main.bib
|
|
latexmk -pdf main.tex
|
|
|
|
clean:
|
|
x=`biber --cache` && if [ -d "$x" ]; then $(RM) $x; fi
|
|
$(RM) *.out *.aux *.log *.bbl *.blg *~ \#*\# *.toc *.idx *.eps dummy *.fls *.fdb_latexmk
|
|
$(RM) $(patsubst %.tex, %.ps, $(wildcard *.tex))
|
|
$(RM) $(patsubst %.tex, %.dvi, $(wildcard *.tex))
|
|
$(RM) $(patsubst %.tex, %.pdf, $(wildcard *.tex))
|
|
|
|
redo: clean main.pdf
|
|
|
|
test_git:
|
|
if [ -z "$$(git status --untracked-files=no --porcelain)" ]; then exit 0; else echo -e "\nERROR: working directory not clean. commit changes before running versioned build"; exit 1; fi
|
|
# TODO check if we are also synced to at least one remote
|
|
|
|
versioned: test_git clean main.pdf
|
|
cp main.pdf "main-$$(date -u +'%Y-%m-%dT%H:%M:%SZ')-$$(git rev-parse --short HEAD).pdf"
|
|
|