build: Add a rule for creating git-version.h when we don't have a git repo

For dist tarballs we ship git-version.h but if you do a git archive or
similar to check out a source tree, there's no git-version.h and no
way to make one.

https://bugs.freedesktop.org/show_bug.cgi?id=74459
This commit is contained in:
Kristian Høgsberg 2014-02-03 10:55:51 -08:00
parent 5124b53a13
commit 1d2dd077e7

View File

@ -113,6 +113,10 @@ endif
if HAVE_GIT_REPO
src/git-version.h : $(top_srcdir)/.git/logs/HEAD
$(AM_V_GEN)echo "#define BUILD_ID \"$(shell git --git-dir=$(top_srcdir)/.git describe --always --dirty) $(shell git --git-dir=$(top_srcdir)/.git log -1 --format='%s (%ci)')\"" > $@
else
src/git-version.h :
$(AM_V_GEN)echo "#define BUILD_ID \"unknown (not built from git or tarball)\"" > $@
endif
.FORCE :