1
0
mirror of https://github.com/TREX-CoE/trexio.git synced 2025-04-25 18:04:44 +02:00

Store Git hash

This commit is contained in:
Anthony Scemama 2021-11-08 19:41:17 +01:00
parent b40c960cef
commit 42bf7ce94c
2 changed files with 24 additions and 13 deletions

View File

@ -35,6 +35,7 @@
ACLOCAL_AMFLAGS = -I m4
CLEANFILES = trexio.mod
BUILT_SOURCES = trexio.mod
EXTRA_DIST = .git_hash
SUBDIRS =
@ -186,6 +187,9 @@ CLEANFILES += $(SOURCES) $(trexio_f) $(trexio_h)
BUILT_SOURCES += $(SOURCES) $(trexio_f) $(test_trexio_f)
.git_hash:
git log | head -1 | cut -d ' ' -f 2 > .git_hash
$(SOURCES): $(trexio_f)
src/trexio.c: $(trexio_h)

View File

@ -169,7 +169,14 @@ if test "x${TREXIO_DEVEL}" != "x"; then
HAS_CPPCHECK=1
fi
GIT_HASH=`git log | head -1 | cut -d ' ' -f 2 | tee ${srcdir}/.git_hash`
else
GIT_HASH=`cat ${srcdir}/.git_hash`
fi
AC_DEFINE_UNQUOTED(GIT_HASH, ["${GIT_HASH}"], [Git SHA1 Hash])
## Libm
## ----
@ -191,7 +198,7 @@ AC_OUTPUT
echo \
"-------------------------------------------------
${PACKAGE_NAME} Version ${PACKAGE_VERSION} ${TREXIO_DEVEL}
${PACKAGE_NAME} Version ${PACKAGE_VERSION} ${GIT_HASH} ${TREXIO_DEVEL}
Prefix ........: ${prefix}
CC ............: ${CC}