From fdef8fcabdb9cda45a93ca09cfd6d2f6cd4794c8 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sun, 9 Jan 2022 22:34:05 +0100 Subject: [PATCH] src/gui/Makefile.am: avoid some rebuilds Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/3efef60593b5e47ea7c822fe0d2f3bd92e5ea7c8 Author: vanhofen Date: 2022-01-09 (Sun, 09 Jan 2022) Origin message was: ------------------ - src/gui/Makefile.am: avoid some rebuilds --- src/gui/Makefile.am | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/gui/Makefile.am b/src/gui/Makefile.am index 50c88374e..e7900355d 100644 --- a/src/gui/Makefile.am +++ b/src/gui/Makefile.am @@ -1,15 +1,17 @@ AM_CPPFLAGS = -fno-rtti -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS + BUILT_SOURCES = version.h -version.h: +VERSION = $(shell find version.h -mmin +60 2>/dev/null) +$(VERSION): @rm -f $@ @echo "#define BUILT_DATE \"$$(date)\"" > $@ @echo "#define BUILT_TIMESTAMP \"$$(date +%s)\"" >> $@ - @if test -d $(top_srcdir)/.git ; then \ - pushd $(top_srcdir) ; \ + @if test -d $(top_srcdir)/.git; then \ + pushd $(top_srcdir); \ GITTAG=$$(git tag -l "NI-*" | tail -n1); \ - GITDESCRIBE=$$(git describe --always --long --tags --match $$GITTAG | sed 's/-/./2' || echo "VCS failed") ; \ - popd ; \ - echo "#define VCS \"$${GITDESCRIBE}\"" >> $@ ; \ + GITDESCRIBE=$$(git describe --always --long --tags --match $$GITTAG | sed 's/-/./2' || echo "VCS failed"); \ + popd; \ + echo "#define VCS \"$${GITDESCRIBE}\"" >> $@; \ fi noinst_HEADERS = version.h .PHONY: version.h