david/ipxe
david
/
ipxe
Archived
1
0
Fork 0

[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
1 changed files with 6 additions and 2 deletions

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)"
###############################################################################
#