Merge pull request #307 from nbraud/scver.mk

Fixup build/scver.mk and allow explicitly specifying the VERSION_ID
This commit is contained in:
Alex Miller 2018-05-09 21:05:11 -07:00 committed by GitHub
commit d92e14cbc4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 18 additions and 14 deletions

View File

@ -98,8 +98,12 @@ endif
GITPRESENT := $(wildcard $(FDBDIR)/.git) GITPRESENT := $(wildcard $(FDBDIR)/.git)
HGPRESENT := $(wildcard $(FDBDIR)/.hg) HGPRESENT := $(wildcard $(FDBDIR)/.hg)
# Do not override version IDs if already set
ifneq ($(VERSION_ID),)
# Noop
# Use Git, if not missing # Use Git, if not missing
ifneq ($(GITPRESENT),) else ifneq ($(GITPRESENT),)
SCVER := $(shell cd "$(FDBDIR)" && git --version 2>/dev/null) SCVER := $(shell cd "$(FDBDIR)" && git --version 2>/dev/null)
ifneq ($(SCVER),) ifneq ($(SCVER),)
VERSION_ID := $(shell cd "$(FDBDIR)" && git rev-parse --verify HEAD) VERSION_ID := $(shell cd "$(FDBDIR)" && git rev-parse --verify HEAD)
@ -108,22 +112,22 @@ ifneq ($(GITPRESENT),)
else else
$(error Missing git executable on $(PLATFORM) ) $(error Missing git executable on $(PLATFORM) )
endif endif
# Otherwise, use Mercurial # Otherwise, use Mercurial
else else ifneq ($(HGPRESENT),)
# Otherwise, use Mercurial, if not missing SCVER := $(shell cd "$(FDBDIR)" && hg --version 2>/dev/null)
ifneq ($(HGPRESENT),) ifdef SCVER
SCVER := $(shell cd "$(FDBDIR)" && hg --version 2>/dev/null) VERSION_ID := $(shell cd "$(FDBDIR)" && hg id -n)
ifdef SCVER SOURCE_CONTROL := MERCURIAL
VERSION_ID := $(shell cd "$(FDBDIR)" && hg id -n) SCBRANCH := $(shell cd "$(FDBDIR)" && hg branch)
SOURCE_CONTROL := MERCURIAL
SCBRANCH := $(shell cd "$(FDBDIR)" && hg branch)
else
$(error Missing hg executable on $(PLATFORM))
endif
else else
FDBFILES := (shell ls -la $(FDBDIR)) $(error Missing hg executable on $(PLATFORM))
$(error Missing source control information for source on $(PLATFORM) in directory: $(FDBDIR) with files: $(FDBFILES))
endif endif
# No version control system
else
FDBFILES := $(shell ls -la $(FDBDIR))
$(error Missing source control information for source on $(PLATFORM) in directory: $(FDBDIR) with files: $(FDBFILES))
endif endif
# Set the RELEASE variable based on the KVRELEASE variable. # Set the RELEASE variable based on the KVRELEASE variable.