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

Pull metadata from git

parent 73d4f7ba
No related branches found
No related tags found
No related merge requests found
......@@ -2,3 +2,4 @@ example.aux
example.log
example.out
example.pdf
meta.tex
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
.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}
\input{meta}
\setDocTitle{Example Document}
\setDocNumber{1}
\setDocRevision{1}
\setDocDate{\today}
\setDocRevision{\vcsRevision}
\setDocDate{\vcsDate}
\setDocClass{Limited}
\setDocProgram{SDC}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment