* [PATCH] Makefile: add LABEL support
@ 2020-05-13 11:00 Tkaczyk Mariusz
2020-05-14 14:24 ` Jes Sorensen
0 siblings, 1 reply; 2+ messages in thread
From: Tkaczyk Mariusz @ 2020-05-13 11:00 UTC (permalink / raw)
To: jes; +Cc: linux-raid
Add optional LABEL 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>
---
Makefile | 3 ++-
ReadMe.c | 5 ++++-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index a33319a8..9c129c54 100644
--- 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)
+DLABEL = $(if $(LABEL),-DLABEL="\" - $(LABEL)\"",)
+CFLAGS += $(DVERS) $(DDATE) $(DLABEL)
# The glibc TLS ABI requires applications that call clone(2) to set up
# TLS data structures, use pthreads until mdmon implements this support
diff --git a/ReadMe.c b/ReadMe.c
index eaf10423..883136df 100644
--- a/ReadMe.c
+++ b/ReadMe.c
@@ -33,7 +33,10 @@
#ifndef VERS_DATE
#define VERS_DATE "2018-10-01"
#endif
-char Version[] = "mdadm - v" VERSION " - " VERS_DATE "\n";
+#ifndef LABEL
+#define LABEL ""
+#endif
+char Version[] = "mdadm - v" VERSION " - " VERS_DATE LABEL "\n";
/*
* File: ReadMe.c
--
2.25.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Makefile: add LABEL support
2020-05-13 11:00 [PATCH] Makefile: add LABEL support Tkaczyk Mariusz
@ 2020-05-14 14:24 ` Jes Sorensen
0 siblings, 0 replies; 2+ messages in thread
From: Jes Sorensen @ 2020-05-14 14:24 UTC (permalink / raw)
To: Tkaczyk Mariusz; +Cc: linux-raid
On 5/13/20 7:00 AM, Tkaczyk Mariusz wrote:
> Add optional LABEL 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>
> ---
> Makefile | 3 ++-
> ReadMe.c | 5 ++++-
> 2 files changed, 6 insertions(+), 2 deletions(-)
I am not against this, but could we name it EXTRAVERSION to match what
the kernel does?
Cheers,
Jes
> diff --git a/Makefile b/Makefile
> index a33319a8..9c129c54 100644
> --- 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)
> +DLABEL = $(if $(LABEL),-DLABEL="\" - $(LABEL)\"",)
> +CFLAGS += $(DVERS) $(DDATE) $(DLABEL)
>
> # The glibc TLS ABI requires applications that call clone(2) to set up
> # TLS data structures, use pthreads until mdmon implements this support
> diff --git a/ReadMe.c b/ReadMe.c
> index eaf10423..883136df 100644
> --- a/ReadMe.c
> +++ b/ReadMe.c
> @@ -33,7 +33,10 @@
> #ifndef VERS_DATE
> #define VERS_DATE "2018-10-01"
> #endif
> -char Version[] = "mdadm - v" VERSION " - " VERS_DATE "\n";
> +#ifndef LABEL
> +#define LABEL ""
> +#endif
> +char Version[] = "mdadm - v" VERSION " - " VERS_DATE LABEL "\n";
>
> /*
> * File: ReadMe.c
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-05-14 14:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-13 11:00 [PATCH] Makefile: add LABEL support Tkaczyk Mariusz
2020-05-14 14:24 ` Jes Sorensen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).