Skip to content

Commit

Permalink
[build] Include git commit within version string when available
Browse files Browse the repository at this point in the history
Originally-implemented-by: Christian Hesse <list@eworm.de>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
  • Loading branch information
mcb30 committed Jul 20, 2012
1 parent b3b939c commit 348ec33
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Makefile
Expand Up @@ -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)"

###############################################################################
#
Expand Down

0 comments on commit 348ec33

Please sign in to comment.