summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordavygrvy <davygrvy@pobox.com>2001-11-08 00:22:22 (GMT)
committerdavygrvy <davygrvy@pobox.com>2001-11-08 00:22:22 (GMT)
commitf06c66bc9eef4fad9dda1251ab50c5128e3c5327 (patch)
treec6c5a02d8c4d61a455886f0f11ee29e737c846ec
parentc901b78885e45b16b089ef8c8cd4e6caf8201dc8 (diff)
downloadtcl-f06c66bc9eef4fad9dda1251ab50c5128e3c5327.zip
tcl-f06c66bc9eef4fad9dda1251ab50c5128e3c5327.tar.gz
tcl-f06c66bc9eef4fad9dda1251ab50c5128e3c5327.tar.bz2
* win/rules.vc:
* win/makefile.vc: Dropped the NOMSVCRT macro and put it on the option list instead. It makes more sense to me this way as NOMSVCRT=0 would only be the valid setting. Fixed the dde and reg extension for building static. Improved, but not perfected, the winhelp target.
-rw-r--r--win/makefile.vc84
-rw-r--r--win/rules.vc44
2 files changed, 64 insertions, 64 deletions
diff --git a/win/makefile.vc b/win/makefile.vc
index b457045..7152620 100644
--- a/win/makefile.vc
+++ b/win/makefile.vc
@@ -1,7 +1,7 @@
#--------------------------------------------------------------------------------
# makefile.vc --
#
-# Microsoft Visual C++ makefile for use with nmake.exe v1.52+ (VC++ 5.0+)
+# Microsoft Visual C++ makefile for use with nmake.exe v1.62+ (VC++ 5.0+)
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
@@ -12,7 +12,7 @@
# Copyright (c) 2001 Tomasoft Engineering.
#
#--------------------------------------------------------------------------------
-# RCS: @(#) $Id: makefile.vc,v 1.67 2001/11/07 03:39:30 davygrvy Exp $
+# RCS: @(#) $Id: makefile.vc,v 1.68 2001/11/08 00:22:22 davygrvy Exp $
#--------------------------------------------------------------------------------
!if "$(MSVCDIR)" == ""
@@ -61,24 +61,21 @@ the environment. Jump to this line to read the new instructions.
# Sets where to install Tcl from the built binaries.
# C:\Progra~1\Tcl is assumed when not specified.
#
-# OPTS=static,threads,symbols,profile,none
+# OPTS=static,msvcrt,threads,symbols,profile,none
# Sets special options for the core. The default is for none.
# Any combination of the above may be used (comma separated).
# 'none' will over-ride everything to nothing.
#
# static = Builds a static library of the core instead of a
# dll. The shell will be static (and large), as well.
+# msvcrt = Effects the static option only to switch it from
+# using libcmt(d) as the C runtime [by default] to
+# msvcrt(d). This is useful for static embedding
+# support.
# threads = Turns on full multithreading support.
# symbols = Adds symbols for step debugging.
# profile = Adds profiling hooks. Map file is assumed.
#
-# NOMSVCRT=(0|1)
-# Allows the core to be compiled with libcmt(d) instead of
-# msvcrt(d). For a non-static core, msvcrt(d) is the default.
-# For a static core, libcmt(d) is the default. This hook is
-# useful if you want to build a static library that can link to
-# msvcrt(d) instead.
-#
# STATS=memdbg,compdbg,compstat,none
# Sets optional memory and bytecode compiler debugging code added
# to the core. The default is for none. Any combination of the
@@ -158,10 +155,11 @@ TCLSTUBLIB = $(OUT_DIR)\$(TCLSTUBLIBNAME)
TCLSH = $(OUT_DIR)\$(PROJECT)sh$(VERSION)$(SUFX).exe
TCLPIPEDLLNAME = $(PROJECT)pip$(VERSION).dll
TCLPIPEDLL = $(OUT_DIR)\$(TCLPIPEDLLNAME)
-TCLREGDLLNAME = $(PROJECT)reg$(REGVERSION)$(DBGX).dll
+
+TCLREGDLLNAME = $(PROJECT)reg$(REGVERSION)$(SUFX).$(EXT)
TCLREGDLL = $(OUT_DIR)\$(TCLREGDLLNAME)
-TCLDDEDLLNAME = $(PROJECT)dde$(DDEVERSION)$(DBGX).dll
+TCLDDEDLLNAME = $(PROJECT)dde$(DDEVERSION)$(SUFX).$(EXT)
TCLDDEDLL = $(OUT_DIR)\$(TCLDDEDLLNAME)
TCLTEST = $(OUT_DIR)\$(PROJECT)test.exe
@@ -298,14 +296,15 @@ cdebug = -Z7 -Od -WX
# declarations common to all compiler options
cflags = -c -W3 -nologo -Fp$(TMP_DIR)\ -YX
-!if $(NOMSVCRT)
-cvarsdll = -MT$(DBGX)
+!if $(MSVCRT)
+crt = -MD$(DBGX)
!else
-cvarsdll = -MD$(DBGX)
+crt = -MT$(DBGX)
!endif
-TCL_CFLAGS = $(cdebug) $(cflags) $(cvarsdll) $(TCL_INCLUDES) $(TCL_DEFINES)
-CON_CFLAGS = $(cdebug) $(cflags) $(cvarsdll) -DCONSOLE
+BASE_CLFAGS = $(cdebug) $(cflags) $(crt) $(TCL_INCLUDES)
+TCL_CFLAGS = $(BASE_CLFAGS) $(TCL_DEFINES)
+CON_CFLAGS = $(cdebug) $(cflags) $(crt) -DCONSOLE
######################################################################
# Link flags
@@ -377,12 +376,10 @@ $(TCLSTUBLIB): $(TCLSTUBOBJS)
$(lib32) -nologo -out:$@ $(TCLSTUBOBJS)
$(TCLSH): $(TCLSHOBJS) $(TCLIMPLIB)
- $(link32) $(ldebug) $(conlflags) -stack:2300000 -out:$@ $(baselibs) \
- $(TCLIMPLIB) $(TCLSHOBJS)
+ $(link32) $(ldebug) $(conlflags) -stack:2300000 -out:$@ $(baselibs) $**
$(TCLTEST): $(TCLTESTOBJS) $(TCLIMPLIB)
- $(link32) $(ldebug) $(conlflags) -stack:2300000 -out:$@ $(baselibs) \
- $(TCLIMPLIB) $(TCLTESTOBJS)
+ $(link32) $(ldebug) $(conlflags) -stack:2300000 -out:$@ $(baselibs) $**
$(TCLPIPEDLL): $(WINDIR)\stub16.c
$(cc32) $(CON_CFLAGS) -Fo$(TMP_DIR)\ $(WINDIR)\stub16.c
@@ -390,16 +387,20 @@ $(TCLPIPEDLL): $(WINDIR)\stub16.c
$(TCLDDEDLL): $(TMP_DIR)\tclWinDde.obj $(TCLSTUBLIB)
+!if $(STATIC_BUILD)
+ $(lib32) -nologo -out:$@ $(TMP_DIR)\tclWinDde.obj
+!else
$(link32) $(ldebug) $(dlllflags) -out:$@ $** $(baselibs)
-!if !$(STATIC_BUILD)
-@del $*.exp
-@del $*.lib
!endif
$(TCLREGDLL): $(TMP_DIR)\tclWinReg.obj $(TCLSTUBLIB)
+!if $(STATIC_BUILD)
+ $(lib32) -nologo -out:$@ $(TMP_DIR)\tclWinReg.obj
+!else
$(link32) $(ldebug) $(dlllflags) -out:$@ $** $(baselibs)
-!if !$(STATIC_BUILD)
-@del $*.exp
-@del $*.lib
!endif
@@ -482,20 +483,23 @@ genstubs:
TCLTOOLS = $(ROOT)/tools
MAN2TCL = $(TCLTOOLS)/man2tcl
TCLRTF = $(TCLTOOLS)/tcl.rtf
-TCLHPJ = $(TCLTOOLS)/tcl.hpj
MAN2HELP = $(TCLTOOLS)/man2help.tcl
-winhelp: $(TCLRTF)
- start /wait hcrtf.exe -xn $(TCLHPJ)
+winhelp: $(OUT_DIR)\$(PROJECT)$(VERSION).hlp
+
+$(OUT_DIR)\$(PROJECT)$(VERSION).hlp : $(TCLRTF)
+ cd $(TCLTOOLS)
+ start /wait hcrtf.exe -xn tcl.hpj
+ copy $(PROJECT)$(VERSION).hlp ..\win\$(OUT_DIR)
+ copy $(PROJECT)$(VERSION).cnt ..\win\$(OUT_DIR)
$(MAN2TCL).exe: $(MAN2TCL).obj
cd $(TCLTOOLS)
- $(cc32) /nologo /G4 /ML /O2 $(MAN2TCL).c
+ $(cc32) -nologo -G4 -ML -O2 $(MAN2TCL).c
$(TCLRTF): $(MAN2TCL).exe $(TCLSH)
cd $(TCLTOOLS)
..\win\$(TCLSH) $(MAN2HELP) $(PROJECT) $(VERSION) $(ROOT)/doc ../../tk$(DOTVERSION)/doc
-
#
# Special case object file targets
#
@@ -515,21 +519,31 @@ $(TMP_DIR)\tclTestObj.obj: $(GENERICDIR)\tclTestObj.c
$(TMP_DIR)\tclWinTest.obj: $(WINDIR)\tclWinTest.c
$(cc32) $(TCL_CFLAGS) -Fo$@ $?
-$(TMP_DIR)\tclAppInit.obj : $(WINDIR)\tclAppInit.c
+$(TMP_DIR)\tclAppInit.obj: $(WINDIR)\tclAppInit.c
$(cc32) $(TCL_CFLAGS) -Fo$@ $?
# The following objects should be built using the stub interfaces
-$(TMP_DIR)\tclWinReg.obj : $(WINDIR)\tclWinReg.c
- $(cc32) $(TCL_CFLAGS) -DUSE_TCL_STUBS -DTCL_THREADS=1 -Fo$@ $?
+$(TMP_DIR)\tclWinReg.obj: $(WINDIR)\tclWinReg.c
+!if $(STATIC_BUILD)
+ $(cc32) $(BASE_CLFAGS) -DTCL_THREADS=1 -DSTATIC_BUILD -Fo$@ $?
+!else
+ $(cc32) $(BASE_CLFAGS) -DTCL_THREADS=1 -DUSE_TCL_STUBS -Fo$@ $?
+!endif
+
+
+$(TMP_DIR)\tclWinDde.obj: $(WINDIR)\tclWinDde.c
+!if $(STATIC_BUILD)
+ $(cc32) $(BASE_CLFAGS) -DTCL_THREADS=1 -DSTATIC_BUILD -Fo$@ $?
+!else
+ $(cc32) $(BASE_CLFAGS) -DTCL_THREADS=1 -DUSE_TCL_STUBS -Fo$@ $?
+!endif
-$(TMP_DIR)\tclWinDde.obj : $(WINDIR)\tclWinDde.c
- $(cc32) $(TCL_CFLAGS) -DUSE_TCL_STUBS -DTCL_THREADS=1 -Fo$@ $?
# The following objects are part of the stub library and should not
# be built as DLL objects but none of the symbols should be exported
-$(TMP_DIR)\tclStubLib.obj : $(GENERICDIR)\tclStubLib.c
+$(TMP_DIR)\tclStubLib.obj: $(GENERICDIR)\tclStubLib.c
$(cc32) $(cdebug) $(cflags) -Zl -DSTATIC_BUILD $(TCL_INCLUDES) -Fo$@ $?
@@ -589,3 +603,5 @@ clean:
-@$(RM) $(TMP_DIR)\*.exe
-@$(RMDIR) $(OUT_DIR)
-@$(RMDIR) $(TMP_DIR)
+
+.SUFFIXES:.c .rc
diff --git a/win/rules.vc b/win/rules.vc
index 7603bbb..81dc1af 100644
--- a/win/rules.vc
+++ b/win/rules.vc
@@ -10,7 +10,7 @@
# Copyright (c) 2001 Tomasoft Engineering.
#
#------------------------------------------------------------------------------
-# RCS: @(#) $Id: rules.vc,v 1.1 2001/11/07 03:39:30 davygrvy Exp $
+# RCS: @(#) $Id: rules.vc,v 1.2 2001/11/08 00:22:22 davygrvy Exp $
#------------------------------------------------------------------------------
!ifndef _RULES_VC
@@ -38,6 +38,7 @@ STATIC_BUILD = 0
TCL_THREADS = 0
DEBUG = 0
PROFILE = 0
+MSVCRT = 0
!else
!if ![echo $(OPTS) | find /i "static" > nul]
!message *** Doing static
@@ -45,6 +46,12 @@ STATIC_BUILD = 1
!else
STATIC_BUILD = 0
!endif
+!if ![echo $(OPTS) | find /i "msvcrt" > nul]
+!message *** Doing msvcrt
+MSVCRT = 1
+!else
+MSVCRT = 0
+!endif
!if ![echo $(OPTS) | find /i "threads" > nul]
!message *** Doing threads
TCL_THREADS = 1
@@ -66,20 +73,11 @@ PROFILE = 0
!endif
-!ifndef NOMSVCRT
-!if $(STATIC_BUILD)
-NOMSVCRT = 1
-!else
-NOMSVCRT = 0
-!endif
+# make sure we don't make overly fat DLLs.
+!if !$(STATIC_BUILD)
+MSVCRT = 1
!endif
-!if $(STATIC_BUILD) == 0 && $(NOMSVCRT) == 1
-MSG = ^
-The static runtime in a loadable (dll) is a useless configuration that will^
-cause abnormal and unnecessary code bloat.
-!error $(MSG)
-!endif
#----------------------------------------------------------
# Figure-out how to name our intermediate and output directories.
@@ -104,14 +102,14 @@ TMP_DIRFULL = $(BUILDDIRTOP)\$(PROJECT)_ThreadedDynamicStaticX
TMP_DIRFULL = $(TMP_DIRFULL:Static=)
SUFX = $(SUFX:s=)
EXT = dll
-!if !$(NOMSVCRT)
+!if $(MSVCRT)
TMP_DIRFULL = $(TMP_DIRFULL:X=)
SUFX = $(SUFX:x=)
!endif
!else
TMP_DIRFULL = $(TMP_DIRFULL:Dynamic=)
EXT = lib
-!if $(NOMSVCRT)
+!if !$(MSVCRT)
TMP_DIRFULL = $(TMP_DIRFULL:X=)
SUFX = $(SUFX:x=)
!endif
@@ -144,7 +142,6 @@ OUT_DIR = $(TMP_DIR)
!if "$(STATS)" == "" || ![echo $(STATS) | find /i "none" > nul]
TCL_MEM_DEBUG = 0
TCL_COMPILE_DEBUG = 0
-TCL_COMPILE_STATS = 0
!else
!if ![echo $(STATS) | find /i "memdbg" > nul]
!message *** Doing memdbg
@@ -158,16 +155,6 @@ TCL_COMPILE_DEBUG = 1
!else
TCL_COMPILE_DEBUG = 0
!endif
-!if ![echo $(STATS) | find /i "compstat" > nul]
-!message *** Doing compstat
-TCL_COMPILE_STATS = 1
-!else
-TCL_COMPILE_STATS = 0
-!endif
-!endif
-
-!if $(TCL_COMPILE_DEBUG) && !$(TCL_COMPILE_STATS)
-TCL_COMPILE_STATS = 1
!endif
OPTDEFINES =
@@ -175,10 +162,7 @@ OPTDEFINES =
OPTDEFINES = -DTCL_MEM_DEBUG
!endif
!if $(TCL_COMPILE_DEBUG)
-OPTDEFINES = $(OPTDEFINES) -DTCL_COMPILE_DEBUG
-!endif
-!if $(TCL_COMPILE_STATS)
-OPTDEFINES = $(OPTDEFINES) -DTCL_COMPILE_STATS
+OPTDEFINES = $(OPTDEFINES) -DTCL_COMPILE_DEBUG -DTCL_COMPILE_STATS
!endif
!if $(TCL_THREADS)
OPTDEFINES = $(OPTDEFINES) -DTCL_THREADS=1