summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile5
-rw-r--r--main.c2
-rw-r--r--version.c1
-rw-r--r--version.h1
4 files changed, 7 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 1c7a5cc..71e13c6 100644
--- a/Makefile
+++ b/Makefile
@@ -40,7 +40,10 @@ LDLIBS = -lm \
GIT_VERSION = $(shell git log -1 --format='%h' -s .)
GIT_STATUS = $(shell [ -z "`git status -s -uno`" ] || echo +)
-CFLAGS += -DVERSION='"$(GIT_VERSION)$(GIT_STATUS)"'
+BUILD_DATE = $(shell date +'%Y%m%d-%H:%M')
+
+CFLAGS += -DVERSION='"$(GIT_VERSION)$(GIT_STATUS)"' \
+ -DBUILD_DATE='"$(BUILD_DATE)"'
ifneq ($(USE_WEBKIT),)
CFLAGS += -DUSE_WEBKIT `pkg-config --cflags webkit2gtk-4.0`
diff --git a/main.c b/main.c
index f6dfd60..1172381 100644
--- a/main.c
+++ b/main.c
@@ -202,7 +202,7 @@ int main(int argc, char **argv)
sexpr();
return 0;
case 'V':
- fprintf(stderr, "%s\n", version);
+ fprintf(stderr, "%s %sZ\n", version, build_date);
return 1;
default:
usage(*argv);
diff --git a/version.c b/version.c
index a8b276f..acb23cb 100644
--- a/version.c
+++ b/version.c
@@ -14,3 +14,4 @@
const char *version = VERSION;
+const char *build_date = BUILD_DATE;
diff --git a/version.h b/version.h
index deb101f..6f05124 100644
--- a/version.h
+++ b/version.h
@@ -14,5 +14,6 @@
#define VERSION_H
extern const char *version;
+extern const char *build_date;
#endif /* !VERSION_H */