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

Provide template Makefile

parent 27d17c22
No related branches found
No related tags found
1 merge request!15Provide template Makefile
DOCNAME=example
export TEXMFHOME ?= ../texmf
GITVERSION := $(shell git describe --always --dirty)
GITDATE := $(shell git log -1 --date=short --pretty=%ad)
GITFIRSTYEAR := $(shell git log --reverse --date=short --format="format:%ad" | head -1 | cut -d- -f1)
GITLASTYEAR := $(shell git log -1 --date=short --pretty=%ad | cut -d- -f1)
$(DOCNAME).pdf: $(DOCNAME).tex meta.tex
xelatex $(DOCNAME)
makeglossaries $(DOCNAME)
......@@ -14,12 +8,4 @@ $(DOCNAME).pdf: $(DOCNAME).tex meta.tex
xelatex $(DOCNAME)
xelatex $(DOCNAME)
.FORCE:
meta.tex: Makefile .FORCE
rm -f $@
printf "%s\n" "% GENERATED FILE -- edit this in the Makefile" >>$@
printf "%s\n" "\newcommand{\vcsRevision}{$(GITVERSION)$(GITDIRTY)}" >>$@
printf "%s\n" "\newcommand{\vcsDate}{$(GITDATE)}" >>$@
printf "%s\n" "\newcommand{\vcsFirstYear}{$(GITFIRSTYEAR)}" >>$@
printf "%s\n" "\newcommand{\vcsLastYear}{$(GITLASTYEAR)}" >>$@
include ../vcs-meta.make
GITVERSION := $(shell git describe --always --dirty)
GITDATE := $(shell git log -1 --date=short --pretty=%ad)
GITFIRSTYEAR := $(shell git log --reverse --date=short --pretty=%ad | head -1 | cut -d- -f1)
GITLASTYEAR := $(shell git log -1 --date=short --pretty=%ad | cut -d- -f1)
.FORCE:
meta.tex: Makefile .FORCE
rm -f $@
printf "%s\n" "% GENERATED FILE -- edit this in the Makefile" >>$@
printf "%s\n" "\newcommand{\vcsRevision}{$(GITVERSION)}" >>$@
printf "%s\n" "\newcommand{\vcsDate}{$(GITDATE)}" >>$@
printf "%s\n" "\newcommand{\vcsFirstYear}{$(GITFIRSTYEAR)}" >>$@
printf "%s\n" "\newcommand{\vcsLastYear}{$(GITLASTYEAR)}" >>$@
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