diff --git a/makefile.shared b/makefile.shared index 117071c..a603131 100644 --- a/makefile.shared +++ b/makefile.shared @@ -14,9 +14,6 @@ UNINSTALL_CMD = $(LT) --mode=uninstall rm include makefile_include.mk - -VERSION := $(shell [ -e .git ] && { git describe --tags --abbrev=0 | sed -e 's/^v//' ; } || echo $(VERSION)) - #START_INS OBJECTS=src/addsub/fp_add.o src/addsub/fp_add_d.o src/addsub/fp_addmod.o src/addsub/fp_cmp.o \ src/addsub/fp_cmp_d.o src/addsub/fp_cmp_mag.o src/addsub/fp_sub.o src/addsub/fp_sub_d.o \ diff --git a/makefile_include.mk b/makefile_include.mk index b92468c..429803d 100644 --- a/makefile_include.mk +++ b/makefile_include.mk @@ -16,6 +16,11 @@ VERSION=0.13.1-next VERSION_LIB=1:0:0 VERSION_PC=0.13.1 +GIT_VERSION := $(shell [ -e .git ] && { printf git- ; git describe --tags --always --dirty ; } || echo $(VERSION)) +ifneq ($(GIT_VERSION),) +CFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\" +endif + # Compiler and Linker Names ifndef CROSS_COMPILE CROSS_COMPILE:= diff --git a/src/misc/fp_ident.c b/src/misc/fp_ident.c index 5177a54..ea11561 100644 --- a/src/misc/fp_ident.c +++ b/src/misc/fp_ident.c @@ -9,13 +9,17 @@ */ #include +#ifndef GIT_VERSION +#define GIT_VERSION TFM_VERSION_S +#endif + const char *fp_ident(void) { static char buf[1024]; memset(buf, 0, sizeof(buf)); snprintf(buf, sizeof(buf)-1, -"TomsFastMath " TFM_VERSION_S "\n" +"TomsFastMath " GIT_VERSION "\n" #if defined(TFM_IDENT_BUILD_DATE) "Built on " __DATE__ " at " __TIME__ "\n" #endif