-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
executable file
·27 lines (21 loc) · 1.06 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
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]*.*')
.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
pdf: gitinfo sponsordoc
sponsordoc: sponsordoc.tex
@test -d $(TMPDIR) || mkdir $(TMPDIR)
@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 .
@echo $(FIRSTTAG) > version
@echo "sponsordoc Ready"
.PHONY: clean
clean:
@rm -rf $(TMPDIR)
@rm -rf $(TMPDIR)
@rm -f sponsordoc.pdf