From 32ec189662714ef682b8dcb876d663fa68e2a5f9 Mon Sep 17 00:00:00 2001 From: Jan-Piet Mens Date: Fri, 22 Jul 2016 09:51:06 +0200 Subject: [PATCH] embed git version/commit --- Makefile | 3 +++ ocat.c | 1 + 2 files changed, 4 insertions(+) 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); }