summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile.am12
1 files changed, 11 insertions, 1 deletions
diff --git a/Makefile.am b/Makefile.am
index 90cb803..257ad9b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -18,7 +18,8 @@
# along with Marquee. If not, see <http://www.gnu.org/licenses/>.
if IN_GIT
-PACKAGE_VERSION_GIT = $$(git describe --tags --dirty | sed 's|^.*/||')
+PACKAGE_VERSION_GIT = $$({ git describe --tags --dirty 2>/dev/null || \
+ printf '%s' '$(PACKAGE_VERSION)'; } | sed 's|^.*/||')
else
PACKAGE_VERSION_GIT = $(PACKAGE_VERSION)
endif
@@ -43,4 +44,13 @@ marquee_LDADD = \
$(GTK_LIBS) \
$(WEBKIT2GTK_LIBS)
+marquee$(EXEEXT): $(marquee_OBJECTS) $(marquee_DEPENDENCIES) \
+ $(EXTRA_marquee_DEPENDENCIES)
+ @rm -f marquee$(EXEEXT)
+ @printf 'const char *PACKAGE_VERSION_GIT = "%s";\n' \
+ "$(PACKAGE_VERSION_GIT)" >version.c
+ $(AM_V_CCLD)$(LINK) version.c $(marquee_OBJECTS) $(marquee_LDADD) \
+ $(LIBS)
+ @rm -f version.c
+
include $(top_srcdir)/src/local.mk