changeset 1163:2991afb3bf71

Added support for including the svn revision number as the sub version with Visual C.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Fri, 16 Sep 2011 10:08:07 +0000
parents 52e3aa735bdb
children cb1e6b29aa7d
files makefile.vc win/__SVN__.REV
diffstat 2 files changed, 14 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/makefile.vc	Fri Sep 16 07:27:56 2011 +0000
+++ b/makefile.vc	Fri Sep 16 10:08:07 2011 +0000
@@ -3,6 +3,7 @@
 #
 VER = 21
 VERDOT = 2.1
+VERREV = 0
 
 #
 # Setup the source and destination directories
@@ -48,8 +49,15 @@
 LINK_DEBUG = -release
 !endif
 
+# Check the SVN revision number if possible
+!if ![subwcrev . win\__SVN__.REV SVN.REV > NUL]
+!include SVN.REV
+!message Revision is [$(VERREV)]
+SVNVERSION=-DVER_REV=$(VERREV)
+!endif
+
 CC = cl
-CFLAGS = -c $(PLATFORM_DEF) -D__WIN32__ -DMSVC -DBUILD_DLL -I$(SRCDIR)\platform -I$(SRCDIR)
+CFLAGS = -c $(PLATFORM_DEF) -D__WIN32__ -DMSVC -DBUILD_DLL -I$(SRCDIR)\platform -I$(SRCDIR) $(SVNVERSION)
 LIBS = wsock32.lib kernel32.lib user32.lib comctl32.lib gdi32.lib advapi32.lib shell32.lib comdlg32.lib ole32.lib oleaut32.lib userenv.lib msimg32.lib
 RES =
 LINKFLAGS = -machine:$(TARGET_CPU) -manifest $(LINK_DEBUG)
@@ -64,6 +72,8 @@
 
 all: dw dwcompat dwtest
 
+
+
 clean:
 	-erase *.dll
         -erase *.exe
@@ -79,8 +89,8 @@
 dw: dw.dll
 
 dw.dll: $(OBJS) $(DEFFILE)
-	-mkdir $(DWLIBDIR)
-	-mkdir $(DWDLLDIR)
+	-md $(DWLIBDIR)
+	-md $(DWDLLDIR)
 	$(LINK) @<<
 -out:$(@) -def:$(DEFFILE)
 $(LINKFLAGS) $(DLLLINKFLAGS)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/win/__SVN__.REV	Fri Sep 16 10:08:07 2011 +0000
@@ -0,0 +1,1 @@
+VERREV=$WCREV$
\ No newline at end of file