summaryrefslogtreecommitdiffstats
path: root/win/rules.vc
diff options
context:
space:
mode:
authorpatthoyts <patthoyts@users.sourceforge.net>2006-09-26 00:05:02 (GMT)
committerpatthoyts <patthoyts@users.sourceforge.net>2006-09-26 00:05:02 (GMT)
commitd421cc6148b8573ae4284cb05be84eb936f44623 (patch)
treec0ac86f04e183856c29bf53794757d77eeea7dbc /win/rules.vc
parent9ca74c27f3f89bb08b044b9bea127f0aa23fa9d5 (diff)
downloadtcl-d421cc6148b8573ae4284cb05be84eb936f44623.zip
tcl-d421cc6148b8573ae4284cb05be84eb936f44623.tar.gz
tcl-d421cc6148b8573ae4284cb05be84eb936f44623.tar.bz2
More fixing which struct stat to refer to. Some casts from time_t to int required.
Tcl_Time structure members are longs. Support for varying compiler options and build to platform-specific subdirs.
Diffstat (limited to 'win/rules.vc')
-rw-r--r--win/rules.vc78
1 files changed, 59 insertions, 19 deletions
diff --git a/win/rules.vc b/win/rules.vc
index 68e490d..1a1bda6 100644
--- a/win/rules.vc
+++ b/win/rules.vc
@@ -8,9 +8,10 @@
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
# Copyright (c) 2001-2003 David Gravereaux.
+# Copyright (c) 2003-2006 Patrick Thoyts
#
#------------------------------------------------------------------------------
-# RCS: @(#) $Id: rules.vc,v 1.23 2006/09/11 21:24:38 patthoyts Exp $
+# RCS: @(#) $Id: rules.vc,v 1.24 2006/09/26 00:05:03 patthoyts Exp $
#------------------------------------------------------------------------------
!ifndef _RULES_VC
@@ -25,7 +26,7 @@ rc32 = $(RC) # built-in default.
### Assume the normal default.
_INSTALLDIR = C:\Program Files\Tcl
!else
-### Fix the path seperators.
+### Fix the path separators.
_INSTALLDIR = $(INSTALLDIR:/=\)
!endif
@@ -74,7 +75,7 @@ COPY = copy /y >NUL
#----------------------------------------------------------
### test for optimizations
-!if [nmakehlp -c -Oti]
+!if [nmakehlp -c -Ot]
!message *** Compiler has 'Optimizations'
OPTIMIZING = 1
!else
@@ -82,7 +83,15 @@ OPTIMIZING = 1
OPTIMIZING = 0
!endif
-OPTIMIZATIONS =
+OPTIMIZATIONS =
+
+!if [nmakehlp -c -Ot]
+OPTIMIZATIONS = $(OPTIMIZATIONS) -Ot
+!endif
+
+!if [nmakehlp -c -Oi]
+OPTIMIZATIONS = $(OPTIMIZATIONS) -Oi
+!endif
!if [nmakehlp -c -Op]
OPTIMIZATIONS = $(OPTIMIZATIONS) -Op
@@ -108,15 +117,33 @@ DEBUGFLAGS = $(DEBUGFLAGS) -RTC1
DEBUGFLAGS = $(DEBUGFLAGS) -GZ
!endif
+COMPILERFLAGS =-W3
+
+!if [nmakehlp -c -YX]
+OPTIMIZATIONS = $(OPTIMIZATIONS) -YX
+!endif
+
!if "$(MACHINE)" == "IX86"
### test for pentium errata
!if [nmakehlp -c -QI0f]
!message *** Compiler has 'Pentium 0x0f fix'
-PENT_0F_ERRATA = 1
+COMPILERFLAGS = $(COMPILERFLAGSS) -QI0f
!else
!message *** Compiler doesn't have 'Pentium 0x0f fix'
-PENT_0F_ERRATA = 0
!endif
+!endif
+
+!if "$(MACHINE)" == "IA64"
+### test for Itanium errata
+!if [nmakehlp -c -QIA64_Bx]
+!message *** Compiler has 'B-stepping errata workarounds'
+COMPILERFLAGS = $(COMPILERFLAGS) -QIA64_Bx
+!else
+!message *** Compiler does not have 'B-stepping errata workarounds'
+!endif
+!endif
+
+!if "$(MACHINE)" == "IX86"
### test for -align:4096, when align:512 will do.
!if [nmakehlp -l -opt:nowin98]
!message *** Linker has 'Win98 alignment problem'
@@ -126,21 +153,26 @@ ALIGN98_HACK = 1
ALIGN98_HACK = 0
!endif
!else
-PENT_0F_ERRATA = 0
ALIGN98_HACK = 0
!endif
-!if "$(MACHINE)" == "IA64"
-### test for Itanium errata
-!if [nmakehlp -c -QIA64_Bx]
-!message *** Compiler has 'B-stepping errata workarounds'
-ITAN_B_ERRATA = 1
-!else
-!message *** Compiler doesn't have 'B-stepping errata workarounds'
-ITAN_B_ERRATA = 0
-!endif
+#----------------------------------------------------------
+# MSVC8 (ships with Visual Studio 2005) generates a manifest
+# file that we should link into the binaries. This is how.
+#----------------------------------------------------------
+
+_VC_MANIFEST_EMBED_EXE=
+_VC_MANIFEST_EMBED_DLL=
+!if ![cl /Zs /Tc NUL 2>&1 | find "Version 12" > NUL]
+VCVER=6
+!elseif ![cl /Zs /Tc NUL 2>&1 | find "Version 13" > NUL]
+VCVER=7
+!elseif ![cl /Zs /Tc NUL 2>&1 | find "Version 14" > NUL]
+VCVER=8
+_VC_MANIFEST_EMBED_EXE=if exist $@.manifest mt -nologo -manifest $@.manifest -outputresource:$@;1
+_VC_MANIFEST_EMBED_DLL=if exist $@.manifest mt -nologo -manifest $@.manifest -outputresource:$@;2
!else
-ITAN_B_ERRATA = 0
+VCVER=0
!endif
#----------------------------------------------------------
@@ -247,6 +279,13 @@ BUILDDIRTOP = Debug
BUILDDIRTOP = Release
!endif
+!if "$(MACHINE)" != "IX86"
+BUILDDIRTOP =$(BUILDDIRTOP)_$(MACHINE)
+!endif
+!if $(VCVER) > 6
+BUILDDIRTOP =$(BUILDDIRTOP)_VC$(VCVER)
+!endif
+
!if !$(DEBUG) || $(DEBUG) && $(UNCHECKED)
SUFX = $(SUFX:g=)
!endif
@@ -384,7 +423,7 @@ TCLINSTALL = 1
_TCLDIR = $(_INSTALLDIR)
!else
MSG=^
-Don't know where tcl.h is. Set the TCLDIR macro.
+Failed to find tcl.h. Set the TCLDIR macro.
!error $(MSG)
!endif
!else
@@ -397,7 +436,7 @@ TCLH = "$(_TCLDIR)\generic\tcl.h"
TCLINSTALL = 0
!else
MSG =^
-Don't know where tcl.h is. The TCLDIR macro doesn't appear correct.
+Failed to find tcl.h. The TCLDIR macro does not appear correct.
!error $(MSG)
!endif
!endif
@@ -470,5 +509,6 @@ TCLTOOLSDIR = $(_TCLDIR)\tools
!message *** Output directory will be '$(OUT_DIR)'
!message *** Suffix for binaries will be '$(SUFX)'
!message *** Optional defines are '$(OPTDEFINES)'
+!message *** Compiler version $(VCVER) options are '$(OPTIMIZATIONS) $(DEBUGFLAGS)'
!endif