diff --git a/Makefile b/Makefile index 9f5418f..2461e6e 100644 --- a/Makefile +++ b/Makefile @@ -68,6 +68,9 @@ CFLAGS += -DCONFIGFILE=\"$(CONFIGFILE)\" TARGETS += ot-recorder ocat +GIT_VERSION := $(shell git describe --long --abbrev=10 --dirty --tags 2>/dev/null || echo "tarball") +CFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\" + all: $(TARGETS) ot-recorder: recorder.o $(OTR_OBJS) $(OTR_EXTRA_OBJS) diff --git a/ocat.c b/ocat.c index 782b7c3..8164dd5 100644 --- a/ocat.c +++ b/ocat.c @@ -128,6 +128,7 @@ void print_versioninfo() #ifdef WITH_ENCRYPT printf("\tSODIUM VERSION = %s\n", SODIUM_VERSION_STRING); #endif + printf("\tGIT VERSION = %s\n", GIT_VERSION); exit(0); }