2
0
mirror of https://github.com/xcat2/xNBA.git synced 2024-11-25 19:08:35 +00:00

[build] Include git commit within version string when available

Originally-implemented-by: Christian Hesse <list@eworm.de>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown 2012-07-20 18:06:15 +01:00
parent b3b939c6ff
commit 348ec33aee

View File

@ -165,13 +165,17 @@ VERSION_PATCH = 0
EXTRAVERSION = +
MM_VERSION = $(VERSION_MAJOR).$(VERSION_MINOR)
VERSION = $(MM_VERSION).$(VERSION_PATCH)$(EXTRAVERSION)
GITVERSION := $(shell git describe --always --abbrev=1 --match "" 2>/dev/null)
ifneq ($(GITVERSION),)
VERSION += ($(GITVERSION))
endif
CFLAGS += -DVERSION_MAJOR=$(VERSION_MAJOR) \
-DVERSION_MINOR=$(VERSION_MINOR) \
-DVERSION_PATCH=$(VERSION_PATCH) \
-DVERSION=\"$(VERSION)\"
-DVERSION="\"$(VERSION)\""
IDENT = '$(@F) $(VERSION) (GPL) ipxe.org'
version :
@$(ECHO) $(VERSION)
@$(ECHO) "$(VERSION)"
###############################################################################
#