src/gui/Makefile.am: avoid some rebuilds

Origin commit data
------------------
Commit: 3efef60593
Author: vanhofen <vanhofen@gmx.de>
Date: 2022-01-09 (Sun, 09 Jan 2022)

Origin message was:
------------------
- src/gui/Makefile.am: avoid some rebuilds
This commit is contained in:
vanhofen
2022-01-09 22:34:05 +01:00
parent 51ae81ee7c
commit fdef8fcabd

View File

@@ -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