-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
28 lines (22 loc) · 1.1 KB
/
Makefile
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
default all: pdf
TMPDIR:=$(shell mktemp -d /tmp/latex.XXXX)
FIRSTTAG:=$(shell git describe --abbrev=0 --tags --always)
RELTAG:=$(shell git describe --tags --long --always --dirty='-*' --match '[0-9]*.*')
pdf: gitinfo build
build: sponsordoc.tex
@test -d $(TMPDIR) || mkdir $(TMPDIR)
@echo "TMPDIR : $(TMPDIR)"
@echo "TAG : $(FIRSTTAG)"
@pdflatex -version
@echo "Running 2 compiles"
@pdflatex -output-directory=$(TMPDIR) -interaction=batchmode -file-line-error -no-shell-escape $< > /dev/null
@pdflatex -output-directory=$(TMPDIR) -interaction=batchmode -file-line-error -no-shell-escape $< > /dev/null
@cp $(TMPDIR)/sponsordoc.pdf sponsordoc.pdf
@echo "Sponsor Document PDF Ready"
.PHONY: gitinfo
gitinfo:
@git log -1 --date=short --pretty=format:"\usepackage[shash={%h},lhash={%H},authname={%an},authemail={%ae},authsdate={%ad},authidate={%ai},authudate={%at},commname={%an},commemail={%ae},commsdate={%ad},commidate={%ai},commudate={%at},refnames={%d},firsttagdescribe="${FIRSTTAG}",reltag="${RELTAG}"]{gitexinfo}" HEAD > $(TMPDIR)/gitHeadLocal.gin
.PHONY: clean
clean:
@rm -rf /tmp/latex*
@rm -f *.pdf