Skip to content
Snippets Groups Projects
Commit fe5d8a2d authored by John Swinbank's avatar John Swinbank
Browse files

Pull metadata from git

parent 73d4f7ba
Branches
No related tags found
No related merge requests found
...@@ -2,3 +2,4 @@ example.aux ...@@ -2,3 +2,4 @@ example.aux
example.log example.log
example.out example.out
example.pdf example.pdf
meta.tex
export TEXMFHOME ?= ../texmf export TEXMFHOME ?= ../texmf
example.pdf: example.tex GITVERSION := $(shell git log -1 --date=short --pretty=%h)
GITDATE := $(shell git log -1 --date=short --pretty=%ad)
GITSTATUS := $(shell git status --porcelain)
ifneq "$(GITSTATUS)" ""
GITDIRTY = -dirty
endif
example.pdf: example.tex meta.tex
xelatex example xelatex example
xelatex example xelatex example
.FORCE:
meta.tex: Makefile .FORCE
rm -f $@
echo '% GENERATED FILE -- edit this in the Makefile' >>$@
/bin/echo '\\newcommand{\\vcsRevision}{$(GITVERSION)$(GITDIRTY)}' >>$@
/bin/echo '\\newcommand{\\vcsDate}{$(GITDATE)}' >>$@
\documentclass{astron} \documentclass{astron}
\input{meta}
\setDocTitle{Example Document} \setDocTitle{Example Document}
\setDocNumber{1} \setDocNumber{1}
\setDocRevision{1} \setDocRevision{\vcsRevision}
\setDocDate{\today} \setDocDate{\vcsDate}
\setDocClass{Limited} \setDocClass{Limited}
\setDocProgram{SDC} \setDocProgram{SDC}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment