add git version as compile flag

This commit is contained in:
Steffen Jaeckel 2017-05-02 10:35:00 +02:00
parent 7898864b24
commit 7ac857686d
2 changed files with 11 additions and 1 deletions

View File

@ -1,5 +1,9 @@
#include <tomcrypt_test.h>
#ifndef GIT_VERSION
#define GIT_VERSION "Undefined version"
#endif
#define LTC_TEST_FN(f) { f, #f }
static const struct {
@ -37,7 +41,7 @@ int main(int argc, char **argv)
long delta, dur = 0;
reg_algs();
printf("build == \n%s\n", crypt_build_settings);
printf("build == %s\n%s\n", GIT_VERSION, crypt_build_settings);
#ifdef USE_LTM
ltc_mp = ltm_desc;

View File

@ -78,6 +78,12 @@ CFLAGS += -Wno-typedef-redefinition -Wno-tautological-compare
endif
GIT_VERSION := $(shell [ -e .git ] && { echo -n git- ; git describe --tags --always --dirty ; } || echo $(VERSION))
ifneq ($(GIT_VERSION),)
CFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\"
endif
HASH=hashsum
CRYPT=encrypt
SMALL=small