mirror of
https://github.com/ipxe/ipxe
synced 2026-02-28 03:11:18 +03:00
[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>
This commit is contained in:
committed by
Michael Brown
parent
410f50c2ee
commit
6153c09c41
@@ -190,8 +190,8 @@ VERSION_PATCH = 0
|
|||||||
EXTRAVERSION = +
|
EXTRAVERSION = +
|
||||||
MM_VERSION = $(VERSION_MAJOR).$(VERSION_MINOR)
|
MM_VERSION = $(VERSION_MAJOR).$(VERSION_MINOR)
|
||||||
VERSION = $(MM_VERSION).$(VERSION_PATCH)$(EXTRAVERSION)
|
VERSION = $(MM_VERSION).$(VERSION_PATCH)$(EXTRAVERSION)
|
||||||
|
ifneq ($(wildcard ../.git),)
|
||||||
GITVERSION := $(shell git describe --always --abbrev=1 --match "" 2>/dev/null)
|
GITVERSION := $(shell git describe --always --abbrev=1 --match "" 2>/dev/null)
|
||||||
ifneq ($(GITVERSION),)
|
|
||||||
VERSION += ($(GITVERSION))
|
VERSION += ($(GITVERSION))
|
||||||
endif
|
endif
|
||||||
version :
|
version :
|
||||||
|
|||||||
Reference in New Issue
Block a user