diff --git a/demos/test.c b/demos/test.c index 689b976..3474f7e 100644 --- a/demos/test.c +++ b/demos/test.c @@ -1,5 +1,9 @@ #include +#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; diff --git a/makefile.include b/makefile.include index 1d1cfde..0e090c0 100644 --- a/makefile.include +++ b/makefile.include @@ -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