Преглед на файлове

[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>
tags/v1.20.1
Michael Brown преди 12 години
родител
ревизия
348ec33aee
променени са 1 файла, в които са добавени 6 реда и са изтрити 2 реда
  1. 6
    2
      src/Makefile

+ 6
- 2
src/Makefile Целия файл

@@ -165,13 +165,17 @@ VERSION_PATCH	= 0
165 165
 EXTRAVERSION	= +
166 166
 MM_VERSION	= $(VERSION_MAJOR).$(VERSION_MINOR)
167 167
 VERSION		= $(MM_VERSION).$(VERSION_PATCH)$(EXTRAVERSION)
168
+GITVERSION := $(shell git describe --always --abbrev=1 --match "" 2>/dev/null)
169
+ifneq ($(GITVERSION),)
170
+VERSION		+= ($(GITVERSION))
171
+endif
168 172
 CFLAGS		+= -DVERSION_MAJOR=$(VERSION_MAJOR) \
169 173
 		   -DVERSION_MINOR=$(VERSION_MINOR) \
170 174
 		   -DVERSION_PATCH=$(VERSION_PATCH) \
171
-		   -DVERSION=\"$(VERSION)\"
175
+		   -DVERSION="\"$(VERSION)\""
172 176
 IDENT		= '$(@F) $(VERSION) (GPL) ipxe.org'
173 177
 version :
174
-	@$(ECHO) $(VERSION)
178
+	@$(ECHO) "$(VERSION)"
175 179
 
176 180
 ###############################################################################
177 181
 #

Loading…
Отказ
Запис