diff --git a/Makefile b/Makefile index d31cf5b..f3e3893 100644 --- a/Makefile +++ b/Makefile @@ -21,7 +21,17 @@ LDFLAGS= -static-libgfortran -static-libgcc LIBS= /usr/local/lib/libquadmath.a # FFLAGS=-Wall -g -finit-real=nan -ffpe-trap=invalid -fcheck=all -fbounds-check -DIRECTIVES = -DREVISION="'$(shell svnversion src)'" +## +## Git information (used in the version string) +## + +# Short hash of the latest commit +GIT_REV ?= $(shell git rev-parse --short HEAD) + +# Whether the worktree and the latest commit differs +GIT_DIRTY ?= $(shell test -n "$$(git status --porcelain)" && echo "-dirty") + +DIRECTIVES = -DREVISION=\"$(GIT_REV)$(GIT_DIRTY)\" -DPREFIX=\"$(PREFIX)\" all: $(EXE)