1
0
mirror of https://github.com/TREX-CoE/trexio.git synced 2024-12-22 12:23:54 +01: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 ACLOCAL_AMFLAGS = -I m4
CLEANFILES = trexio.mod CLEANFILES = trexio.mod
BUILT_SOURCES = trexio.mod BUILT_SOURCES = trexio.mod
EXTRA_DIST = .git_hash
SUBDIRS = SUBDIRS =
@ -186,6 +187,9 @@ CLEANFILES += $(SOURCES) $(trexio_f) $(trexio_h)
BUILT_SOURCES += $(SOURCES) $(trexio_f) $(test_trexio_f) BUILT_SOURCES += $(SOURCES) $(trexio_f) $(test_trexio_f)
.git_hash:
git log | head -1 | cut -d ' ' -f 2 > .git_hash
$(SOURCES): $(trexio_f) $(SOURCES): $(trexio_f)
src/trexio.c: $(trexio_h) src/trexio.c: $(trexio_h)

View File

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