forked from riscv/configuration-structure
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
33 lines (25 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
27
28
29
30
31
32
33
SPEC=configuration-structure
DRAFT=riscv-$(SPEC)-draft
RELEASE=riscv-$(SPEC)-release
all: draft
draft: $(DRAFT).pdf
release: $(RELEASE).pdf
%.pdf: %.tex *.tex vc.tex changelog.tex
pdflatex $< && makeindex $(basename $<) && pdflatex -shell-escape $<
vc.tex: .git/logs/HEAD
# https://thorehusfeldt.net/2011/05/13/including-git-revision-identifiers-in-latex/
echo "%%% This file is generated by Makefile." > vc.tex
echo "%%% Do not edit this file!\n%%%" >> vc.tex
git log -1 --format="format:\
\\gdef\\GITHash{%H}\
\\gdef\\GITAbrHash{%h}\
\\gdef\\GITAuthorDate{%ad}\
\\gdef\\GITAuthorName{%an}" >> vc.tex
changelog.tex: .git/logs/HEAD Makefile
echo "%%% This file is generated by Makefile." > changelog.tex
echo "%%% Do not edit this file!\n%%%" >> changelog.tex
git log --no-merges --date=short --pretty="format:vhEntry{%h}{%ad}{%an}{%s}" | \
sed -e "s,\\\\,{\\\\textbackslash},g" -e "s,[_#^],\\\\&,g" -e s/^/\\\\/ >> changelog.tex
clean:
rm -f *.pdf *.aux *.hst *.idx *.ilg *.ind *.lof *.log *.lot *.out *.toc \
*.ver vc.tex changelog.tex