aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Makefile5
-rw-r--r--src/ecgen.c11
2 files changed, 15 insertions, 1 deletions
diff --git a/src/Makefile b/src/Makefile
index b1caf60..8adbc53 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -29,6 +29,11 @@ LDFLAGS = -L../lib/parson -L../lib/sha1 -L../lib/pari
INCLUDES = -I. -I../lib
LIBS = -lrt -lpari -lpthread -lparson -lsha1
+GIT_COMMIT = $(shell git rev-parse --short HEAD)
+ifneq ($(GIT_COMMIT),)
+ CFLAGS += -DGIT_COMMIT=\"$(GIT_COMMIT)\"
+endif
+
####
ECGEN_SRC = ecgen.c $(wildcard */*.c)
diff --git a/src/ecgen.c b/src/ecgen.c
index bfc2dee..f031a6c 100644
--- a/src/ecgen.c
+++ b/src/ecgen.c
@@ -31,8 +31,17 @@
#include "io/output.h"
#include "util/timeout.h"
+#ifdef GIT_COMMIT
+#define GIT_VERSION "(git " GIT_COMMIT ")"
+#else
+#define GIT_VERSION ""
+#endif
+
const char *argp_program_version =
- "ecgen 0.7.2\n"
+ "ecgen 0.7.2" GIT_VERSION
+ "\n"
+ "Compiled with: " PARIVERSION
+ "\n\n"
"Copyright (C) 2017-2018 J08nY\n"
"License GPLv2: GNU GPL version 2 (or later) "
"<http://gnu.org/licenses/gpl.html>\n"