Skip to contentSkip to conversation

Makefile: add EXTRAVERSION support

PATCH Applied Tkaczyk Mariusz 2 participants 2 messages May 15, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 Makefile: add EXTRAVERSION support

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.

---

V2: rename LABEL to EXTRAVERSION.

 Makefile | 3 ++-
 ReadMe.c | 5 ++++-
 2 files changed, 6 insertions(+), 2 deletions(-)
Makefile +2 -1
index a33319a8..0a20b758 100644
@@ -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
ReadMe.c +4 -1
index eaf10423..06b8f7ee 100644
@@ -33,7 +33,10 @@
 #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
Signature · 1 line
2.25.0
Applied
#1 lore raw
Quoted 8 lines · Tkaczyk Mariusz

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.

---

V2: rename LABEL to EXTRAVERSION.

Applied!

Thanks,
Jes