浏览代码

Try to avoid infinite loop for revision target on svn repo

Pierre Muller 3 年之前
父节点
当前提交
810de9eaca
共有 2 个文件被更改,包括 32 次插入28 次删除
  1. 15 14
      compiler/Makefile
  2. 17 14
      compiler/Makefile.fpc

+ 15 - 14
compiler/Makefile

@@ -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),)

+ 17 - 14
compiler/Makefile.fpc

@@ -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