-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
33 lines (25 loc) · 1.18 KB
/
Copy pathMakefile
File metadata and controls
33 lines (25 loc) · 1.18 KB
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
#!Makefile
default all: pdf
TEXFILE=charter
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 tex
.PHONY: gitinfo
gitinfo:
@git --no-pager log -1 --date=short --decorate=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
tex: $(TEXFILE).tex
@test -d $(TMPDIR) || mkdir $(TMPDIR)
@echo "Running 2 compiles $(TMPDIR)"
@pdflatex -output-directory=$(TMPDIR) -interaction=batchmode -file-line-error -no-shell-escape $< > /dev/null
@makeglossaries -d $(TMPDIR) $(TEXFILE)
@pdflatex -output-directory=$(TMPDIR) -interaction=batchmode -file-line-error -no-shell-escape $< > /dev/null
@cp $(TMPDIR)/$(TEXFILE).pdf .
@echo $(FIRSTTAG) > version
@echo "$(TEXFILE) PDF Ready"
.PHONY: clean
clean:
@rm -rf /tmp/latex.*
cleanall:
@rm -rf /tmp/latex.*
@rm -f $(TEXFILE).pdf