diff options
author | NeilBrown <neilb@suse.de> | 2013-06-25 08:27:05 +0200 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2013-06-25 08:27:05 +0200 |
commit | b379508eeb26273f6044080788ffa1eb257c96f4 (patch) | |
tree | 3991b93cb0ada6511c79bdcd5ecb52c1a6d8748c /Makefile | |
parent | Subject: Make wait_for and open_dev_excl faster (diff) | |
download | mdadm-b379508eeb26273f6044080788ffa1eb257c96f4.tar.xz mdadm-b379508eeb26273f6044080788ffa1eb257c96f4.zip |
Makefile/version: use version/date from .git if possible.
If being built from a git tree, use the version and date
information from the top commit rather than the hard-coded
values.
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -80,6 +80,12 @@ DIRFLAGS += -DMDMON_DIR=\"$(MDMON_DIR)\" DIRFLAGS += -DFAILED_SLOTS_DIR=\"$(FAILED_SLOTS_DIR)\" CFLAGS = $(CWFLAGS) $(CXFLAGS) -DSendmail=\""$(MAILCMD)"\" $(CONFFILEFLAGS) $(DIRFLAGS) +VERSION = $(shell [ -d .git ] && git describe HEAD | sed 's/mdadm-//') +VERS_DATE = $(shell [ -d .git ] && date --date="`git log -n1 --format=format:%cd --date=short`" '+%0dth %B %Y' | sed -e 's/1th/1st/' -e 's/2th/2nd/' -e 's/11st/11th/' -e 's/12nd/12th/') +DVERS = $(if $(VERSION),-DVERSION=\"$(VERSION)\",) +DDATE = $(if $(VERS_DATE),-DVERS_DATE="\"$(VERS_DATE)\"",) +CFLAGS += $(DVERS) $(DDATE) + # The glibc TLS ABI requires applications that call clone(2) to set up # TLS data structures, use pthreads until mdmon implements this support USE_PTHREADS = 1 |