Browse Source

--- Merging r14075 into '.':
C compiler/Makefile
U compiler/Makefile.fpc
--- Merging r14076 into '.':
G compiler/Makefile
G compiler/Makefile.fpc
--- Merging r14077 into '.':
G compiler/Makefile
G compiler/Makefile.fpc
--- Merging r14079 into '.':
G compiler/Makefile
G compiler/Makefile.fpc
--- Merging r14083 into '.':
G compiler/Makefile
G compiler/Makefile.fpc
--- Merging r14084 into '.':
G compiler/Makefile
G compiler/Makefile.fpc
--- Merging r14085 into '.':
G compiler/Makefile
G compiler/Makefile.fpc
Summary of conflicts:
Text conflicts: 1

# revisions: 14075,14076,14077,14079,14083,14084,14085
------------------------------------------------------------------------
r14075 | pierre | 2009-11-06 10:35:16 +0100 (Fri, 06 Nov 2009) | 1 line
Changed paths:
M /trunk/compiler/Makefile
M /trunk/compiler/Makefile.fpc

* Use SRCEXEEXT for svnversion as EXEEXT is for target and not defined in prerules
------------------------------------------------------------------------
------------------------------------------------------------------------
r14076 | pierre | 2009-11-06 11:18:07 +0100 (Fri, 06 Nov 2009) | 1 line
Changed paths:
M /trunk/compiler/Makefile
M /trunk/compiler/Makefile.fpc

* Fix REVSTR for windows OS
------------------------------------------------------------------------
------------------------------------------------------------------------
r14077 | pierre | 2009-11-06 11:34:24 +0100 (Fri, 06 Nov 2009) | 1 line
Changed paths:
M /trunk/compiler/Makefile
M /trunk/compiler/Makefile.fpc

* add -dREVINC even when REVSTR is already set, needed for cycle
------------------------------------------------------------------------
------------------------------------------------------------------------
r14079 | pierre | 2009-11-06 12:13:42 +0100 (Fri, 06 Nov 2009) | 1 line
Changed paths:
M /trunk/compiler/Makefile
M /trunk/compiler/Makefile.fpc

* Only update revision.inc if it is already present
------------------------------------------------------------------------
------------------------------------------------------------------------
r14083 | pierre | 2009-11-06 15:47:32 +0100 (Fri, 06 Nov 2009) | 1 line
Changed paths:
M /trunk/compiler/Makefile
M /trunk/compiler/Makefile.fpc

+ revision.inc rule added
------------------------------------------------------------------------
------------------------------------------------------------------------
r14084 | pierre | 2009-11-06 16:10:56 +0100 (Fri, 06 Nov 2009) | 1 line
Changed paths:
M /trunk/compiler/Makefile
M /trunk/compiler/Makefile.fpc

* Remove FORCE for revision.inc target, correct rule
------------------------------------------------------------------------
------------------------------------------------------------------------
r14085 | pierre | 2009-11-06 17:46:48 +0100 (Fri, 06 Nov 2009) | 1 line
Changed paths:
M /trunk/compiler/Makefile
M /trunk/compiler/Makefile.fpc

* fix problem when svn is not found and add phony revision rule
------------------------------------------------------------------------

git-svn-id: branches/fixes_2_4@14739 -

marco 15 years ago
parent
commit
9276d79294
2 changed files with 83 additions and 4 deletions
  1. 36 2
      compiler/Makefile
  2. 47 2
      compiler/Makefile.fpc

+ 36 - 2
compiler/Makefile

@@ -354,13 +354,20 @@ CPUSUF=arm
 endif
 NOCPUDEF=1
 MSGFILE=msg/error$(FPCLANG).msg
+SVNVERSION:=$(wildcard $(addsuffix /svnversion$(SRCEXEEXT),$(SEARCHPATH)))
 REVINC:=$(wildcard revision.inc)
 ifneq ($(REVINC),)
 override LOCALOPT+=-dREVINC
 ifeq ($(REVSTR),)
-SVNVERSION:=$(wildcard svnversion$(EXEEXT))
-REVSTR:=$(shell svnversion .)
+ifneq ($(SVNVERSION),)
+REVSTR:=$(shell $(SVNVERSION) -c .)
 export REVSTR
+else
+ifeq ($(REVINC),force)
+REVSTR:=exported
+export REVSTR
+endif
+endif
 endif
 endif
 override LOCALOPT+=-d$(CPC_TARGET) -dGDB -dBROWSERLOG
@@ -3373,11 +3380,38 @@ insdat: insdatx86 insdatarm
 regdatarm : arm/armreg.dat
 	    $(COMPILER) -FE$(COMPILERUTILSDIR) $(COMPILERUTILSDIR)/mkarmreg.pp
 	cd arm && ../utils/mkarmreg$(SRCEXEEXT)
+revision.inc :
+ifneq ($(REVSTR),)
+ifdef USEZIPWRAPPER
+ifneq ($(ECHOREDIR),echo)
+	$(ECHOREDIR) "'$(REVSTR)'" > revision.inc
+else
+	$(ECHOREDIR) '$(REVSTR)' > revision.inc
+endif
+else
+	$(ECHOREDIR) "'$(REVSTR)'" > revision.inc
+endif
+else
+	$(MAKE) revision.inc REVINC=force
+endif
+.PHONY : revision
+revision :
+	$(DEL) revision.inc
+	$(MAKE) revision.inc
 $(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)

+ 47 - 2
compiler/Makefile.fpc

@@ -156,15 +156,28 @@ NOCPUDEF=1
 # Default message file
 MSGFILE=msg/error$(FPCLANG).msg
 
+
+SVNVERSION:=$(wildcard $(addsuffix /svnversion$(SRCEXEEXT),$(SEARCHPATH)))
+# Check if revision.inc is present
 REVINC:=$(wildcard revision.inc)
 ifneq ($(REVINC),)
+# File revision.inc is present
+#Use it to compile version.pas unit
 override LOCALOPT+=-dREVINC
+# Automatically update revision.inc if
+# svnversion executable is available
 ifeq ($(REVSTR),)
-SVNVERSION:=$(wildcard svnversion$(EXEEXT))
-REVSTR:=$(shell svnversion .)
+ifneq ($(SVNVERSION),)
+REVSTR:=$(shell $(SVNVERSION) -c .)
+export REVSTR
+else
+ifeq ($(REVINC),force)
+REVSTR:=exported
 export REVSTR
 endif
 endif
+endif
+endif
 
 # set correct defines (-d$(CPU_TARGET) is automaticly added in makefile.fpc)
 override LOCALOPT+=-d$(CPC_TARGET) -dGDB -dBROWSERLOG
@@ -362,12 +375,44 @@ regdatarm : arm/armreg.dat
 	    $(COMPILER) -FE$(COMPILERUTILSDIR) $(COMPILERUTILSDIR)/mkarmreg.pp
         cd arm && ../utils/mkarmreg$(SRCEXEEXT)
 
+# revision.inc rule
+revision.inc :
+ifneq ($(REVSTR),)
+ifdef USEZIPWRAPPER
+ifneq ($(ECHOREDIR),echo)
+        $(ECHOREDIR) "'$(REVSTR)'" > revision.inc
+else
+        $(ECHOREDIR) '$(REVSTR)' > revision.inc
+endif
+else
+        $(ECHOREDIR) "'$(REVSTR)'" > revision.inc
+endif
+else
+	$(MAKE) revision.inc REVINC=force
+endif
+
+.PHONY : revision
+
+revision :
+	$(DEL) revision.inc
+	$(MAKE) revision.inc
+
 # 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)