simplify version.tex

This commit is contained in:
Motiejus Jakštys 2020-05-22 20:25:59 +03:00
parent c26db786b0
commit 9f460a4c4f

View File

@ -20,8 +20,9 @@ db/.faux_ready: zeimena.gpkg managedb
touch $@
GIT_DIR = $(shell git rev-parse --show-toplevel)/.git
version.tex: $(shell git ls-files .) $(GIT_DIR)
date "+%F %T %Z" | awk '{print "\\gdef\\GeneratedAt{"$$0"}%"}' > $@
( \
date "+\\gdef\\GeneratedAt{%F %T %Z}%"; \
[ -n "$$(git status --porcelain)" ] && suffix="-dirty"; \
git describe --tags | awk '{print "\\gdef\\VCDescribe{"$$0"'$$suffix'}%"}' >> $@
git describe --tags | awk '{print "\\gdef\\VCDescribe{"$$0"'$$suffix'}%"}'; \
) > $@