Try to avoid infinite loop for revision target on svn repo

This commit is contained in:
Pierre Muller 2021-09-06 23:31:15 +02:00
parent ae8972083f
commit 810de9eaca
2 changed files with 32 additions and 28 deletions

View File

@ -574,32 +574,33 @@ endif
REVINC:=$(wildcard revision.inc)
ifneq ($(REVINC),)
override LOCALOPT+=-dREVINC
ifeq ($(REVSTR),)
ifneq ($(wildcard ../.git),)
ifneq ($(GIT),)
ifeq ($(REVSTR),)
ifneq ($(wildcard ../.git),)
ifneq ($(GIT),)
GITDESCRIBE=$(shell $(GIT) describe --dirty)
REVSTR:=$(word 2,$(subst -, ,$(GITDESCRIBE)))-$(word 3,$(subst -, ,$(GITDESCRIBE)))
ifneq ($(shell $(GIT) log @{u}..),)
ifneq ($(shell $(GIT) log @{u}..),)
REVSTR:=$(REVSTR)-unpushed
endif
ifneq ($(word 4,$(subst -, ,$(GITDESCRIBE))),)
endif
ifneq ($(word 4,$(subst -, ,$(GITDESCRIBE))),)
REVSTR:=$(REVSTR)-$(word 4,$(subst -, ,$(GITDESCRIBE)))
endif
endif
endif
export REVSTR
else
ifneq ($(SVNVERSION),)
else
ifneq ($(SVNVERSION),)
REVSTR:=$(subst r,,$(subst r1:,,r$(subst exported,,$(shell $(SVNVERSION) -c .))))
export REVSTR
else
endif
endif
endif
endif
ifeq ($(REVINC),force)
ifeq ($(REVSTR),)
REVSTR:=exported
export REVSTR
endif
endif
endif
endif
endif
endif
override LOCALOPT+=-d$(CPC_TARGET) -dGDB
ifdef LLVM
ifeq ($(findstring $(PPC_TARGET),x86_64 aarch64 arm),)

View File

@ -315,32 +315,35 @@ ifneq ($(REVINC),)
override LOCALOPT+=-dREVINC
# Automatically update revision.inc if
# svnversion executable is available
ifeq ($(REVSTR),)
ifneq ($(wildcard ../.git),)
ifneq ($(GIT),)
ifeq ($(REVSTR),)
ifneq ($(wildcard ../.git),)
ifneq ($(GIT),)
GITDESCRIBE=$(shell $(GIT) describe --dirty)
REVSTR:=$(word 2,$(subst -, ,$(GITDESCRIBE)))-$(word 3,$(subst -, ,$(GITDESCRIBE)))
ifneq ($(shell $(GIT) log @{u}..),)
ifneq ($(shell $(GIT) log @{u}..),)
REVSTR:=$(REVSTR)-unpushed
endif
ifneq ($(word 4,$(subst -, ,$(GITDESCRIBE))),)
endif
ifneq ($(word 4,$(subst -, ,$(GITDESCRIBE))),)
REVSTR:=$(REVSTR)-$(word 4,$(subst -, ,$(GITDESCRIBE)))
endif
endif
endif
export REVSTR
else
ifneq ($(SVNVERSION),)
else
ifneq ($(SVNVERSION),)
REVSTR:=$(subst r,,$(subst r1:,,r$(subst exported,,$(shell $(SVNVERSION) -c .))))
export REVSTR
else
endif
endif
endif
endif
# Avoid infinite loop
ifeq ($(REVINC),force)
ifeq ($(REVSTR),)
REVSTR:=exported
export REVSTR
endif
endif
endif
endif
endif
endif
# set correct defines (-d$(CPU_TARGET) is automatically added in makefile.fpc)
override LOCALOPT+=-d$(CPC_TARGET) -dGDB