summaryrefslogtreecommitdiffstats
path: root/win/makefile.vc
diff options
context:
space:
mode:
Diffstat (limited to 'win/makefile.vc')
-rw-r--r--win/makefile.vc151
1 files changed, 82 insertions, 69 deletions
diff --git a/win/makefile.vc b/win/makefile.vc
index 2f60436..8557923 100644
--- a/win/makefile.vc
+++ b/win/makefile.vc
@@ -1,15 +1,16 @@
-#------------------------------------------------------------------------------
+#------------------------------------------------------------- -*- makefile -*-
# makefile.vc --
#
# 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.
-#
+#
# Copyright (c) 1995-1996 Sun Microsystems, Inc.
# Copyright (c) 1998-2000 Ajuba Solutions.
# Copyright (c) 2001-2005 ActiveState Corporation.
# Copyright (c) 2001-2004 David Gravereaux.
+# Copyright (c) 2003-2008 Pat Thoyts.
#------------------------------------------------------------------------------
# Check to see we are configured to build with MSVC (MSDEVDIR, MSVCDIR or
@@ -41,17 +42,17 @@ the build instructions.
# turn on the 64-bit compiler, if your SDK has it.
#
# 3) Targets are:
-# release -- builds the core, the shell. (default)
+# release -- Builds the core, the shell. (default)
# core -- Only builds the core.
-# all -- builds everything.
-# test -- builds and runs the test suite.
-# tktest -- just builds the binaries for the test suite.
-# install -- installs the built binaries and libraries to $(INSTALLDIR)
+# all -- Builds everything.
+# test -- Builds and runs the test suite.
+# tktest -- Just builds the binaries for the test suite.
+# install -- Installs the built binaries and libraries to $(INSTALLDIR)
# as the root of the install tree.
-# cwish -- builds a console version of wish.
-# clean -- removes the contents of $(TMP_DIR)
-# hose -- removes the contents of $(TMP_DIR) and $(OUT_DIR)
-# genstubs -- rebuilds the Stubs table and support files (dev only).
+# cwish -- Builds a console version of wish.
+# clean -- Removes the contents of $(TMP_DIR)
+# hose -- Removes the contents of $(TMP_DIR) and $(OUT_DIR)
+# genstubs -- Rebuilds the Stubs table and support files (dev only).
# depend -- Generates an accurate set of source dependancies for this
# makefile. Helpful to avoid problems when the sources are
# refreshed and you rebuild, but can "overbuild" when common
@@ -70,32 +71,36 @@ the build instructions.
# Sets where to install Tcl from the built binaries.
# C:\Progra~1\Tcl is assumed when not specified.
#
-# OPTS=static,msvcrt,linkexten,threads,symbols,profile,unchecked,none
+# OPTS=loimpact,msvcrt,nothreads,noxp,pdbs,profile,square,static,staticpkg,symbols,unchecked,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
+# loimpact = Adds a flag for how NT treats the heap to keep memory
+# in use, low. This is said to impact alloc performance.
+# msvcrt = Affects 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.
-# staticpkg= Affects the static option only to switch wishXX.exe
-# to have the dde and reg extension linked inside it.
-# threads = Turns on full multithreading support.
-# thrdalloc= Use the thread allocator (shared global free pool).
-# symbols = Adds symbols for step debugging.
+# nothreads = Turns off full multithreading support.
+# noxp = If you do not have the uxtheme.h header then you
+# cannot include support for XP themeing.
+# square = Include the demo square widget.
+# static = Builds a static library of the core instead of a
+# dll. The shell will be static (and large), as well.
+# staticpkg = Affects the static option only to switch
+# wishXX.exe to have the dde and reg extension linked
+# inside it.
+# pdbs = Build detached symbols for release builds.
# profile = Adds profiling hooks. Map file is assumed.
-# loimpact = Adds a flag for how NT treats the heap to keep
-# memory in use, low. This is said to impact alloc
-# performance.
-# unchecked= Allows a symbols build to not use the debug
+# thrdalloc = Use the thread allocator (shared global free pool)
+# This is the default on threaded builds.
+# tclalloc = Use the old non-thread allocator
+# symbols = Debug build. Links to the debug C runtime, disables
+# optimizations and creates pdb symbols files.
+# unchecked = Allows a symbols build to not use the debug
# enabled runtime (msvcrt.dll not msvcrtd.dll
# or libcmt.lib not libcmtd.lib).
-# noxp = If you do not have the uxtheme.h header then you
-# cannot include support for XP themeing.
-# square = Include the demo square widget.
#
# STATS=memdbg,compdbg,none
# Sets optional memory and bytecode compiler debugging code added
@@ -106,15 +111,16 @@ the build instructions.
# memdbg = Enables the debugging memory allocator.
# compdbg = Enables byte compilation logging.
#
-# CHECKS=nodep,fullwarn,none
+# CHECKS=nodep,fullwarn,64bit,none
# Sets special macros for checking compatability.
#
# nodep = Turns off compatability macros to ensure Tk isn't
-# being built with deprecated functions.
+# being built with deprecated functions.
# fullwarn = Builds with full compiler and link warnings enabled.
# Very verbose.
+# 64bit = Enable 64bit portability warnings (if available)
#
-# MACHINE=(IX86|IA64|AMD64|ALPHA)
+# MACHINE=(ALPHA|AMD64|IA64|IX86)
# Set the machine type used for the compiler, linker, and
# resource compiler. This hook is needed to tell the tools
# when alternate platforms are requested. IX86 is the default
@@ -123,7 +129,7 @@ the build instructions.
# TMP_DIR=<path>
# OUT_DIR=<path>
# Hooks to allow the intermediate and output directories to be
-# changed. $(OUT_DIR) is assumed to be
+# changed. $(OUT_DIR) is assumed to be
# $(BINROOT)\(Release|Debug) based on if symbols are requested.
# $(TMP_DIR) will de $(OUT_DIR)\<buildtype> by default.
#
@@ -202,8 +208,8 @@ TTK_SQUARE_WIDGET = 0
STUBPREFIX = $(PROJECT)stub
WISHNAMEPREFIX = wish
-BINROOT = .
-ROOT = ..
+BINROOT = $(MAKEDIR) # originally .
+ROOT = $(MAKEDIR)\.. # originally ..
TK_LIBRARY = $(ROOT)\library
@@ -231,6 +237,7 @@ WISHOBJS = \
!if $(TCL_USE_STATIC_PACKAGES)
$(TCLDDELIB) \
$(TCLREGLIB) \
+ $(TCLSTUBLIB) \
!endif
$(TMP_DIR)\wish.res
@@ -283,6 +290,7 @@ TKOBJS = \
$(TMP_DIR)\tkAtom.obj \
$(TMP_DIR)\tkBind.obj \
$(TMP_DIR)\tkBitmap.obj \
+ $(TMP_DIR)\tkBusy.obj \
$(TMP_DIR)\tkButton.obj \
$(TMP_DIR)\tkCanvArc.obj \
$(TMP_DIR)\tkCanvBmap.obj \
@@ -314,12 +322,15 @@ TKOBJS = \
$(TMP_DIR)\tkImage.obj \
$(TMP_DIR)\tkImgBmap.obj \
$(TMP_DIR)\tkImgGIF.obj \
+ $(TMP_DIR)\tkImgPNG.obj \
$(TMP_DIR)\tkImgPPM.obj \
$(TMP_DIR)\tkImgPhoto.obj \
+ $(TMP_DIR)\tkImgPhInstance.obj \
$(TMP_DIR)\tkImgUtil.obj \
$(TMP_DIR)\tkListbox.obj \
$(TMP_DIR)\tkMacWinMenu.obj \
$(TMP_DIR)\tkMain.obj \
+ $(TMP_DIR)\tkMain2.obj \
$(TMP_DIR)\tkMenu.obj \
$(TMP_DIR)\tkMenubutton.obj \
$(TMP_DIR)\tkMenuDraw.obj \
@@ -349,7 +360,6 @@ TKOBJS = \
$(TMP_DIR)\tkUtil.obj \
$(TMP_DIR)\tkVisual.obj \
$(TMP_DIR)\tkStubInit.obj \
- $(TMP_DIR)\tkStubLib.obj \
$(TMP_DIR)\tkWindow.obj \
$(TTK_OBJS) \
!if !$(STATIC_BUILD)
@@ -417,7 +427,7 @@ CONFIG_DEFS =-DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 \
-DTTK_SQUARE_WIDGET=1 \
!endif
-TK_DEFINES =-DBUILD_ttk $(OPTDEFINES) $(CONFIG_DEFS)
+TK_DEFINES =-DBUILD_ttk $(OPTDEFINES) $(CONFIG_DEFS) -Dinline=__inline
#---------------------------------------------------------------------
# Compile flags
@@ -432,7 +442,7 @@ cdebug = $(OPTIMIZATIONS)
cdebug =
!endif
!if $(SYMBOLS)
-cdebug = $(cdebug) -Zi
+cdebug = $(cdebug) -Zi
!endif
!else if "$(MACHINE)" == "IA64" || "$(MACHINE)" == "AMD64"
### Warnings are too many, can't support warnings into errors.
@@ -460,11 +470,15 @@ crt = -MT
!endif
BASE_CFLAGS = $(cdebug) $(cflags) $(crt) $(TK_INCLUDES)
-TK_CFLAGS = $(BASE_CFLAGS) $(TK_DEFINES) -DUSE_TCL_STUBS
+TK_CFLAGS = $(BASE_CFLAGS) $(TK_DEFINES)
CON_CFLAGS = $(cdebug) $(cflags) $(crt) -DCONSOLE
WISH_CFLAGS = $(BASE_CFLAGS) $(TK_DEFINES)
-STUB_CFLAGS = $(cflags) $(cdebug) $(TK_DEFINES)
+### Stubs files should not be compiled with -GL
+STUB_CFLAGS = $(cflags) $(cdebug:-GL=) $(TK_DEFINES)
+!if !$(STATIC_BUILD)
+TK_CFLAGS = $(TK_CFLAGS) -DUSE_TCL_STUBS
+!endif
#---------------------------------------------------------------------
# Link flags
@@ -474,6 +488,9 @@ STUB_CFLAGS = $(cflags) $(cdebug) $(TK_DEFINES)
ldebug = -debug -debugtype:cv
!else
ldebug = -release -opt:ref -opt:icf,3
+!if $(SYMBOLS)
+ldebug = $(ldebug) -debug -debugtype:cv
+!endif
!endif
### Declarations common to all linker options
@@ -499,7 +516,12 @@ dlllflags = $(lflags) -dll
conlflags = $(lflags) -subsystem:console
guilflags = $(lflags) -subsystem:windows
-baselibs = kernel32.lib user32.lib
+tcllibs = $(TCLIMPLIB)
+!if !$(STATIC_BUILD)
+tcllibs = $(TCLSTUBLIB) $(tcllibs)
+!endif
+
+baselibs = netapi32.lib kernel32.lib user32.lib advapi32.lib ws2_32.lib
# Avoid 'unresolved external symbol __security_cookie' errors.
# c.f. http://support.microsoft.com/?id=894573
!if "$(MACHINE)" == "IA64" || "$(MACHINE)" == "AMD64"
@@ -543,9 +565,9 @@ test-classic: setup $(TKTEST) $(TKLIB) $(CAT32)
@set PATH=$(_TCLDIR)\win\$(BUILDDIRTOP);$(PATH)
!endif
!if "$(OS)" == "Windows_NT" || "$(MSVCDIR)" == "IDE"
- $(TKTEST) "$(ROOT)/tests/all.tcl" $(TESTFLAGS) | $(CAT32)
+ $(DEBUGGER) $(TKTEST) "$(ROOT)/tests/all.tcl" $(TESTFLAGS) | $(CAT32)
!else
- $(TKTEST) "$(ROOT)/tests/all.tcl" $(TESTFLAGS) | $(CAT32)
+ $(DEBUGGER) $(TKTEST) "$(ROOT)/tests/all.tcl" $(TESTFLAGS) | $(CAT32)
!endif
test-ttk: setup $(TKTEST) $(TKLIB) $(CAT32)
@@ -558,9 +580,9 @@ test-ttk: setup $(TKTEST) $(TKLIB) $(CAT32)
@set PATH=$(_TCLDIR)\win\$(BUILDDIRTOP);$(PATH)
!endif
!if "$(OS)" == "Windows_NT" || "$(MSVCDIR)" == "IDE"
- $(TKTEST) "$(ROOT)/tests/ttk/all.tcl" $(TESTFLAGS) | $(CAT32)
+ $(DEBUGGER) $(TKTEST) "$(ROOT)/tests/ttk/all.tcl" $(TESTFLAGS) | $(CAT32)
!else
- $(TKTEST) "$(ROOT)/tests/ttk/all.tcl" $(TESTFLAGS) | $(CAT32)
+ $(DEBUGGER) $(TKTEST) "$(ROOT)/tests/ttk/all.tcl" $(TESTFLAGS) | $(CAT32)
!endif
runtest: setup $(TKTEST) $(TKLIB) $(CAT32)
@@ -572,7 +594,7 @@ runtest: setup $(TKTEST) $(TKLIB) $(CAT32)
!else
@set PATH=$(_TCLDIR)\win\$(BUILDDIRTOP);$(PATH)
!endif
- $(TKTEST)
+ $(DEBUGGER) $(TKTEST)
rundemo: setup $(TKTEST) $(TKLIB) $(CAT32)
@set TCL_LIBRARY=$(TCL_LIBRARY:\=/)
@@ -594,21 +616,10 @@ shell: setup $(WISH)
!else
@set PATH=$(_TCLDIR)\win\$(BUILDDIRTOP);$(PATH)
!endif
- $(WISH) <<
+ $(DEBUGGER) $(WISH) <<
console show
<<
-dbgshell: setup $(WISH)
- @set TCL_LIBRARY=$(TCL_LIBRARY:\=/)
- @set TK_LIBRARY=$(TK_LIBRARY:\=/)
- @set TCLLIBPATH=
-!if $(TCLINSTALL)
- @set PATH=$(_TCLDIR)\bin;$(PATH)
-!else
- @set PATH=$(_TCLDIR)\win\$(BUILDDIRTOP);$(PATH)
-!endif
- windbg $(WISH)
-
setup:
@if not exist $(OUT_DIR)\nul mkdir $(OUT_DIR)
@if not exist $(TMP_DIR)\nul mkdir $(TMP_DIR)
@@ -636,18 +647,18 @@ $(TKSTUBLIB): $(TKSTUBOBJS)
$(lib32) -nologo -out:$@ $**
-$(WISH): $(WISHOBJS) $(TKIMPLIB)
- $(link32) $(guilflags) -stack:2300000 -out:$@ $(guilibs) $(TCLIMPLIB) $**
+$(WISH): $(WISHOBJS) $(TKSTUBLIB) $(TKIMPLIB)
+ $(link32) $(guilflags) -stack:2300000 -out:$@ $(guilibs) $(tcllibs) $**
$(_VC_MANIFEST_EMBED_EXE)
-$(WISHC): $(WISHOBJS) $(TKIMPLIB)
- $(link32) $(conlflags) -stack:2300000 -out:$@ $(guilibs) $(TCLIMPLIB) $**
+$(WISHC): $(WISHOBJS) $(TKSTUBLIB) $(TKIMPLIB)
+ $(link32) $(conlflags) -stack:2300000 -out:$@ $(guilibs) $(tcllibs) $**
$(_VC_MANIFEST_EMBED_EXE)
-$(TKTEST): $(TKTESTOBJS) $(TKIMPLIB)
- $(link32) $(guilflags) -stack:2300000 -out:$@ $(guilibs) $(TCLIMPLIB) $**
+$(TKTEST): $(TKTESTOBJS) $(TKSTUBLIB) $(TKIMPLIB)
+ $(link32) $(guilflags) -stack:2300000 -out:$@ $(guilibs) $(tcllibs) $**
$(_VC_MANIFEST_EMBED_EXE)
@@ -656,9 +667,8 @@ $(CAT32): $(_TCLDIR)\win\cat.c
$(link32) $(conlflags) -out:$@ -stack:16384 $(TMP_DIR)\cat.obj $(baselibs)
$(_VC_MANIFEST_EMBED_EXE)
-
#---------------------------------------------------------------------
-# Regenerate the stubs files.
+# Regenerate the stubs files. [Development use only]
#---------------------------------------------------------------------
genstubs:
@@ -723,8 +733,8 @@ CreateButton(3, "Wiki", ExecFile("http://wiki.tcl.tk"))
CreateButton(4, "FAQ", ExecFile("http://www.purl.org/NET/Tcl-FAQ/"))
<<
cd $(MAKEDIR)
- $(CPY) "$(DOCTMP_DIR)\$(@B).hlp" "$(OUT_DIR)"
- $(CPY) "$(DOCTMP_DIR)\$(@B).cnt" "$(OUT_DIR)"
+ @$(CPY) "$(DOCTMP_DIR)\$(@B).hlp" "$(OUT_DIR)"
+ @$(CPY) "$(DOCTMP_DIR)\$(@B).cnt" "$(OUT_DIR)"
$(MAN2TCL): $(TCLTOOLSDIR)\$$(@B).c
$(cc32) $(TK_CFLAGS) -Fo$(@D)\ $(TCLTOOLSDIR)\$(@B).c
@@ -787,6 +797,9 @@ $(TMP_DIR)\winMain.obj: $(WINDIR)\winMain.c
-DTCL_USE_STATIC_PACKAGES=$(TCL_USE_STATIC_PACKAGES) \
-Fo$@ $?
+$(TMP_DIR)\tkMain2.obj: $(GENERICDIR)\tkMain.c
+ $(cc32) -DBUILD_tk $(TK_CFLAGS) -DTK_ASCII_MAIN -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
# and no reference made to a C runtime.
@@ -820,7 +833,7 @@ $(TKOBJS)
#---------------------------------------------------------------------
-# Dedependency rules
+# Dependency rules
#---------------------------------------------------------------------
$(TMP_DIR)\tk.res: \
@@ -830,7 +843,7 @@ $(TMP_DIR)\tk.res: \
!if exist("$(OUT_DIR)\depend.mk")
!include "$(OUT_DIR)\depend.mk"
-!message *** Dependency rules in effect.
+!message *** Dependency rules in use.
!else
!message *** Dependency rules are not being used.
!endif
@@ -896,7 +909,7 @@ install-binaries:
!if !$(STATIC_BUILD)
@echo creating package index
@type << > $(OUT_DIR)\pkgIndex.tcl
-if {[catch {package present Tcl 8.5.0}]} { return }
+if {[package vcompare [package provide Tcl] $(TCL_PATCH_LEVEL)] != 0} { return }
package ifneeded Tk $(TK_PATCH_LEVEL) [list load [file join $$dir .. .. bin $(TKLIBNAME)] Tk]
<<
@$(CPY) $(OUT_DIR)\pkgIndex.tcl "$(SCRIPT_INSTALL_DIR)\"