shared/zalloc.h \
src/weston-egl-ext.h
+# Track this dependency explicitly instead of using BUILT_SOURCES. We
+# add BUILT_SOURCES to CLEANFILES, but we want to keep git-version.h
+# in case we're building from tarballs.
+
+src/compositor.c : $(top_builddir)/src/git-version.h
+
noinst_LTLIBRARIES += \
libsession-helper.la
endif
endif
-src/git-version.h : .FORCE
- $(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)')\"" > $@-new; \
- cmp -s $@ $@-new || cp $@-new $@; \
- rm $@-new)
+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)')\"" > $@
+endif
.FORCE :
src/workspaces-server-protocol.h \
src/workspaces-protocol.c \
src/scaler-server-protocol.h \
- src/scaler-protocol.c \
- src/git-version.h
+ src/scaler-protocol.c
if BUILD_CLIENTS
AM_CONDITIONAL([HAVE_XMLLINT], [test "x$XMLLINT" != "x" -a "x$dtddir" != "x"])
AC_CONFIG_FILES([Makefile src/version.h src/weston.pc])
+
+AM_CONDITIONAL([HAVE_GIT_REPO], [test -f $srcdir/.git/logs/HEAD])
+
AC_OUTPUT
AC_MSG_RESULT([