diff options
author | Patrick McDermott <pj@pehjota.net> | 2017-09-27 15:56:24 (EDT) |
---|---|---|
committer | Patrick McDermott <pj@pehjota.net> | 2017-09-27 15:56:24 (EDT) |
commit | e13d451da2d039049416486270033a1335e6ed4a (patch) | |
tree | 8425e0f1e103d41ab6c1c078ba3597e05d995d64 | |
parent | 369d0b084abcb1a863cd6c08dcd743bc96c14af4 (diff) | |
download | marquee-e13d451da2d039049416486270033a1335e6ed4a.zip marquee-e13d451da2d039049416486270033a1335e6ed4a.tar.gz marquee-e13d451da2d039049416486270033a1335e6ed4a.tar.bz2 |
Makefile.am: Link against temporary version.c file
Also add better error handling to PACKAGE_VERSION_GIT macro.
-rw-r--r-- | Makefile.am | 12 |
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 |