summaryrefslogtreecommitdiffstats
path: root/win/rules.vc
diff options
context:
space:
mode:
Diffstat (limited to 'win/rules.vc')
-rw-r--r--win/rules.vc99
1 files changed, 92 insertions, 7 deletions
diff --git a/win/rules.vc b/win/rules.vc
index bb9cc30..0bc3469 100644
--- a/win/rules.vc
+++ b/win/rules.vc
@@ -10,7 +10,7 @@
# Copyright (c) 2001-2002 David Gravereaux.
#
#------------------------------------------------------------------------------
-# RCS: @(#) $Id: rules.vc,v 1.8 2002/06/14 14:42:21 davygrvy Exp $
+# RCS: @(#) $Id: rules.vc,v 1.9 2002/11/04 05:50:19 davygrvy Exp $
#------------------------------------------------------------------------------
!ifndef _RULES_VC
@@ -22,13 +22,34 @@ lib32 = lib
rc32 = $(RC) # built-in default.
!ifndef INSTALLDIR
-INSTALLDIR = C:\Progra~1\Tcl
+### Assume the normal default.
+_INSTALLDIR = C:\Program Files\Tcl
+!else
+### Fix the path seperators.
+_INSTALLDIR = $(INSTALLDIR:/=\)
!endif
!ifndef MACHINE
MACHINE = IX86
!endif
+
+#----------------------------------------------------------
+# Set the proper copy method to avoid overwrite questions
+# to the user when copying files.
+#----------------------------------------------------------
+
+!if "$(OS)" == "Windows_NT"
+!if ![ver | find "4.0" > nul]
+CPY = echo y | xcopy /i
+!else
+CPY = xcopy /i /y
+!endif
+!else
+CPY = xcopy /i
+!endif
+
+
!message ===============================================================================
#----------------------------------------------------------
@@ -46,7 +67,7 @@ MACHINE = IX86
#----------------------------------------------------------
### test for optimizations
-!if [nmakehlp -c -Otip ]
+!if [nmakehlp -c -Otip]
!message *** Compiler has 'Optimizations'
OPTIMIZING = 1
!else
@@ -100,7 +121,7 @@ DEBUG = 0
PROFILE = 0
MSVCRT = 0
LOIMPACT = 0
-TCL_LINKWITHEXTENSIONS = 0
+TCL_USE_STATIC_PACKAGES = 0
!else
!if [nmakehlp -f $(OPTS) "static"]
!message *** Doing static
@@ -116,9 +137,9 @@ MSVCRT = 0
!endif
!if [nmakehlp -f $(OPTS) "linkexten"]
!message *** Doing linkexten
-TCL_LINKWITHEXTENSIONS = 1
+TCL_USE_STATIC_PACKAGES = 1
!else
-TCL_LINKWITHEXTENSIONS = 0
+TCL_USE_STATIC_PACKAGES = 0
!endif
!if [nmakehlp -f $(OPTS) "threads"]
!message *** Doing threads
@@ -151,7 +172,7 @@ LOIMPACT = 0
# Make sure we don't build overly fat DLLs.
MSVCRT = 1
# We shouldn't statically put the extensions inside the shell when dynamic.
-TCL_LINKWITHEXTENSIONS = 0
+TCL_USE_STATIC_PACKAGES = 0
!endif
@@ -251,6 +272,70 @@ OPTDEFINES = $(OPTDEFINES) -DSTATIC_BUILD
#----------------------------------------------------------
+# Get common info used when building extensions.
+#----------------------------------------------------------
+
+!if "$(PROJECT)" != "tcl"
+
+!if !defined(TCLDIR)
+!if exist("$(_INSTALLDIR)\include\tcl.h")
+TCLINSTALL = 1
+_TCLDIR = $(_INSTALLDIR)
+!else
+MSG=^
+Don't know where tcl.h is. Set the TCLDIR macro.
+!error $(MSG)
+!endif
+!else
+_TCLDIR = $(TCLDIR:/=\)
+!if exist("$(_TCLDIR)\include\tcl.h")
+TCLINSTALL = 1
+!elseif exist("$(_TCLDIR)\generic\tcl.h")
+TCLINSTALL = 0
+!else
+MSG =^
+Don't know where tcl.h is. The TCLDIR macro doesn't appear correct.
+!error $(MSG)
+!endif
+!endif
+
+### TODO: add a command to nmakehlp.c to grep for Tcl's version from tcl.h.
+### Because nmake can't return a string, we'll need to play games with return
+### codes :) It might look something like this:
+#!if [nmakehlp -g $(TCL.H)] == 81
+#TCL_DOTVERSION = 8.1
+#!elseif [nmakehlp -g $(TCL.H)] == 82
+#TCL_DOTVERSION = 8.2
+#...
+#!endif
+
+TCL_DOTVERSION = 8.4
+TCL_VERSION = $(TCL_DOTVERSION:.=)
+
+!if $(TCLINSTALL)
+TCLSH = "$(_INSTALLDIR)\bin\tclsh$(TCL_VERSION)$(SUFX).exe"
+TCLSTUBLIB = "$(_INSTALLDIR)\lib\tclstub$(TCL_VERSION).lib"
+TCLIMPLIB = "$(_INSTALLDIR)\lib\tcl$(TCL_VERSION)$(SUFX).lib"
+TCL_LIBRARY = $(_INSTALLDIR)\lib
+TCLREGLIB = "$(_INSTALLDIR)\lib\tclreg11$(SUFX:t=).lib"
+TCLDDELIB = "$(_INSTALLDIR)\lib\tcldde12$(SUFX:t=).lib"
+COFFBASE = \must\have\tcl\sources\to\build\this\target
+TCLTOOLSDIR = \must\have\tcl\sources\to\build\this\target
+!else
+TCLSH = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tclsh$(TCL_VERSION)$(SUFX).exe"
+TCLSTUBLIB = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tclstub$(TCL_VERSION).lib"
+TCLIMPLIB = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tcl$(TCL_VERSION)$(SUFX).lib"
+TCL_LIBRARY = $(_TCLDIR)\library
+TCLREGLIB = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tclreg11$(SUFX:t=).lib"
+TCLDDELIB = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tcldde12$(SUFX:t=).lib"
+COFFBASE = "$(_TCLDIR)\win\coffbase.txt"
+TCLTOOLSDIR = $(_TCLDIR)\tools
+!endif
+
+!endif
+
+
+#----------------------------------------------------------
# Display stats being used.
#----------------------------------------------------------