]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Makefile: add EXTRAVERSION support
authorTkaczyk Mariusz <mariusz.tkaczyk@intel.com>
Fri, 15 May 2020 09:23:14 +0000 (11:23 +0200)
committerJes Sorensen <jsorensen@fb.com>
Fri, 15 May 2020 13:52:01 +0000 (09:52 -0400)
Add optional EXTRAVERSION parameter to Makefile and allow to mark version
by user friendly label. It might be useful when creating custom
spins of mdadm, or labeling some instance in between major releases.

Signed-off-by: Tkaczyk Mariusz <mariusz.tkaczyk@intel.com>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
Makefile
ReadMe.c

index a33319a890cf1b9335acd4eb4a0ea1dd1467cfc2..0a20b75800b7cc8bff15f1803199de11e278a275 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -105,7 +105,8 @@ VERSION = $(shell [ -d .git ] && git describe HEAD | sed 's/mdadm-//')
 VERS_DATE = $(shell [ -d .git ] && date --iso-8601 --date="`git log -n1 --format=format:%cd --date=iso --date=short`")
 DVERS = $(if $(VERSION),-DVERSION=\"$(VERSION)\",)
 DDATE = $(if $(VERS_DATE),-DVERS_DATE="\"$(VERS_DATE)\"",)
-CFLAGS += $(DVERS) $(DDATE)
+DEXTRAVERSION = $(if $(EXTRAVERSION),-DEXTRAVERSION="\" - $(EXTRAVERSION)\"",)
+CFLAGS += $(DVERS) $(DDATE) $(DEXTRAVERSION)
 
 # The glibc TLS ABI requires applications that call clone(2) to set up
 # TLS data structures, use pthreads until mdmon implements this support
index eaf104238d9e3fd20fd3275fa3bf596e9dbefc39..06b8f7eed972951ca0088edd417d7ae49e244de1 100644 (file)
--- a/ReadMe.c
+++ b/ReadMe.c
 #ifndef VERS_DATE
 #define VERS_DATE "2018-10-01"
 #endif
-char Version[] = "mdadm - v" VERSION " - " VERS_DATE "\n";
+#ifndef EXTRAVERSION
+#define EXTRAVERSION ""
+#endif
+char Version[] = "mdadm - v" VERSION " - " VERS_DATE EXTRAVERSION "\n";
 
 /*
  * File: ReadMe.c