Prechádzať zdrojové kódy

Try to avoid infinite loop for revision target on svn repo

Pierre Muller 3 rokov pred
rodič
commit
810de9eaca
2 zmenil súbory, kde vykonal 32 pridanie a 28 odobranie
  1. 15 14
      compiler/Makefile
  2. 17 14
      compiler/Makefile.fpc

+ 15 - 14
compiler/Makefile

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

+ 17 - 14
compiler/Makefile.fpc

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