build: Add a rule for creating git-version.h when we don't have a git repo
authorKristian Høgsberg <krh@bitplanet.net>
Mon, 3 Feb 2014 18:55:51 +0000 (10:55 -0800)
committerKristian Høgsberg <krh@bitplanet.net>
Mon, 3 Feb 2014 18:55:51 +0000 (10:55 -0800)
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

Makefile.am

index 6eab511..4991c94 100644 (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 :