summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Eckhardt <uli@uli-eckhardt.de>2017-05-12 16:50:15 (GMT)
committerUlrich Eckhardt <uli@uli-eckhardt.de>2017-05-12 16:50:15 (GMT)
commitaf249bc2201bb9006d47eb203318f9cd488abe8a (patch)
treec41c42384b39a1de7c7bb30f01701c5d0825fb57
parent3b55f61a87003a2fe0ea8dace4e9867761853bf6 (diff)
downloadvdr-plugin-radio-af249bc2201bb9006d47eb203318f9cd488abe8a.tar.gz
vdr-plugin-radio-af249bc2201bb9006d47eb203318f9cd488abe8a.tar.bz2
Add GIT Version information
-rwxr-xr-x[-rw-r--r--]Makefile9
-rwxr-xr-xradio.c7
2 files changed, 13 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 5a14a28..631e845 100644..100755
--- a/Makefile
+++ b/Makefile
@@ -11,7 +11,11 @@ PLUGIN = radio
### The version number of this plugin (taken from the main source file):
-VERSION = $(shell grep 'static const char \*VERSION *=' $(PLUGIN).c | awk '{ print $$6 }' | sed -e 's/[";]//g')
+VERSION = $(shell grep 'static const char \*VERSION *=' $(PLUGIN).c | \
+ grep -v GIT \
+ awk '{ print $$6 }' | sed -e 's/[";]//g')
+
+GIT_REV = $(shell git describe --always 2>/dev/null)
### The directory environment:
@@ -49,7 +53,8 @@ SOFILE = libvdr-$(PLUGIN).so
INCLUDES +=
-DEFINES += -DPLUGIN_NAME_I18N='"$(PLUGIN)"'
+DEFINES += -DPLUGIN_NAME_I18N='"$(PLUGIN)"' \
+ $(if $(GIT_REV), -DGIT_REV='"$(GIT_REV)"')
### The object files (add further files here):
diff --git a/radio.c b/radio.c
index 1853912..a7f1415 100755
--- a/radio.c
+++ b/radio.c
@@ -20,7 +20,12 @@
#error This version of radio-plugin requires vdr >= 1.7.37
#endif
-static const char *VERSION = "1.0.1";
+#ifndef GIT_REV
+static const char *VERSION = "1.0.1";
+#else
+static const char *VERSION = GIT_REV;
+#endif
+
static const char *DESCRIPTION = trNOOP("Radio Background-Image/RDS-Text");
static const char *MAINMENUENTRY = trNOOP("Show RDS-Radiotext");
char *ConfigDir;