diff options
Diffstat (limited to 'win/makefile.vc')
-rw-r--r-- | win/makefile.vc | 652 |
1 files changed, 411 insertions, 241 deletions
diff --git a/win/makefile.vc b/win/makefile.vc index 482cf13..68df470 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-2002 David Gravereaux. +# 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,23 +42,28 @@ the build instructions. # turn on the 64-bit compiler, if your SDK has it. # # 3) Targets are: -# 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) +# release -- Builds the core, the shell. (default) +# dlls -- Just builds the windows extensions. +# shell -- Just builds the shell and the core. +# core -- Only builds the core [tkXX.(dll|lib)]. +# 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. +# tidy/clean/hose -- varying levels of cleaning. +# 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 # headers like tkInt.h just get small changes. -# winhelp -- builds the windows .hlp file for Tcl from the troff man -# files. +# htmlhelp -- Builds a Windows .chm help file for Tcl and Tk from the +# troff manual pages found in $(ROOT)\doc. You need to +# have installed the HTML Help Compiler package from Microsoft +# to produce the .chm file. +# winhelp -- Builds the windows .hlp file for Tcl from the troff man +# files found in $(ROOT)\doc. # # 4) Macros usable on the commandline: # TCLDIR=<path> @@ -70,45 +76,65 @@ 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,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 +# 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. -# threads = Turns on full multithreading support. -# thrdalloc = Use the thread allocator (shared global free pool). -# symbols = Adds symbols for step debugging. -# 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. +# pdbs = Build detached symbols for release builds. +# profile = Adds profiling hooks. Map file is assumed. +# 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). # -# STATS=memdbg,compdbg,none +# STATS=compdbg,memdbg,none # Sets optional memory and bytecode compiler debugging code added # to the core. The default is for none. Any combination of the # above may be used (comma separated). 'none' will over-ride # everything to nothing. # -# memdbg = Enables the debugging memory allocator. # compdbg = Enables byte compilation logging. +# memdbg = Enables the debugging memory allocator. +# +# CHECKS=64bit,fullwarn,nodep,none +# Sets special macros for checking compatability. # -# MACHINE=(IX86|IA64|AMD64|ALPHA) +# 64bit = Enable 64bit portability warnings (if available) +# fullwarn = Builds with full compiler and link warnings enabled. +# Very verbose. +# nodep = Turns off compatability macros to ensure the core +# isn't being built with deprecated functions. +# +# 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 -# when not specified. +# when not specified. If the CPU environment variable has been +# set (ie: recent Platform SDK) then MACHINE is set from CPU. # # 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. # @@ -156,7 +182,7 @@ Please `cd` to its location first. !error $(MSG) !endif -PROJECT = tk +PROJECT = tk !include "rules.vc" !if $(TCLINSTALL) @@ -165,25 +191,42 @@ PROJECT = tk !message *** Tcl sources. !endif +# Extra makefile options processing... +!if "$(OPTS)" == "" || [nmakehlp -f "$(OPTS)" "none"] +HAVE_UXTHEME_H = 1 +TTK_SQUARE_WIDGET = 0 +!else +!if [nmakehlp -f $(OPTS) "noxp"] +!message *** Exclude support for XP theme +HAVE_UXTHEME_H = 0 +!else +HAVE_UXTHEME_H = 1 +!endif +!if [nmakehlp -f "$(OPTS)" "square"] +!message *** Include ttk square demo widget +TTK_SQUARE_WIDGET = 1 +!else +TTK_SQUARE_WIDGET = 0 +!endif +!endif + STUBPREFIX = $(PROJECT)stub -DOTVERSION = 8.4 -VERSION = $(DOTVERSION:.=) WISHNAMEPREFIX = wish -BINROOT = . -ROOT = .. +BINROOT = $(MAKEDIR) # originally . +ROOT = $(MAKEDIR)\.. # originally .. TK_LIBRARY = $(ROOT)\library -TKIMPLIB = "$(OUT_DIR)\$(PROJECT)$(VERSION)$(SUFX).lib" -TKLIBNAME = $(PROJECT)$(VERSION)$(SUFX).$(EXT) +TKIMPLIB = "$(OUT_DIR)\$(PROJECT)$(TK_VERSION)$(SUFX).lib" +TKLIBNAME = $(PROJECT)$(TK_VERSION)$(SUFX).$(EXT) TKLIB = "$(OUT_DIR)\$(TKLIBNAME)" -TKSTUBLIBNAME = $(STUBPREFIX)$(VERSION).lib +TKSTUBLIBNAME = $(STUBPREFIX)$(TK_VERSION).lib TKSTUBLIB = "$(OUT_DIR)\$(TKSTUBLIBNAME)" -WISH = "$(OUT_DIR)\$(WISHNAMEPREFIX)$(VERSION)$(SUFX).exe" -WISHC = "$(OUT_DIR)\$(WISHNAMEPREFIX)c$(VERSION)$(SUFX).exe" +WISH = "$(OUT_DIR)\$(WISHNAMEPREFIX)$(TK_VERSION)$(SUFX).exe" +WISHC = "$(OUT_DIR)\$(WISHNAMEPREFIX)c$(TK_VERSION)$(SUFX).exe" TKTEST = "$(OUT_DIR)\$(PROJECT)test.exe" CAT32 = "$(OUT_DIR)\cat32.exe" @@ -191,7 +234,7 @@ CAT32 = "$(OUT_DIR)\cat32.exe" LIB_INSTALL_DIR = $(_INSTALLDIR)\lib BIN_INSTALL_DIR = $(_INSTALLDIR)\bin DOC_INSTALL_DIR = $(_INSTALLDIR)\doc -SCRIPT_INSTALL_DIR = $(_INSTALLDIR)\lib\$(PROJECT)$(DOTVERSION) +SCRIPT_INSTALL_DIR = $(_INSTALLDIR)\lib\$(PROJECT)$(TK_DOTVERSION) INCLUDE_INSTALL_DIR = $(_INSTALLDIR)\include WISHOBJS = \ @@ -203,11 +246,11 @@ WISHOBJS = \ $(TMP_DIR)\wish.res TKTESTOBJS = \ - $(TMP_DIR)\tkTest.obj \ - $(TMP_DIR)\tkSquare.obj \ $(TMP_DIR)\testMain.obj \ - $(TMP_DIR)\tkWinTest.obj \ - $(TMP_DIR)\wish.res + $(TMP_DIR)\tkSquare.obj \ + $(TMP_DIR)\tkTest.obj \ + $(TMP_DIR)\tkOldTest.obj \ + $(TMP_DIR)\tkWinTest.obj XLIBOBJS = \ $(TMP_DIR)\xcolors.obj \ @@ -241,6 +284,7 @@ TKOBJS = \ $(TMP_DIR)\tkWinRegion.obj \ $(TMP_DIR)\tkWinScrlbr.obj \ $(TMP_DIR)\tkWinSend.obj \ + $(TMP_DIR)\tkWinSendCom.obj \ $(TMP_DIR)\tkWinWindow.obj \ $(TMP_DIR)\tkWinWm.obj \ $(TMP_DIR)\tkWinX.obj \ @@ -318,32 +362,74 @@ TKOBJS = \ $(TMP_DIR)\tkStubInit.obj \ $(TMP_DIR)\tkStubLib.obj \ $(TMP_DIR)\tkWindow.obj \ + $(TTK_OBJS) \ !if !$(STATIC_BUILD) $(TMP_DIR)\tk.res !endif +TTK_OBJS = \ + $(TMP_DIR)\ttkWinMonitor.obj \ + $(TMP_DIR)\ttkWinTheme.obj \ + $(TMP_DIR)\ttkWinXPTheme.obj \ + $(TMP_DIR)\ttkBlink.obj \ + $(TMP_DIR)\ttkButton.obj \ + $(TMP_DIR)\ttkCache.obj \ + $(TMP_DIR)\ttkClamTheme.obj \ + $(TMP_DIR)\ttkClassicTheme.obj \ + $(TMP_DIR)\ttkDefaultTheme.obj \ + $(TMP_DIR)\ttkElements.obj \ + $(TMP_DIR)\ttkEntry.obj \ + $(TMP_DIR)\ttkFrame.obj \ + $(TMP_DIR)\ttkImage.obj \ + $(TMP_DIR)\ttkInit.obj \ + $(TMP_DIR)\ttkLabel.obj \ + $(TMP_DIR)\ttkLayout.obj \ + $(TMP_DIR)\ttkManager.obj \ + $(TMP_DIR)\ttkNotebook.obj \ + $(TMP_DIR)\ttkPanedwindow.obj \ + $(TMP_DIR)\ttkProgress.obj \ + $(TMP_DIR)\ttkScale.obj \ + $(TMP_DIR)\ttkScrollbar.obj \ + $(TMP_DIR)\ttkScroll.obj \ + $(TMP_DIR)\ttkSeparator.obj \ + $(TMP_DIR)\ttkSquare.obj \ + $(TMP_DIR)\ttkState.obj \ + $(TMP_DIR)\ttkTagSet.obj \ + $(TMP_DIR)\ttkTheme.obj \ + $(TMP_DIR)\ttkTrace.obj \ + $(TMP_DIR)\ttkTrack.obj \ + $(TMP_DIR)\ttkTreeview.obj \ + $(TMP_DIR)\ttkWidget.obj \ + $(TMP_DIR)\ttkStubInit.obj + TKSTUBOBJS = \ $(TMP_DIR)\tkStubLib.obj \ - $(TMP_DIR)\tkStubImg.obj + $(TMP_DIR)\ttkStubLib.obj WINDIR = $(ROOT)\win GENERICDIR = $(ROOT)\generic XLIBDIR = $(ROOT)\xlib +TTKDIR = $(ROOT)\generic\ttk BITMAPDIR = $(ROOT)\bitmaps DOCDIR = $(ROOT)\doc RCDIR = $(WINDIR)\rc -!if $(TCLINSTALL) -TCL_INCLUDES = -I "$(_TCLDIR)\include" -!else -TCL_INCLUDES = -I "$(_TCLDIR)\win" -I "$(_TCLDIR)\generic" -!endif TK_INCLUDES = -I"$(WINDIR)" -I"$(GENERICDIR)" -I"$(BITMAPDIR)" -I"$(XLIBDIR)" \ $(TCL_INCLUDES) -TK_DEFINES = $(OPTDEFINES) +CONFIG_DEFS =-DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 \ + -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 \ + -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 \ + -DSUPPORT_CONFIG_EMBEDDED \ +!if $(HAVE_UXTHEME_H) + -DHAVE_UXTHEME_H=1 \ +!endif +!if $(TTK_SQUARE_WIDGET) + -DTTK_SQUARE_WIDGET=1 \ +!endif +TK_DEFINES =-DBUILD_ttk $(OPTDEFINES) $(CONFIG_DEFS) -Dinline=__inline #--------------------------------------------------------------------- # Compile flags @@ -352,10 +438,14 @@ TK_DEFINES = $(OPTDEFINES) !if !$(DEBUG) !if $(OPTIMIZING) ### This cranks the optimization level to maximize speed -cdebug = -O2 $(OPTIMIZATIONS) +### We can't use -O2 because sometimes it causes problems. +cdebug = $(OPTIMIZATIONS) !else cdebug = !endif +!if $(SYMBOLS) +cdebug = $(cdebug) -Zi +!endif !else if "$(MACHINE)" == "IA64" || "$(MACHINE)" == "AMD64" ### Warnings are too many, can't support warnings into errors. cdebug = -Zi -Od $(DEBUGFLAGS) @@ -364,26 +454,20 @@ cdebug = -Zi -WX $(DEBUGFLAGS) !endif ### Declarations common to all compiler options -cwarn = -D _CRT_SECURE_NO_DEPRECATE -D _CRT_NONSTDC_NO_DEPRECATE +cwarn = $(WARNINGS) -D _CRT_SECURE_NO_DEPRECATE -D _CRT_NONSTDC_NO_DEPRECATE cflags = -nologo -c $(COMPILERFLAGS) $(cwarn) -Fp$(TMP_DIR)^\ -!if $(FULLWARNINGS) -cflags = $(cflags) -W4 -!else -cflags = $(cflags) -W3 -!endif - !if $(MSVCRT) -!if "$(DBGX)" == "" -crt = -MD -!else +!if $(DEBUG) && !$(UNCHECKED) crt = -MDd -!endif !else -!if "$(DBGX)" == "" -crt = -MT +crt = -MD +!endif !else +!if $(DEBUG) && !$(UNCHECKED) crt = -MTd +!else +crt = -MT !endif !endif @@ -391,7 +475,7 @@ BASE_CFLAGS = $(cdebug) $(cflags) $(crt) $(TK_INCLUDES) TK_CFLAGS = $(BASE_CFLAGS) $(TK_DEFINES) -DUSE_TCL_STUBS CON_CFLAGS = $(cdebug) $(cflags) $(crt) -DCONSOLE WISH_CFLAGS = $(BASE_CFLAGS) $(TK_DEFINES) - +STUB_CFLAGS = $(cflags) $(cdebug) $(TK_DEFINES) #--------------------------------------------------------------------- # Link flags @@ -401,15 +485,14 @@ WISH_CFLAGS = $(BASE_CFLAGS) $(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 lflags = -nologo -machine:$(MACHINE) $(LINKERFLAGS) $(ldebug) -!if $(FULLWARNINGS) -lflags = $(lflags) -warn:3 -!endif - !if $(PROFILE) lflags = $(lflags) -profile !endif @@ -430,13 +513,15 @@ dlllflags = $(lflags) -dll conlflags = $(lflags) -subsystem:console guilflags = $(lflags) -subsystem:windows -baselibs = kernel32.lib advapi32.lib user32.lib +baselibs = kernel32.lib user32.lib # Avoid 'unresolved external symbol __security_cookie' errors. # c.f. http://support.microsoft.com/?id=894573 !if "$(MACHINE)" == "IA64" || "$(MACHINE)" == "AMD64" +!if $(VCVERSION) > 1399 && $(VCVERSION) < 1500 baselibs = $(baselibs) bufferoverflowU.lib !endif -guilibs = $(baselibs) shell32.lib gdi32.lib comdlg32.lib winspool.lib imm32.lib comctl32.lib +!endif +guilibs = $(baselibs) gdi32.lib #--------------------------------------------------------------------- @@ -460,39 +545,85 @@ install: install-binaries install-libraries install-docs tktest: setup $(TKTEST) $(CAT32) -test: setup $(TKTEST) $(TKLIB) $(CAT32) - set TCL_LIBRARY=$(TCL_LIBRARY) - set TK_LIBRARY=$(TK_LIBRARY) +test: test-classic test-ttk + +test-classic: setup $(TKTEST) $(TKLIB) $(CAT32) + @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 +!if "$(OS)" == "Windows_NT" || "$(MSVCDIR)" == "IDE" + $(DEBUGGER) $(TKTEST) "$(ROOT:\=/)/tests/all.tcl" $(TESTFLAGS) | $(CAT32) +!else + $(DEBUGGER) $(TKTEST) "$(ROOT:\=/)/tests/all.tcl" $(TESTFLAGS) > tests.log + type tests.log | more +!endif + +test-ttk: setup $(TKTEST) $(TKLIB) $(CAT32) + @set TCL_LIBRARY=$(TCL_LIBRARY:\=/) + @set TK_LIBRARY=$(TK_LIBRARY:\=/) + @set TCLLIBPATH= !if $(TCLINSTALL) - set PATH=$(_TCLDIR)\bin;$(PATH) + @set PATH=$(_TCLDIR)\bin;$(PATH) !else - set PATH=$(_TCLDIR)\win\$(BUILDDIRTOP);$(PATH) + @set PATH=$(_TCLDIR)\win\$(BUILDDIRTOP);$(PATH) !endif !if "$(OS)" == "Windows_NT" || "$(MSVCDIR)" == "IDE" - $(TKTEST) "$(ROOT)/tests/all.tcl" $(TESTFLAGS) | $(CAT32) + $(DEBUGGER) $(TKTEST) "$(ROOT:\=/)/tests/ttk/all.tcl" $(TESTFLAGS) | $(CAT32) !else - $(TKTEST) "$(ROOT)/tests/all.tcl" $(TESTFLAGS) > tests.log + $(DEBUGGER) $(TKTEST) "$(ROOT:\=/)/tests/ttk/all.tcl" $(TESTFLAGS) > tests.log type tests.log | more !endif runtest: setup $(TKTEST) $(TKLIB) $(CAT32) - set TCL_LIBRARY=$(TCL_LIBRARY) - set TK_LIBRARY=$(TK_LIBRARY) + @set TCL_LIBRARY=$(TCL_LIBRARY:\=/) + @set TK_LIBRARY=$(TK_LIBRARY:\=/) + @set TCLLIBPATH= !if $(TCLINSTALL) - set PATH=$(_TCLDIR)\bin;$(PATH) + @set PATH=$(_TCLDIR)\bin;$(PATH) !else - set PATH=$(_TCLDIR)\win\$(BUILDDIRTOP);$(PATH) + @set PATH=$(_TCLDIR)\win\$(BUILDDIRTOP);$(PATH) !endif - $(TKTEST) + $(DEBUGGER) $(TKTEST) rundemo: setup $(TKTEST) $(TKLIB) $(CAT32) - set TCL_LIBRARY=$(TCL_LIBRARY) + @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 + $(TKTEST) $(ROOT:\=/)\library\demos\widget + +shell: 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 + $(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) + @set PATH=$(_TCLDIR)\bin;$(PATH) !else - set PATH=$(_TCLDIR)\win\$(BUILDDIRTOP);$(PATH) + @set PATH=$(_TCLDIR)\win\$(BUILDDIRTOP);$(PATH) !endif - $(TKTEST) $(ROOT)\library\demos\widget + windbg $(WISH) setup: @if not exist $(OUT_DIR)\nul mkdir $(OUT_DIR) @@ -522,85 +653,84 @@ $(TKSTUBLIB): $(TKSTUBOBJS) $(WISH): $(WISHOBJS) $(TKIMPLIB) - $(link32) $(guilflags) -out:$@ $(guilibs) $(TCLIMPLIB) $** + $(link32) $(guilflags) -stack:2300000 -out:$@ $(guilibs) $(TCLIMPLIB) $** $(_VC_MANIFEST_EMBED_EXE) + $(WISHC): $(WISHOBJS) $(TKIMPLIB) - $(link32) $(conlflags) -out:$@ $(guilibs) $(TCLIMPLIB) $** + $(link32) $(conlflags) -stack:2300000 -out:$@ $(guilibs) $(TCLIMPLIB) $** $(_VC_MANIFEST_EMBED_EXE) + $(TKTEST): $(TKTESTOBJS) $(TKIMPLIB) - $(link32) $(guilflags) -out:$@ $(guilibs) $(TCLIMPLIB) $** + $(link32) $(guilflags) -stack:2300000 -out:$@ $(guilibs) $(TCLIMPLIB) $** $(_VC_MANIFEST_EMBED_EXE) + $(CAT32): $(_TCLDIR)\win\cat.c $(cc32) $(CON_CFLAGS) -Fo$(TMP_DIR)\ $? $(link32) $(conlflags) -out:$@ -stack:16384 $(TMP_DIR)\cat.obj $(baselibs) $(_VC_MANIFEST_EMBED_EXE) -install-binaries: - @echo installing binaries in "$(BIN_INSTALL_DIR)" - @$(CPY) "$(WISH)" "$(BIN_INSTALL_DIR)\" -!if $(TKLIB) != $(TKIMPLIB) - @$(CPY) "$(TKLIB)" "$(BIN_INSTALL_DIR)\" -!endif - @$(CPY) "$(TKIMPLIB)" "$(LIB_INSTALL_DIR)\" - @$(CPY) "$(TKSTUBLIB)" "$(LIB_INSTALL_DIR)\" -!if !$(STATIC_BUILD) - @-del "$(SCRIPT_INSTALL_DIR)\pkgIndex.tcl" - @echo if {[package vcompare [package provide Tcl] $(TCL_DOTVERSION)] != 0} { return } > "$(OUT_DIR)\pkgIndex.tcl" - @echo package ifneeded Tk $(DOTVERSION) [list load [file join $$dir .. .. bin $(TKLIBNAME)] Tk] >>"$(OUT_DIR)\pkgIndex.tcl" - @$(CPY) "$(OUT_DIR)\pkgIndex.tcl" "$(SCRIPT_INSTALL_DIR)\" -!endif - -install-libraries: - @echo installing headers in "$(INCLUDE_INSTALL_DIR)" - @$(CPY) "$(GENERICDIR)\tk.h" "$(INCLUDE_INSTALL_DIR)\" - @$(CPY) "$(GENERICDIR)\tkDecls.h" "$(INCLUDE_INSTALL_DIR)\" - @$(CPY) "$(GENERICDIR)\tkPlatDecls.h" "$(INCLUDE_INSTALL_DIR)\" - @$(CPY) "$(GENERICDIR)\tkIntXlibDecls.h" "$(INCLUDE_INSTALL_DIR)\" - @$(CPY) "$(XLIBDIR)\X11\*.h" "$(INCLUDE_INSTALL_DIR)\X11\" - @echo installing library files in "$(SCRIPT_INSTALL_DIR)" - @$(CPY) "$(ROOT)\library\*" "$(SCRIPT_INSTALL_DIR)\" - @$(CPY) "$(ROOT)\library\images\*" "$(SCRIPT_INSTALL_DIR)\images\" - @$(CPY) "$(ROOT)\library\msgs\*" "$(SCRIPT_INSTALL_DIR)\msgs\" - @echo installing demo files in "$(SCRIPT_INSTALL_DIR)\demos" - @$(CPY) "$(ROOT)\library\demos\*" "$(SCRIPT_INSTALL_DIR)\demos\" - @$(CPY) "$(ROOT)\library\demos\images\*" "$(SCRIPT_INSTALL_DIR)\demos\images\" - - #--------------------------------------------------------------------- -# Regenerate the stubs files. +# Regenerate the stubs files. [Development use only] #--------------------------------------------------------------------- genstubs: +!if !exist($(TCLSH)) + @echo Build tclsh first! +!else set TCL_LIBRARY=$(TCL_LIBRARY) $(TCLSH) $(_TCLDIR)\tools\genStubs.tcl $(GENERICDIR) \ $(GENERICDIR)\$(PROJECT).decls $(GENERICDIR)\$(PROJECT)Int.decls +!endif #--------------------------------------------------------------------- -# Generate the makefile depedancies. +# Build the Windows HTML help file. #--------------------------------------------------------------------- -depend: -!if !exist($(TCLSH)) - @echo Build tclsh first! -!else - set TCL_LIBRARY=$(TCL_LIBRARY) - $(TCLSH) $(TOOLSDIR:\=/)/mkdepend.tcl -vc32 -out:"$(OUT_DIR)\depend.mk" \ - -passthru:"-DBUILD_tcl $(TK_INCLUDES:"="")" $(GENERICDIR) \ - $(COMPATDIR) $(WINDIR) @<< -$(TKOBJS) -<< +# NOTE: you can define HHC on the command-line to override this +!ifndef HHC +HHC=""%ProgramFiles%\HTML Help Workshop\hhc.exe"" !endif +HTMLDIR=$(ROOT)\html +HTMLBASE=TclTk$(VERSION) +HHPFILE=$(HTMLDIR)\$(HTMLBASE).hhp +CHMFILE=$(HTMLDIR)\$(HTMLBASE).chm +htmlhelp: chmsetup $(CHMFILE) -#--------------------------------------------------------------------- -# Regenerate the windows help files. -#--------------------------------------------------------------------- +$(CHMFILE): $(DOCDIR)\* + @$(TCLSH) $(TOOLSDIR)\tcltk-man2html.tcl + @echo Compiling HTML help project + @$(HHC) <<$(HHPFILE) >NUL +[OPTIONS] +Compatibility=1.1 or later +Compiled file=$(HTMLBASE).chm +Display compile progress=no +Error log file=$(HTMLBASE).log +Language=0x409 English (United States) +Title=Tcl/Tk $(DOT_VERSION) Help +[FILES] +contents.htm +docs.css +Keywords +TclCmd +TclLib +TkCmd +TkLib +UserCmd +<< + +chmsetup: + @if not exist $(HTMLDIR)\nul mkdir $(HTMLDIR) + +#------------------------------------------------------------------------- +# Build the old-style Windows .hlp file +#------------------------------------------------------------------------- -HLPBASE = $(PROJECT)$(VERSION) +HLPBASE = $(PROJECT)$(TK_VERSION) HELPFILE = $(OUT_DIR)\$(HLPBASE).hlp HELPCNT = $(OUT_DIR)\$(HLPBASE).cnt DOCTMP_DIR = $(OUT_DIR)\$(PROJECT)_docs @@ -621,7 +751,7 @@ $(MAN2HELP) $(MAN2HELP2) $(INDEX): $(TCLTOOLSDIR)\$$(@F) $(CPY) $(TCLTOOLSDIR)\$(@F) $(@D) $(BMP): - $(CPY) $(WINDIR)\$(@F) $(@D) + $(CPY) $(WINDIR)\rc\$(@F) $(@D) $(HELPFILE): $(HELPRTF) $(BMP) cd $(DOCTMP_DIR) @@ -648,14 +778,16 @@ 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) -nologo -G4 -ML -O2 -Fo$(@D)\ $(TCLTOOLSDIR)\$(@B).c -link -out:$@ + $(cc32) $(TK_CFLAGS) -Fo$(@D)\ $(TCLTOOLSDIR)\$(@B).c + $(link32) $(conlflags) -out:$@ -stack:16384 $(@D)\man2tcl.obj + $(_VC_MANIFEST_EMBED_EXE) $(HELPRTF): $(MAN2TCL) $(MAN2HELP) $(MAN2HELP2) $(INDEX) - $(TCLSH) $(MAN2HELP) -bitmap $(BMP_NOPATH) $(PROJECT) $(VERSION) $(DOCDIR:\=/) + $(TCLSH) $(MAN2HELP) -bitmap $(BMP_NOPATH) $(PROJECT) $(TK_VERSION) $(DOCDIR:\=/) install-docs: !if exist($(HELPFILE)) @@ -663,25 +795,25 @@ install-docs: $(CPY) "$(HELPCNT)" "$(DOC_INSTALL_DIR)\" $(TCLSH) << puts "Installing $(PROJECT)'s helpfile contents into Tcl's ..." -set f [open "$(DOC_INSTALL_DIR:\=/)/tcl$(VERSION).cnt" r] +set f [open "$(DOC_INSTALL_DIR:\=/)/tcl$(TK_VERSION).cnt" r] while {![eof $$f]} { if {[regexp {:Include $(PROJECT)([0-9]{2}).cnt} [gets $$f] dummy ver]} { - if {$$ver == $(VERSION)} { + if {$$ver == $(TK_VERSION)} { puts "Already installed." exit } else { # do something here logical to remove (or replace) it. - puts "$$ver != $(VERSION), unfinished code path, die, die!" + puts "$$ver != $(TK_VERSION), unfinished code path, die, die!" exit 1 } } } close $$f -set f [open "$(DOC_INSTALL_DIR:\=/)/tcl$(VERSION).cnt" a] +set f [open "$(DOC_INSTALL_DIR:\=/)/tcl$(TK_VERSION).cnt" a] puts $$f {:Include $(HLPBASE).cnt} close $$f << - start /wait winhlp32 -g $(DOC_INSTALL_DIR)\tcl$(VERSION).hlp + start /wait winhlp32 -g $(DOC_INSTALL_DIR)\tcl$(TK_VERSION).hlp !endif #--------------------------------------------------------------------- @@ -689,15 +821,16 @@ close $$f #--------------------------------------------------------------------- $(TMP_DIR)\testMain.obj: $(WINDIR)\winMain.c -!if $(TCL_USE_STATIC_PACKAGES) - $(cc32) $(WISH_CFLAGS) -DTK_TEST -DTCL_USE_STATIC_PACKAGES -Fo$@ $? -!else - $(cc32) $(WISH_CFLAGS) -DTK_TEST -Fo$@ $? -!endif + $(cc32) $(WISH_CFLAGS) -DTK_TEST \ + -DTCL_USE_STATIC_PACKAGES=$(TCL_USE_STATIC_PACKAGES) \ + -Fo$@ $? $(TMP_DIR)\tkTest.obj: $(GENERICDIR)\tkTest.c $(cc32) $(WISH_CFLAGS) -Fo$@ $? +$(TMP_DIR)\tkOldTest.obj: $(GENERICDIR)\tkOldTest.c + $(cc32) $(WISH_CFLAGS) -Fo$@ $? + $(TMP_DIR)\tkWinTest.obj: $(WINDIR)\tkWinTest.c $(cc32) $(WISH_CFLAGS) -Fo$@ $? @@ -705,90 +838,57 @@ $(TMP_DIR)\tkSquare.obj: $(GENERICDIR)\tkSquare.c $(cc32) $(WISH_CFLAGS) -Fo$@ $? $(TMP_DIR)\winMain.obj: $(WINDIR)\winMain.c -!if $(TCL_USE_STATIC_PACKAGES) - $(cc32) $(WISH_CFLAGS) -DTCL_USE_STATIC_PACKAGES -Fo$@ $? -!else - $(cc32) $(WISH_CFLAGS) -Fo$@ $? -!endif + $(cc32) $(WISH_CFLAGS) \ + -DTCL_USE_STATIC_PACKAGES=$(TCL_USE_STATIC_PACKAGES) \ + -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. $(TMP_DIR)\tkStubLib.obj : $(GENERICDIR)\tkStubLib.c - $(cc32) $(cdebug) $(cflags) $(TK_INCLUDES) -Zl -DSTATIC_BUILD -Fo$@ $? + $(cc32) $(STUB_CFLAGS) $(TK_INCLUDES) -Zl -DSTATIC_BUILD -Fo$@ $? -$(TMP_DIR)\tkStubImg.obj : $(GENERICDIR)\tkStubImg.c - $(cc32) $(cdebug) $(cflags) $(TK_INCLUDES) -Zl -DSTATIC_BUILD -Fo$@ $? +$(TMP_DIR)\wish.exe.manifest: $(WINDIR)\wish.exe.manifest.in + @nmakehlp -s << $** >$@ +@MACHINE@ $(MACHINE:IX86=X86) +@TK_WIN_VERSION@ $(TK_DOTVERSION).0.0 +<< #--------------------------------------------------------------------- -# Dedependency rules +# Generate the source dependencies. Having dependency rules will +# improve incremental build accuracy without having to resort to a +# full rebuild just because some non-global header file like +# tclCompile.h was changed. These rules aren't needed when building +# from scratch. #--------------------------------------------------------------------- -$(TMP_DIR)\wish.exe.manifest: $(WINDIR)\wish.exe.manifest.in -!if ![sed "1d" < NUL > NUL] - sed -f << $** > $@ -s/@MACHINE@/$(MACHINE:IX86=X86)/ -s/@TK_WIN_VERSION@/$(DOTVERSION).0.0/ -<< +depend: +!if !exist($(TCLSH)) + @echo Build tclsh first! !else - $(TCLSH) << -set f [open {$(WINDIR:\=/)/wish.exe.manifest.in} r] -set data [read $$f] -close $$f -set mach {$(MACHINE)} -if {[regexp -nocase {$(IX86)$$} $mach ]} {set mach X86} -set winver "$(DOTVERSION).0.0" -set data [string map [list @MACHINE@ $$mach @TK_WIN_VERSION@ $$winver] $$data] -puts {Creating $(TMP_DIR:\=/)/wish.exe.manifest} -set f [open {$(TMP_DIR:\=/)/wish.exe.manifest} w] -puts -nonewline $$f $$data -close $$f -exit + set TCL_LIBRARY=$(TCL_LIBRARY) + $(TCLSH) $(TCLTOOLSDIR:\=/)/mkdepend.tcl -vc32 -out:"$(OUT_DIR)\depend.mk" \ + -passthru:"-DBUILD_tk $(TK_INCLUDES)" $(GENERICDIR),$$(GENERICDIR) \ + $(WINDIR),$$(WINDIR) $(TTKDIR),$$(TTKDIR) $(XLIBDIR),$$(XLIBDIR) \ + $(BITMAPDIR),$$(BITMAPDIR) @<< +$(TKOBJS) << !endif +#--------------------------------------------------------------------- +# Dependency rules +#--------------------------------------------------------------------- + $(TMP_DIR)\tk.res: \ $(RCDIR)\buttons.bmp \ $(RCDIR)\cursor*.cur \ $(RCDIR)\tk.ico -$(GENERICDIR)/default.h: $(WINDIR)/tkWinDefault.h -$(GENERICDIR)/tkButton.c: $(GENERICDIR)/default.h -$(GENERICDIR)/tkCanvas.c: $(GENERICDIR)/default.h -$(GENERICDIR)/tkEntry.c: $(GENERICDIR)/default.h -$(GENERICDIR)/tkFrame.c: $(GENERICDIR)/default.h -$(GENERICDIR)/tkListbox.c: $(GENERICDIR)/default.h -$(GENERICDIR)/tkMenu.c: $(GENERICDIR)/default.h -$(GENERICDIR)/tkMenubutton.c: $(GENERICDIR)/default.h -$(GENERICDIR)/tkMessage.c: $(GENERICDIR)/default.h -$(GENERICDIR)/tkPanedWindow.c: $(GENERICDIR)/default.h -$(GENERICDIR)/tkScale.c: $(GENERICDIR)/default.h -$(GENERICDIR)/tkScrollbar.c: $(GENERICDIR)/default.h -$(GENERICDIR)/tkText.c: $(GENERICDIR)/default.h -$(GENERICDIR)/tkTextIndex.c: $(GENERICDIR)/default.h -$(GENERICDIR)/tkTextTag.c: $(GENERICDIR)/default.h -$(GENERICDIR)/tkUndo.c: $(GENERICDIR)/tkUndo.h - -$(GENERICDIR)/tkText.c: $(GENERICDIR)/tkText.h -$(GENERICDIR)/tkTextBTree.c: $(GENERICDIR)/tkText.h -$(GENERICDIR)/tkTextDisp.c: $(GENERICDIR)/tkText.h -$(GENERICDIR)/tkTextDisp.c: $(GENERICDIR)/tkText.h -$(GENERICDIR)/tkTextImage.c: $(GENERICDIR)/tkText.h -$(GENERICDIR)/tkTextIndex.c: $(GENERICDIR)/tkText.h -$(GENERICDIR)/tkTextMark.c: $(GENERICDIR)/tkText.h -$(GENERICDIR)/tkTextTag.c: $(GENERICDIR)/tkText.h -$(GENERICDIR)/tkTextWind.c: $(GENERICDIR)/tkText.h - -$(GENERICDIR)/tkMacWinMenu.c: $(GENERICDIR)/tkMenu.h -$(GENERICDIR)/tkMenu.c: $(GENERICDIR)/tkMenu.h -$(GENERICDIR)/tkMenuDraw.c: $(GENERICDIR)/tkMenu.h -$(WINDIR)/tkWinMenu.c: $(GENERICDIR)/tkMenu.h - !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 @@ -810,6 +910,11 @@ $< $< << +{$(TTKDIR)}.c{$(TMP_DIR)}.obj:: + $(cc32) -DBUILD_tk $(TK_CFLAGS) -Fo$(TMP_DIR)\ @<< +$< +<< + {$(WINDIR)}.c{$(TMP_DIR)}.obj:: $(cc32) -DBUILD_tk $(TK_CFLAGS) -Fo$(TMP_DIR)\ @<< $< @@ -820,40 +925,105 @@ $< $< << -!if $(DEBUG) -RCDEBUG = -d DEBUG -!else -RCDEBUG = -!endif -!if $(TCL_THREADS) -RCTHREADS = -d TCL_THREADS -!else -RCTHREADS = -!endif -!if $(STATIC_BUILD) -RCSTATIC = -d STATIC_BUILD -!else -RCSTATIC = -!endif - {$(RCDIR)}.rc{$(TMP_DIR)}.res: $(rc32) -fo $@ -r -i "$(GENERICDIR)" -i "$(TMP_DIR)" $(TCL_INCLUDES) \ - $(RCDEBUG) $(RCTHREADS) $(RCSTATIC) \ - $< + -d DEBUG=$(DEBUG) -d UNCHECKED=$(UNCHECKED) \ + -d TCL_THREADS=$(TCL_THREADS) \ + -d STATIC_BUILD=$(STATIC_BUILD) \ + $< $(TMP_DIR)\tk.res: $(TMP_DIR)\wish.exe.manifest $(TMP_DIR)\wish.res: $(TMP_DIR)\wish.exe.manifest +.SUFFIXES: +.SUFFIXES:.c .rc + + #--------------------------------------------------------------------- -# Clean up +# Installation. #--------------------------------------------------------------------- -clean: - -@$(RMDIR) $(TMP_DIR) +install-binaries: + @echo installing binaries + @$(CPY) "$(WISH)" "$(BIN_INSTALL_DIR)\" +!if $(TKLIB) != $(TKIMPLIB) + @$(CPY) "$(TKLIB)" "$(BIN_INSTALL_DIR)\" +!endif + @$(CPY) "$(TKIMPLIB)" "$(LIB_INSTALL_DIR)\" + @$(CPY) "$(TKSTUBLIB)" "$(LIB_INSTALL_DIR)\" +!if !$(STATIC_BUILD) + @echo creating package index + @type << > $(OUT_DIR)\pkgIndex.tcl +if {[catch {package present Tcl $(TK_DOTVERSION).0}]} { return } +if {($$::tcl_platform(platform) eq "unix") && ([info exists ::env(DISPLAY)] + || ([info exists ::argv] && ("-display" in $$::argv)))} { + package ifneeded Tk $(TK_PATCH_LEVEL) [list load [file join $$dir .. .. bin libtk$(TK_DOTVERSION).dll] Tk] +} else { + package ifneeded Tk $(TK_PATCH_LEVEL) [list load [file join $$dir .. .. bin $(TKLIBNAME)] Tk] +} +<< + @$(CPY) $(OUT_DIR)\pkgIndex.tcl "$(SCRIPT_INSTALL_DIR)\" +!endif -hose: clean - -@$(RMDIR) $(OUT_DIR) +#" +install-libraries: + @echo installing Tk headers + @$(CPY) "$(GENERICDIR)\tk.h" "$(INCLUDE_INSTALL_DIR)\" + @$(CPY) "$(GENERICDIR)\tkDecls.h" "$(INCLUDE_INSTALL_DIR)\" + @$(CPY) "$(GENERICDIR)\tkPlatDecls.h" "$(INCLUDE_INSTALL_DIR)\" + @$(CPY) "$(GENERICDIR)\tkIntXlibDecls.h" "$(INCLUDE_INSTALL_DIR)\" + @$(CPY) "$(XLIBDIR)\X11\*.h" "$(INCLUDE_INSTALL_DIR)\X11\" + @echo installing script library + @$(CPY) "$(ROOT)\library\*" "$(SCRIPT_INSTALL_DIR)\" + @echo installing theme library + @$(CPY) "$(ROOT)\library\ttk\*" "$(SCRIPT_INSTALL_DIR)\ttk\" + @echo installing demos + @$(CPY) "$(ROOT)\library\demos\*" "$(SCRIPT_INSTALL_DIR)\demos\" + @$(CPY) "$(ROOT)\library\demos\images\*" "$(SCRIPT_INSTALL_DIR)\demos\images\" + @echo installing images + @$(CPY) "$(ROOT)\library\images\*" "$(SCRIPT_INSTALL_DIR)\images\" + @echo installing language files + @$(CPY) "$(ROOT)\library\msgs\*" "$(SCRIPT_INSTALL_DIR)\msgs\" -.SUFFIXES: -.SUFFIXES:.c .rc +#" + +#--------------------------------------------------------------------- +# Clean up +#--------------------------------------------------------------------- + +tidy: +!if $(TKLIB) != $(TKIMPLIB) + @echo Removing $(TKLIB) ... + @if exist $(TKLIB) del $(TKLIB) +!endif + @echo Removing $(TKIMPLIB) ... + @if exist $(TKIMPLIB) del $(TKIMPLIB) + @echo Removing $(WISH) ... + @if exist $(WISH) del $(WISH) + @echo Removing $(TKTEST) ... + @if exist $(TKTEST) del $(TKTEST) + @echo Removing $(TKSTUBLIB) ... + @if exist $(TKSTUBLIB) del $(TKSTUBLIB) + +clean: + @echo Cleaning $(TMP_DIR)\* ... + @if exist $(TMP_DIR)\nul $(RMDIR) $(TMP_DIR) + @echo Cleaning $(WINDIR)\nmakehlp.obj ... + @if exist $(WINDIR)\nmakehlp.obj del $(WINDIR)\nmakehlp.obj + @echo Cleaning $(WINDIR)\nmakehlp.exe ... + @if exist $(WINDIR)\nmakehlp.exe del $(WINDIR)\nmakehlp.exe + @echo Cleaning $(WINDIR)\_junk.pch ... + @if exist $(WINDIR)\_junk.pch del $(WINDIR)\_junk.pch + @echo Cleaning $(WINDIR)\vercl.x ... + @if exist $(WINDIR)\vercl.x del $(WINDIR)\vercl.x + @echo Cleaning $(WINDIR)\vercl.i ... + @if exist $(WINDIR)\vercl.i del $(WINDIR)\vercl.i + @echo Cleaning $(WINDIR)\versions.vc ... + @if exist $(WINDIR)\versions.vc del $(WINDIR)\versions.vc + +realclean: hose + +hose: + @echo Hosing $(OUT_DIR)\* ... + @if exist $(OUT_DIR)\nul $(RMDIR) $(OUT_DIR) |