Explorar el Código

[build] Set GITVERSION only if there is a git repository

The $(BIN)/version.%.o target will fail if iPXE is built within a
non-git repository, e.g. when the user downloaded and extracted an
archive containing iPXE sources, *and* if any parent directory of the
iPXE sources is a git repository (or even contains a directory named
".git").  This is because git will by default ascend the directory
tree and look for ".git".

The problem typically manifests on source based distributions, see for
example https://bugs.gentoo.org/show_bug.cgi?id=482804

Modified-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Florian Schmaus hace 10 años
padre
commit
6153c09c41
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1
    1
      src/Makefile

+ 1
- 1
src/Makefile Ver fichero

@@ -190,8 +190,8 @@ VERSION_PATCH	= 0
190 190
 EXTRAVERSION	= +
191 191
 MM_VERSION	= $(VERSION_MAJOR).$(VERSION_MINOR)
192 192
 VERSION		= $(MM_VERSION).$(VERSION_PATCH)$(EXTRAVERSION)
193
+ifneq ($(wildcard ../.git),)
193 194
 GITVERSION := $(shell git describe --always --abbrev=1 --match "" 2>/dev/null)
194
-ifneq ($(GITVERSION),)
195 195
 VERSION		+= ($(GITVERSION))
196 196
 endif
197 197
 version :

Loading…
Cancelar
Guardar