Browse Source

* Fix REVSTR for windows OS

git-svn-id: trunk@14076 -
pierre 15 years ago
parent
commit
b6d0a93599
2 changed files with 41 additions and 8 deletions
  1. 18 4
      compiler/Makefile
  2. 23 4
      compiler/Makefile.fpc

+ 18 - 4
compiler/Makefile

@@ -348,13 +348,18 @@ CPUSUF=arm
 endif
 NOCPUDEF=1
 MSGFILE=msg/error$(FPCLANG).msg
+SVNVERSION:=$(wildcard $(addsuffix /svnversion$(SRCEXEEXT),$(SEARCHPATH)))
+ifeq ($(REVSTR),)
+ifneq ($(SVNVERSION),)
+REVSTR:=$(shell $(SVNVERSION) -c .)
+export REVSTR
+override LOCALOPT+=-dREVINC
+endif
+endif
 REVINC:=$(wildcard revision.inc)
 ifneq ($(REVINC),)
-override LOCALOPT+=-dREVINC
 ifeq ($(REVSTR),)
-SVNVERSION:=$(wildcard svnversion$(SRCEXEEXT))
-REVSTR:=$(shell svnversion .)
-export REVSTR
+override LOCALOPT+=-dREVINC
 endif
 endif
 override LOCALOPT+=-d$(CPC_TARGET) -dGDB -dBROWSERLOG
@@ -3335,7 +3340,16 @@ $(EXENAME) : $(wildcard *.pas) $(wildcard *.inc) msg \
 	     $(wildcard systems/*.pas) $(wilcard systems/*.inc) \
 	     $(wildcard $(CPC_TARGET)/*.pas) $(wildcard $(CPC_TARGET)/*.inc)
 ifneq ($(REVSTR),)
+ifdef USEZIPWRAPPER
+ifneq ($(ECHOREDIR),echo)
 	$(ECHOREDIR) "'$(REVSTR)'" > revision.inc
+else
+	$(ECHOREDIR) '$(REVSTR)' > revision.inc
+endif
+else
+	$(ECHOREDIR) "'$(REVSTR)'" > revision.inc
+endif
+	$(COMPILER) version.pas
 endif
 	$(COMPILER) pp.pas
 	$(EXECPPAS)

+ 23 - 4
compiler/Makefile.fpc

@@ -150,13 +150,22 @@ NOCPUDEF=1
 # Default message file
 MSGFILE=msg/error$(FPCLANG).msg
 
+
+# Automatically update revision.inc if
+# svnversion executable is available
+SVNVERSION:=$(wildcard $(addsuffix /svnversion$(SRCEXEEXT),$(SEARCHPATH)))
+ifeq ($(REVSTR),)
+ifneq ($(SVNVERSION),)
+REVSTR:=$(shell $(SVNVERSION) -c .)
+export REVSTR
+override LOCALOPT+=-dREVINC
+endif
+endif
+
 REVINC:=$(wildcard revision.inc)
 ifneq ($(REVINC),)
-override LOCALOPT+=-dREVINC
 ifeq ($(REVSTR),)
-SVNVERSION:=$(wildcard svnversion$(SRCEXEEXT))
-REVSTR:=$(shell svnversion .)
-export REVSTR
+override LOCALOPT+=-dREVINC
 endif
 endif
 
@@ -373,11 +382,21 @@ regdatarm : arm/armreg.dat
         cd arm && ../utils/mkarmreg$(SRCEXEEXT)
 
 # Make only the compiler
+# ECHOREDIR sometimes does not remove double quotes
 $(EXENAME) : $(wildcard *.pas) $(wildcard *.inc) msg \
              $(wildcard systems/*.pas) $(wilcard systems/*.inc) \
              $(wildcard $(CPC_TARGET)/*.pas) $(wildcard $(CPC_TARGET)/*.inc)
 ifneq ($(REVSTR),)
+ifdef USEZIPWRAPPER
+ifneq ($(ECHOREDIR),echo)
         $(ECHOREDIR) "'$(REVSTR)'" > revision.inc
+else
+        $(ECHOREDIR) '$(REVSTR)' > revision.inc
+endif
+else
+        $(ECHOREDIR) "'$(REVSTR)'" > revision.inc
+endif
+        $(COMPILER) version.pas
 endif
         $(COMPILER) pp.pas
         $(EXECPPAS)