From 4d1a9f685c22275463128aabb1142f5c97bee2e5 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 25 Jun 2015 09:22:18 +0000 Subject: Fix [2a02881e4c] for 8.5 too: Colors added in 8.5 not documented in man page --- doc/colors.n | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/doc/colors.n b/doc/colors.n index 6e73390..46c35aa 100644 --- a/doc/colors.n +++ b/doc/colors.n @@ -27,6 +27,7 @@ AntiqueWhite1 255 239 219 AntiqueWhite2 238 223 204 AntiqueWhite3 205 192 176 AntiqueWhite4 139 131 120 +agua 0 255 255 aquamarine 127 255 212 aquamarine1 127 255 212 aquamarine2 118 238 198 @@ -91,6 +92,7 @@ cornsilk1 255 248 220 cornsilk2 238 232 205 cornsilk3 205 200 177 cornsilk4 139 136 120 +crymson 220 20 60 cyan 0 255 255 cyan1 0 255 255 cyan2 0 238 238 @@ -189,6 +191,7 @@ floral white 255 250 240 FloralWhite 255 250 240 forest green 34 139 34 ForestGreen 34 139 34 +fuchsia 255 0 255 gainsboro 220 220 220 ghost white 248 248 255 GhostWhite 248 248 255 @@ -430,6 +433,7 @@ IndianRed1 255 106 106 IndianRed2 238 99 99 IndianRed3 205 85 85 IndianRed4 139 58 58 +indigo 75 0 130 ivory 255 255 240 ivory1 255 255 240 ivory2 238 238 224 @@ -521,6 +525,7 @@ LightYellow1 255 255 224 LightYellow2 238 238 209 LightYellow3 205 205 180 LightYellow4 139 139 122 +lime 0 255 0 lime green 50 205 50 LimeGreen 50 205 50 linen 250 240 230 @@ -582,6 +587,7 @@ navy blue 0 0 128 NavyBlue 0 0 128 old lace 253 245 230 OldLace 253 245 230 +olive 128 128 0 olive drab 107 142 35 OliveDrab 107 142 35 OliveDrab1 192 255 62 @@ -692,6 +698,7 @@ sienna1 255 130 71 sienna2 238 121 66 sienna3 205 104 57 sienna4 139 71 38 +silver 192 192 192 sky blue 135 206 235 SkyBlue 135 206 235 SkyBlue1 135 206 255 @@ -734,6 +741,7 @@ tan1 255 165 79 tan2 238 154 73 tan3 205 133 63 tan4 139 90 43 +teal 0 128 128 thistle 216 191 216 thistle1 255 225 255 thistle2 238 210 238 @@ -944,3 +952,6 @@ GrayText WindowText options(n), Tk_GetColor(3) .SH KEYWORDS color, option +'\" Local Variables: +'\" mode: nroff +'\" End: -- cgit v0.12 From 69cded06b737884b3c2f111d3a3a40db146bcef1 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 25 Jun 2015 09:29:27 +0000 Subject: Fix bug in "make dist" when system-encoding is UTF-8: eolFix will then translate some windows-specific files to UTF-8 too. Solution: commit those files with CRLF line-ending, which eliminates the need for eolFix altgether. See als: [495120] for the reason why eolFix was introduced in the first place. No longer needed with fossil. --- .fossil-settings/crnl-glob | 6 + .fossil-settings/encoding-glob | 6 + ChangeLog | 2 +- macosx/Wish.xcode/project.pbxproj | 2 - macosx/Wish.xcodeproj/project.pbxproj | 2 - unix/Makefile.in | 5 - win/buildall.vc.bat | 214 ++-- win/makefile.bc | 1070 ++++++++--------- win/makefile.vc | 2056 ++++++++++++++++----------------- win/mkd.bat | 24 +- win/rc/tk_base.rc | 12 +- win/rc/wish.rc | 2 +- win/rmd.bat | 40 +- win/rules.vc | 1432 +++++++++++------------ win/tkConfig.sh.in | 2 +- 15 files changed, 2439 insertions(+), 2436 deletions(-) create mode 100644 .fossil-settings/encoding-glob diff --git a/.fossil-settings/crnl-glob b/.fossil-settings/crnl-glob index e69de29..7175730 100644 --- a/.fossil-settings/crnl-glob +++ b/.fossil-settings/crnl-glob @@ -0,0 +1,6 @@ +win/buildall.vc.bat +win/makefile.bc +win/makefile.vc +win/mkd.bat +win/rmd.bat +win/rules.vc diff --git a/.fossil-settings/encoding-glob b/.fossil-settings/encoding-glob new file mode 100644 index 0000000..7175730 --- /dev/null +++ b/.fossil-settings/encoding-glob @@ -0,0 +1,6 @@ +win/buildall.vc.bat +win/makefile.bc +win/makefile.vc +win/mkd.bat +win/rmd.bat +win/rules.vc diff --git a/ChangeLog b/ChangeLog index 2f67e74..90ec655 100644 --- a/ChangeLog +++ b/ChangeLog @@ -31,7 +31,7 @@ a better first place to look now. * library/ttk/progress.tcl: Bug [c597acdab3]: Call [$pb step] in tail position in ttk::progressbar::Autoincrement, so that the widget is in a consistent state when any write traces on - the linked -variable are fired. + the linked -variable are fired. 2013-07-02 Jan Nijtmans diff --git a/macosx/Wish.xcode/project.pbxproj b/macosx/Wish.xcode/project.pbxproj index ef0fc31..02a197e 100644 --- a/macosx/Wish.xcode/project.pbxproj +++ b/macosx/Wish.xcode/project.pbxproj @@ -1920,7 +1920,6 @@ F96D43D108F272B8004A47F5 /* checkLibraryDoc.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = checkLibraryDoc.tcl; sourceTree = ""; }; F96D43D208F272B8004A47F5 /* configure */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = configure; sourceTree = ""; }; F96D43D308F272B8004A47F5 /* configure.in */ = {isa = PBXFileReference; explicitFileType = text.script.sh; fileEncoding = 4; path = configure.in; sourceTree = ""; }; - F96D442208F272B8004A47F5 /* eolFix.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = eolFix.tcl; sourceTree = ""; }; F96D442408F272B8004A47F5 /* fix_tommath_h.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = fix_tommath_h.tcl; sourceTree = ""; }; F96D442508F272B8004A47F5 /* genStubs.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = genStubs.tcl; sourceTree = ""; }; F96D442708F272B8004A47F5 /* index.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = index.tcl; sourceTree = ""; }; @@ -3715,7 +3714,6 @@ F96D43D108F272B8004A47F5 /* checkLibraryDoc.tcl */, F96D43D208F272B8004A47F5 /* configure */, F96D43D308F272B8004A47F5 /* configure.in */, - F96D442208F272B8004A47F5 /* eolFix.tcl */, F96D442408F272B8004A47F5 /* fix_tommath_h.tcl */, F96D442508F272B8004A47F5 /* genStubs.tcl */, F96D442708F272B8004A47F5 /* index.tcl */, diff --git a/macosx/Wish.xcodeproj/project.pbxproj b/macosx/Wish.xcodeproj/project.pbxproj index 5c7f667..0fd1bea 100644 --- a/macosx/Wish.xcodeproj/project.pbxproj +++ b/macosx/Wish.xcodeproj/project.pbxproj @@ -1920,7 +1920,6 @@ F96D43D108F272B8004A47F5 /* checkLibraryDoc.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = checkLibraryDoc.tcl; sourceTree = ""; }; F96D43D208F272B8004A47F5 /* configure */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = configure; sourceTree = ""; }; F96D43D308F272B8004A47F5 /* configure.in */ = {isa = PBXFileReference; explicitFileType = text.script.sh; fileEncoding = 4; path = configure.in; sourceTree = ""; }; - F96D442208F272B8004A47F5 /* eolFix.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = eolFix.tcl; sourceTree = ""; }; F96D442408F272B8004A47F5 /* fix_tommath_h.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = fix_tommath_h.tcl; sourceTree = ""; }; F96D442508F272B8004A47F5 /* genStubs.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = genStubs.tcl; sourceTree = ""; }; F96D442708F272B8004A47F5 /* index.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = index.tcl; sourceTree = ""; }; @@ -3715,7 +3714,6 @@ F96D43D108F272B8004A47F5 /* checkLibraryDoc.tcl */, F96D43D208F272B8004A47F5 /* configure */, F96D43D308F272B8004A47F5 /* configure.in */, - F96D442208F272B8004A47F5 /* eolFix.tcl */, F96D442408F272B8004A47F5 /* fix_tommath_h.tcl */, F96D442508F272B8004A47F5 /* genStubs.tcl */, F96D442708F272B8004A47F5 /* index.tcl */, diff --git a/unix/Makefile.in b/unix/Makefile.in index d869528..83e6667 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -1541,18 +1541,13 @@ dist: $(UNIX_DIR)/configure $(UNIX_DIR)/tkConfig.h.in $(UNIX_DIR)/tk.pc.in $(M $(TOP_DIR)/win/aclocal.m4 $(TOP_DIR)/win/tcl.m4 \ $(DISTDIR)/win cp -p $(TOP_DIR)/win/*.[ch] $(TOP_DIR)/win/*.bat $(DISTDIR)/win - $(TCL_EXE) $(TOOL_DIR)/eolFix.tcl -crlf $(DISTDIR)/win/*.bat cp -p $(TOP_DIR)/win/makefile.* $(DISTDIR)/win - $(TCL_EXE) $(TOOL_DIR)/eolFix.tcl -crlf $(DISTDIR)/win/makefile.* cp -p $(TOP_DIR)/win/rules.vc $(DISTDIR)/win - $(TCL_EXE) $(TOOL_DIR)/eolFix.tcl -crlf $(DISTDIR)/win/rules.vc cp -p $(TOP_DIR)/win/README $(DISTDIR)/win cp -p $(TOP_DIR)/license.terms $(DISTDIR)/win mkdir $(DISTDIR)/win/rc cp -p $(TOP_DIR)/win/wish.exe.manifest.in $(DISTDIR)/win/ cp -p $(TOP_DIR)/win/rc/*.{rc,cur,ico,bmp} $(DISTDIR)/win/rc - $(TCL_EXE) $(TOOL_DIR)/eolFix.tcl -crlf $(DISTDIR)/win/rc/*.rc - $(TCL_EXE) $(TOOL_DIR)/eolFix.tcl -crlf $(DISTDIR)/win/wish.exe.manifest.in mkdir $(DISTDIR)/macosx cp -p $(MAC_OSX_DIR)/GNUmakefile $(MAC_OSX_DIR)/README \ $(MAC_OSX_DIR)/*.icns $(MAC_OSX_DIR)/*.tiff \ diff --git a/win/buildall.vc.bat b/win/buildall.vc.bat index 0bd2888..9cdf0d9 100755 --- a/win/buildall.vc.bat +++ b/win/buildall.vc.bat @@ -1,107 +1,107 @@ -@echo off - -:: This is an example batchfile for building everything. Please -:: edit this (or make your own) for your needs and wants using -:: the instructions for calling makefile.vc found in makefile.vc - -set SYMBOLS= - -:OPTIONS -if "%1" == "/?" goto help -if /i "%1" == "/help" goto help -if %1.==symbols. goto SYMBOLS -if %1.==debug. goto SYMBOLS -goto OPTIONS_DONE - -:SYMBOLS - set SYMBOLS=symbols - shift - goto OPTIONS - -:OPTIONS_DONE - -:: reset errorlevel -cd > nul - -:: You might have installed your developer studio to add itself to the -:: path or have already run vcvars32.bat. Testing these envars proves -:: cl.exe and friends are in your path. -:: -if defined VCINSTALLDIR (goto :startBuilding) -if defined MSDEVDIR (goto :startBuilding) -if defined MSVCDIR (goto :startBuilding) -if defined MSSDK (goto :startBuilding) -if defined WINDOWSSDKDIR (goto :startBuilding) - -:: We need to run the development environment batch script that comes -:: with developer studio (v4,5,6,7,etc...) All have it. This path -:: might not be correct. You should call it yourself prior to running -:: this batchfile. -:: -call "C:\Program Files\Microsoft Developer Studio\vc98\bin\vcvars32.bat" -if errorlevel 1 (goto no_vcvars) - -:startBuilding - -echo. -echo Sit back and have a cup of coffee while this grinds through ;) -echo You asked for *everything*, remember? -echo. -title Building Tk, please wait... - - -:: makefile.vc uses this for its default anyways, but show its use here -:: just to be explicit and convey understanding to the user. Setting -:: the INSTALLDIR envar prior to running this batchfile affects all builds. -:: -if "%INSTALLDIR%" == "" set INSTALLDIR=C:\Program Files\Tcl - - -:: Where is the Tcl source directory? -:: You can set the TCLDIR environment variable to your Tcl HEAD checkout -if "%TCLDIR%" == "" set TCLDIR=..\..\tcl - -:: Build the normal stuff along with the help file. -:: -set OPTS=threads -if not %SYMBOLS%.==. set OPTS=symbols,threads -nmake -nologo -f makefile.vc release OPTS=%OPTS% %1 -if errorlevel 1 goto error - -:: Build the static core and shell. -:: -set OPTS=static,msvcrt,threads -if not %SYMBOLS%.==. set OPTS=symbols,static,msvcrt,threads -nmake -nologo -f makefile.vc shell OPTS=%OPTS% %1 -if errorlevel 1 goto error - -set OPTS= -set SYMBOLS= -goto end - -:error -echo *** BOOM! *** -goto end - -:no_vcvars -echo vcvars32.bat was not run prior to this batchfile, nor are the MS tools in your path. -goto out - -:help -title buildall.vc.bat help message -echo usage: -echo %0 : builds Tk for all build types (do this first) -echo %0 install : installs all the release builds (do this second) -echo %0 symbols : builds Tk for all debugging build types -echo %0 symbols install : install all the debug builds -echo. -goto out - -:end -title Building Tk, please wait... DONE! -echo DONE! -goto out - -:out -pause -title Command Prompt +@echo off + +:: This is an example batchfile for building everything. Please +:: edit this (or make your own) for your needs and wants using +:: the instructions for calling makefile.vc found in makefile.vc + +set SYMBOLS= + +:OPTIONS +if "%1" == "/?" goto help +if /i "%1" == "/help" goto help +if %1.==symbols. goto SYMBOLS +if %1.==debug. goto SYMBOLS +goto OPTIONS_DONE + +:SYMBOLS + set SYMBOLS=symbols + shift + goto OPTIONS + +:OPTIONS_DONE + +:: reset errorlevel +cd > nul + +:: You might have installed your developer studio to add itself to the +:: path or have already run vcvars32.bat. Testing these envars proves +:: cl.exe and friends are in your path. +:: +if defined VCINSTALLDIR (goto :startBuilding) +if defined MSDEVDIR (goto :startBuilding) +if defined MSVCDIR (goto :startBuilding) +if defined MSSDK (goto :startBuilding) +if defined WINDOWSSDKDIR (goto :startBuilding) + +:: We need to run the development environment batch script that comes +:: with developer studio (v4,5,6,7,etc...) All have it. This path +:: might not be correct. You should call it yourself prior to running +:: this batchfile. +:: +call "C:\Program Files\Microsoft Developer Studio\vc98\bin\vcvars32.bat" +if errorlevel 1 (goto no_vcvars) + +:startBuilding + +echo. +echo Sit back and have a cup of coffee while this grinds through ;) +echo You asked for *everything*, remember? +echo. +title Building Tk, please wait... + + +:: makefile.vc uses this for its default anyways, but show its use here +:: just to be explicit and convey understanding to the user. Setting +:: the INSTALLDIR envar prior to running this batchfile affects all builds. +:: +if "%INSTALLDIR%" == "" set INSTALLDIR=C:\Program Files\Tcl + + +:: Where is the Tcl source directory? +:: You can set the TCLDIR environment variable to your Tcl HEAD checkout +if "%TCLDIR%" == "" set TCLDIR=..\..\tcl + +:: Build the normal stuff along with the help file. +:: +set OPTS=threads +if not %SYMBOLS%.==. set OPTS=symbols,threads +nmake -nologo -f makefile.vc release OPTS=%OPTS% %1 +if errorlevel 1 goto error + +:: Build the static core and shell. +:: +set OPTS=static,msvcrt,threads +if not %SYMBOLS%.==. set OPTS=symbols,static,msvcrt,threads +nmake -nologo -f makefile.vc shell OPTS=%OPTS% %1 +if errorlevel 1 goto error + +set OPTS= +set SYMBOLS= +goto end + +:error +echo *** BOOM! *** +goto end + +:no_vcvars +echo vcvars32.bat was not run prior to this batchfile, nor are the MS tools in your path. +goto out + +:help +title buildall.vc.bat help message +echo usage: +echo %0 : builds Tk for all build types (do this first) +echo %0 install : installs all the release builds (do this second) +echo %0 symbols : builds Tk for all debugging build types +echo %0 symbols install : install all the debug builds +echo. +goto out + +:end +title Building Tk, please wait... DONE! +echo DONE! +goto out + +:out +pause +title Command Prompt diff --git a/win/makefile.bc b/win/makefile.bc index 295ed23..5a22c95 100644 --- a/win/makefile.bc +++ b/win/makefile.bc @@ -1,535 +1,535 @@ -# -# Makefile for Borland C++ 5.5 (or C++ Builder 5), adapted from the makefile -# for Visual C++ that came with tk 8.3.3 -# -# Some "not so obvious" details in this makefile are preceded by a comment -# "maintenance hint", which tries to explain what's going on. Better to -# leave those in place. -# Helmut Giese, July 2002 -# -# See the file "license.terms" for information on usage and redistribution -# of this file, and for a DISCLAIMER OF ALL WARRANTIES. -# -# Copyright (c) 1995-1997 Sun Microsystems, Inc. -# Copyright (c) 1998-2000 Ajuba Solutions. - -# Does not depend on the presence of any environment variables in -# order to compile tcl; all needed information is derived from -# location of the compiler directories. - -# -# Project directories -# -# ROOT = top of source tree -# -# TMPDIR = location where .obj files should be stored during build -# -# TOOLS32 = location of Borland development tools. -# -# TCLDIR = location of top of Tcl source hierarchy -# - -ROOT = .. -TCLDIR = ..\..\tcl8.4 -INSTALLDIR = D:\tmp\tcl - -# If you have C++ Builder 5 or the free Borland C++ 5.5 compiler -# adapt the following paths as appropriate for your system -TOOLS32 = d:\cbld5 -TOOLS32_rc = d:\cbld5 -#TOOLS32 = c:\bc55 -#TOOLS32_rc = c:\bc55 - -cc32 = "$(TOOLS32)\bin\bcc32.exe" -link32 = "$(TOOLS32)\bin\ilink32.exe" -lib32 = "$(TOOLS32)\bin\tlib.exe" -rc32 = "$(TOOLS32_rc)\bin\brcc32.exe" -include32 = -I"$(TOOLS32)\include;$(TOOLS32)\include\mfc" -libpath32 = -L"$(TOOLS32)\lib" - -# Uncomment the following line to compile with thread support -#THREADDEFINES = -DTCL_THREADS=1 - -# Allow definition of NDEBUG via command line -# Set NODEBUG to 0 to compile with symbols -!if !defined(NODEBUG) -NODEBUG = 1 -!endif - -# uncomment the following two lines to compile with TCL_MEM_DEBUG -#DEBUGDEFINES =-DTCL_MEM_DEBUG - -###################################################################### -# Do not modify below this line -###################################################################### - -TCLNAMEPREFIX = tcl -TKNAMEPREFIX = tk -WISHNAMEPREFIX = wish -VERSION = 84 -DOTVERSION = 8.4 - -TCLSTUBPREFIX = $(TCLNAMEPREFIX)stub -TKSTUBPREFIX = $(TKNAMEPREFIX)stub - - -BINROOT = . -!IF "$(NODEBUG)" == "1" -TMPDIRNAME = Release -DBGX = -!ELSE -TMPDIRNAME = Debug -DBGX = -#DBGX = d -!ENDIF -TMPDIR = $(BINROOT)\$(TMPDIRNAME) -OUTDIRNAME = $(TMPDIRNAME) -OUTDIR = $(TMPDIR) - -TCLLIB = $(TCLNAMEPREFIX)$(VERSION)$(DBGX).lib -TCLPLUGINLIB = $(TCLNAMEPREFIX)$(VERSION)p.lib -TCLSTUBLIB = $(TCLSTUBPREFIX)$(VERSION)$(DBGX).lib -TKDLLNAME = $(TKNAMEPREFIX)$(VERSION)$(DBGX).dll -TKDLL = $(OUTDIR)\$(TKDLLNAME) -TKLIB = $(OUTDIR)\$(TKNAMEPREFIX)$(VERSION)$(DBGX).lib -TKSTUBLIBNAME = $(TKSTUBPREFIX)$(VERSION)$(DBGX).lib -TKSTUBLIB = $(OUTDIR)\$(TKSTUBLIBNAME) -TKPLUGINDLLNAME = $(TKNAMEPREFIX)$(VERSION)p$(DBG).dll -TKPLUGINDLL = $(OUTDIR)\$(TKPLUGINDLLNAME) -TKPLUGINLIB = $(OUTDIR)\$(TKNAMEPREFIX)$(VERSION)p$(DBGX).lib - -WISH = $(OUTDIR)\$(WISHNAMEPREFIX)$(VERSION)$(DBGX).exe -WISHC = $(OUTDIR)\$(WISHNAMEPREFIX)c$(VERSION)$(DBGX).exe -WISHP = $(OUTDIR)\$(WISHNAMEPREFIX)p$(VERSION)$(DBGX).exe -TKTEST = $(OUTDIR)\$(TKNAMEPREFIX)test.exe -CAT32 = $(TMPDIR)\cat32.exe - -BIN_INSTALL_DIR = $(INSTALLDIR)\bin -INCLUDE_INSTALL_DIR = $(INSTALLDIR)\include -LIB_INSTALL_DIR = $(INSTALLDIR)\lib -SCRIPT_INSTALL_DIR = $(LIB_INSTALL_DIR)\tk$(DOTVERSION) - -WISHOBJS = \ - $(TMPDIR)\winMain.obj - -TKTESTOBJS = \ - $(TMPDIR)\tkTest.obj \ - $(TMPDIR)\tkSquare.obj \ - $(TMPDIR)\testMain.obj \ - $(TMPDIR)\tkOldTest.obj \ - $(TMPDIR)\tkWinTest.obj \ - $(TCLLIBDIR)\tclThreadTest.obj - -XLIBOBJS = \ - $(TMPDIR)\xcolors.obj \ - $(TMPDIR)\xdraw.obj \ - $(TMPDIR)\xgc.obj \ - $(TMPDIR)\ximage.obj \ - $(TMPDIR)\xutil.obj - -TKOBJS = \ - $(TMPDIR)\tkConsole.obj \ - $(TMPDIR)\tkUnixMenubu.obj \ - $(TMPDIR)\tkUnixScale.obj \ - $(XLIBOBJS) \ - $(TMPDIR)\tkWin3d.obj \ - $(TMPDIR)\tkWin32Dll.obj \ - $(TMPDIR)\tkWinButton.obj \ - $(TMPDIR)\tkWinClipboard.obj \ - $(TMPDIR)\tkWinColor.obj \ - $(TMPDIR)\tkWinConfig.obj \ - $(TMPDIR)\tkWinCursor.obj \ - $(TMPDIR)\tkWinDialog.obj \ - $(TMPDIR)\tkWinDraw.obj \ - $(TMPDIR)\tkWinEmbed.obj \ - $(TMPDIR)\tkWinFont.obj \ - $(TMPDIR)\tkWinImage.obj \ - $(TMPDIR)\tkWinInit.obj \ - $(TMPDIR)\tkWinKey.obj \ - $(TMPDIR)\tkWinMenu.obj \ - $(TMPDIR)\tkWinPixmap.obj \ - $(TMPDIR)\tkWinPointer.obj \ - $(TMPDIR)\tkWinRegion.obj \ - $(TMPDIR)\tkWinScrlbr.obj \ - $(TMPDIR)\tkWinSend.obj \ - $(TMPDIR)\tkWinWindow.obj \ - $(TMPDIR)\tkWinWm.obj \ - $(TMPDIR)\tkWinX.obj \ - $(TMPDIR)\stubs.obj \ - $(TMPDIR)\tk3d.obj \ - $(TMPDIR)\tkArgv.obj \ - $(TMPDIR)\tkAtom.obj \ - $(TMPDIR)\tkBind.obj \ - $(TMPDIR)\tkBitmap.obj \ - $(TMPDIR)\tkButton.obj \ - $(TMPDIR)\tkCanvArc.obj \ - $(TMPDIR)\tkCanvBmap.obj \ - $(TMPDIR)\tkCanvImg.obj \ - $(TMPDIR)\tkCanvLine.obj \ - $(TMPDIR)\tkCanvPoly.obj \ - $(TMPDIR)\tkCanvPs.obj \ - $(TMPDIR)\tkCanvText.obj \ - $(TMPDIR)\tkCanvUtil.obj \ - $(TMPDIR)\tkCanvWind.obj \ - $(TMPDIR)\tkCanvas.obj \ - $(TMPDIR)\tkClipboard.obj \ - $(TMPDIR)\tkCmds.obj \ - $(TMPDIR)\tkColor.obj \ - $(TMPDIR)\tkConfig.obj \ - $(TMPDIR)\tkCursor.obj \ - $(TMPDIR)\tkEntry.obj \ - $(TMPDIR)\tkError.obj \ - $(TMPDIR)\tkEvent.obj \ - $(TMPDIR)\tkFileFilter.obj \ - $(TMPDIR)\tkFocus.obj \ - $(TMPDIR)\tkFont.obj \ - $(TMPDIR)\tkFrame.obj \ - $(TMPDIR)\tkGC.obj \ - $(TMPDIR)\tkGeometry.obj \ - $(TMPDIR)\tkGet.obj \ - $(TMPDIR)\tkGrab.obj \ - $(TMPDIR)\tkGrid.obj \ - $(TMPDIR)\tkImage.obj \ - $(TMPDIR)\tkImgBmap.obj \ - $(TMPDIR)\tkImgGIF.obj \ - $(TMPDIR)\tkImgPPM.obj \ - $(TMPDIR)\tkImgPhoto.obj \ - $(TMPDIR)\tkImgUtil.obj \ - $(TMPDIR)\tkListbox.obj \ - $(TMPDIR)\tkMacWinMenu.obj \ - $(TMPDIR)\tkMain.obj \ - $(TMPDIR)\tkMenu.obj \ - $(TMPDIR)\tkMenubutton.obj \ - $(TMPDIR)\tkMenuDraw.obj \ - $(TMPDIR)\tkMessage.obj \ - $(TMP_DIR)\tkPanedWindow.obj \ - $(TMPDIR)\tkObj.obj \ - $(TMPDIR)\tkOldConfig.obj \ - $(TMPDIR)\tkOption.obj \ - $(TMPDIR)\tkPack.obj \ - $(TMPDIR)\tkPlace.obj \ - $(TMPDIR)\tkPointer.obj \ - $(TMPDIR)\tkRectOval.obj \ - $(TMPDIR)\tkScale.obj \ - $(TMPDIR)\tkScrollbar.obj \ - $(TMPDIR)\tkSelect.obj \ - $(TMPDIR)\tkText.obj \ - $(TMPDIR)\tkTextBTree.obj \ - $(TMPDIR)\tkTextDisp.obj \ - $(TMPDIR)\tkTextImage.obj \ - $(TMPDIR)\tkTextIndex.obj \ - $(TMPDIR)\tkTextMark.obj \ - $(TMPDIR)\tkTextTag.obj \ - $(TMPDIR)\tkTextWind.obj \ - $(TMPDIR)\tkTrig.obj \ - $(TMPDIR)\tkUtil.obj \ - $(TMPDIR)\tkVisual.obj \ - $(TMPDIR)\tkStubInit.obj \ - $(TMPDIR)\tkWindow.obj - -# Maintenance hint: Please have multiple members of TKSTUBOBJS be separated -# by exactly one ' ' (see below the rule for making TKSTUBLIB) -TKSTUBOBJS = $(TMPDIR)\tkStubLib.obj - -WINDIR = $(ROOT)\win -GENERICDIR = $(ROOT)\generic -XLIBDIR = $(ROOT)\xlib -BITMAPDIR = $(ROOT)\bitmaps -TCLLIBDIR = $(TCLDIR)\win\$(OUTDIRNAME) -RCDIR = $(WINDIR)\rc - -TK_INCLUDES = -I$(WINDIR) -I$(GENERICDIR) -I$(BITMAPDIR) -I$(XLIBDIR) \ - -I$(TCLDIR)\generic -I$(TCLDIR)\win - -TK_DEFINES = -D__WIN32__ $(DEBUGDEFINES) $(THREADDEFINES) SUPPORT_CONFIG_EMBEDDED - -###################################################################### -# Compile flags -###################################################################### - -!IF "$(NODEBUG)" == "1" -# these macros cause maximum optimization and no symbols -cdebug = -v- -vi- -O2 -D_DEBUG -!ELSE -# these macros enable debugging -cdebug = -k -Od -r- -v -vi- -y -!ENDIF - -SYSDEFINES = _MT;NO_STRICT;_NO_VCL - -# declarations common to all compiler options -cbase = -3 -a4 -c -g0 -tWM -Ve -Vx -X- -WARNINGS = -w-rch -w-pch -w-par -w-dup -w-pro -w-dpu - -ccons = -tWC - -CFLAGS = $(cdebug) $(cbase) $(WARNINGS) -D$(SYSDEFINES) - -CON_CFLAGS = $(CFLAGS) $(TK_DEFINES) $(include32) $(ccons) -WISH_CFLAGS = $(CFLAGS) $(include32) $(TK_INCLUDES) $(TK_DEFINES) -TK_CFLAGS = $(CFLAGS) $(include32) $(TK_INCLUDES) $(TK_DEFINES) \ - -DUSE_TCL_STUBS - -###################################################################### -# Link flags -###################################################################### - -!IF "$(NODEBUG)" == "1" -ldebug = -!ELSE -ldebug = -v -!ENDIF - -# declarations common to all linker options -LNFLAGS = -D"" -Gn -I$(TMPDIR) -x $(ldebug) $(libpath32) -# -Gi: create lib file (is -Gl in doc) -# -aa: Windows app, -ap: Windows console app -LNFLAGS_DLL = -ap -Gi -Tpd -LNFLAGS_CONS = -ap -Tpe -LNFLAGS_GUI = -aa -Tpe - -LNLIBS = import32 cw32mt - - -###################################################################### -# Project specific targets -###################################################################### - -all: setup $(WISH) $(CAT32) -install: install-binaries install-libraries -plugin: setup $(TKPLUGINDLL) $(WISHP) -tktest: setup $(TKTEST) $(CAT32) - -# Maintenance hint: We want to set environment variables before calling tktest. -# If we do this in the form of normal commands, they will not persist up to -# the call of tktest. Therfore we put all commands wanted into a batch file. -# The normal way of using 'echo >x.bat' and 'echo >>x.bat' does not work here -# because we cannot write '... > tktest.txt' this way. Hence this advanced -# form of loop hopping: -# - Have MAKE produce a temporary file with the content we want. -# - Use it as input to the COPY command to produce a batch file. -# - Run the batch file and be happy. -# -test: setup $(TKTEST) $(TKLIB) $(CAT32) - copy &&! - set TCL_LIBRARY=$(TCLDIR)/library - set PATH=$(TCLDIR)\win\$(TMPDIRNAME);$(PATH) - $(TKTEST) $(ROOT)/tests/all.tcl > tktest.txt -! _test.bat - _test.bat -# del _test.bat - -runtest: setup $(TKTEST) $(TKLIB) $(CAT32) - echo set TCL_LIBRARY=$(TCLDIR)/library > _test2.bat - echo set PATH=$(TCLDIR)\win\$(TMPDIRNAME);$(PATH) >> _test2.bat - echo $(TKTEST) >> _test2.bat - _test2.bat -# del _test2.bat - -console-wish : all $(WISHC) - -stubs: - $(TCLDIR)\win\$(TMPDIRNAME)\tclsh$(VERSION)$(DBGX) \ - $(TCLDIR)\tools\genStubs.tcl $(GENERICDIR) \ - $(GENERICDIR)\tk.decls $(GENERICDIR)\tkInt.decls - -setup: - @mkd $(TMPDIR) - @mkd $(OUTDIR) - -install-binaries: - @mkd "$(BIN_INSTALL_DIR)" - copy $(TKDLL) "$(BIN_INSTALL_DIR)" - copy $(WISH) "$(BIN_INSTALL_DIR)" - @mkd "$(LIB_INSTALL_DIR)" - copy $(TKLIB) "$(LIB_INSTALL_DIR)" - -install-libraries: - @mkd "$(INCLUDE_INSTALL_DIR)" - @mkd "$(INCLUDE_INSTALL_DIR)\X11" - copy "$(GENERICDIR)\tk.h" "$(INCLUDE_INSTALL_DIR)" - copy "$(GENERICDIR)\tkDecls.h" "$(INCLUDE_INSTALL_DIR)" - copy "$(GENERICDIR)\tkPlatDecls.h" "$(INCLUDE_INSTALL_DIR)" - copy "$(GENERICDIR)\tkIntXlibDecls.h" "$(INCLUDE_INSTALL_DIR)" - xcopy "$(XLIBDIR)\X11\*.h" "$(INCLUDE_INSTALL_DIR)\X11" - @mkd "$(SCRIPT_INSTALL_DIR)" - @mkd "$(SCRIPT_INSTALL_DIR)\images" - @mkd "$(SCRIPT_INSTALL_DIR)\demos" - @mkd "$(SCRIPT_INSTALL_DIR)\demos\images" - @mkd "$(SCRIPT_INSTALL_DIR)\msgs" - xcopy "$(ROOT)\library" "$(SCRIPT_INSTALL_DIR)" - xcopy "$(ROOT)\library\images" "$(SCRIPT_INSTALL_DIR)\images" - xcopy "$(ROOT)\library\demos" "$(SCRIPT_INSTALL_DIR)\demos" - xcopy "$(ROOT)\library\demos\images" "$(SCRIPT_INSTALL_DIR)\demos\images" - xcopy "$(ROOT)\library\msgs" "$(SCRIPT_INSTALL_DIR)\msgs" - -$(TKLIB): $(TKDLL) $(TKSTUBLIB) - -# Maintenance hint: The macro puts a '+-' before the first member of -# TKSTUBOBJS, than replaces any ' ' with ' +-' - together putting '+-' in -# front of any member of TKSTUBOBJS (provided, they are separated in their -# defintion by just one space). -# -# The first time you *make* this target, you will get a warning -# tkStubLib not found in library -# This is (probably) because of the '-' option, telling TLIB to remove -# 'tkStubLib' when it does not yet exist. Forcing a re-make when it already -# exists avoids this warning. -# -$(TKSTUBLIB): $(TKSTUBOBJS) - $(lib32) $@ +-$(TKSTUBOBJS: = +-) - -# $(lib32) $@ @&&! -#+-$(TKSTUBOBJS: = &^ -#+-) -#! - -$(TKDLL): $(TKOBJS) $(TMPDIR)\tk.res - $(link32) $(ldebug) $(LNFLAGS) $(LNFLAGS_DLL) $(TOOLS32)\lib\c0d32 @&&! - $(TKOBJS), $@, -x, $(LNLIBS) $(TCLLIBDIR)\$(TCLSTUBLIB),, $(TMPDIR)\tk.res -! - -$(TKPLUGINLIB): $(TKPLUGINDLL) - -#$(TKPLUGINDLL): $(TKOBJS) $(TMPDIR)\tk.res -# $(link32) $(ldebug) $(dlllflags) \ -# -out:$@ $(TMPDIR)\tk.res $(TCLLIBDIR)\$(TCLPLUGINLIB) \ -# $(guilibsdll) @<< -# $(TKOBJS) -#<< - -$(WISH): $(WISHOBJS) $(TKLIB) $(TMPDIR)\wish.res - $(link32) $(ldebug) -S:2400000 $(LNFLAGS) $(LNFLAGS_GUI) $(TOOLS32)\lib\c0x32 @&&! - $(WISHOBJS), $@, -x, $(LNLIBS) $(TCLLIBDIR)\$(TCLLIB) $(TKLIB),, $(TMPDIR)\wish.res -! - -$(WISHC): $(WISHOBJS) $(TKLIB) $(TMPDIR)\wish.res - $(link32) $(ldebug) -S:2400000 $(LNFLAGS) $(LNFLAGS_CONS) $(TOOLS32)\lib\c0x32 @&&! - $(WISHOBJS), $@, -x, $(LNLIBS) $(TCLLIBDIR)\$(TCLLIB) $(TKLIB),, $(TMPDIR)\wish.res -! - -$(WISHP): $(WISHOBJS) $(TKPLUGINLIB) $(TMPDIR)\wish.res - $(link32) $(ldebug) $(guilflags) $(TMPDIR)\wish.res -out:$@ \ - $(guilibsdll) $(TCLLIBDIR)\$(TCLPLUGINLIB) \ - $(TKPLUGINLIB) $(WISHOBJS) - -$(TKTEST): $(TKTESTOBJS) $(TKLIB) $(TMPDIR)\wish.res - $(link32) $(ldebug) -S:2400000 $(LNFLAGS) $(LNFLAGS_GUI) $(TOOLS32)\lib\c0x32 @&&! - $(TKTESTOBJS), $@, -x, $(LNLIBS) $(TCLLIBDIR)\$(TCLLIB) $(TKLIB),, $(TMPDIR)\wish.res -! -# $(link32) $(ldebug) $(guilflags) $(TMPDIR)\wish.res -out:$@ \ -# $(guilibsdll) $(TCLLIBDIR)\$(TCLLIB) $(TKLIB) $(TKTESTOBJS) - -#$(CAT32): $(TCLDIR)\win\cat.c -# $(cc32) $(CON_CFLAGS) -o$(TMPDIR)\cat.obj $? -# $(link32) $(conlflags) -out:$@ -stack:16384 $(TMPDIR)\cat.obj $(conlibs) - -$(CAT32): $(TCLDIR)\win\cat.c - $(cc32) $(CONS_CFLAGS) -o$(TMPDIR)\cat.obj $? - $(link32) $(ldebug) $(LNFLAGS) $(LNFLAGS_CONS) $(TOOLS32)\lib\c0x32 \ - $(TMPDIR)\cat.obj, $@, -x, $(LNLIBS),, - -# -# Regenerate the stubs files. -# - -genstubs: - tclsh$(VERSION) $(TCLDIR)\tools\genStubs.tcl $(GENERICDIR) \ - $(GENERICDIR)\tk.decls $(GENERICDIR)\tkInt.decls - -# -# Special case object file targets -# - -$(TMPDIR)\testMain.obj: $(WINDIR)\winMain.c - $(cc32) $(WISH_CFLAGS) -DTK_TEST -o$@ $? - -$(TMPDIR)\tkTest.obj: $(GENERICDIR)\tkTest.c - $(cc32) $(WISH_CFLAGS) -o$@ $? - -$(TMPDIR)\tkOldTest.obj: $(GENERICDIR)\tkOldTest.c - $(cc32) $(WISH_CFLAGS) -o$@ $? - -$(TMPDIR)\tkWinTest.obj: $(WINDIR)\tkWinTest.c - $(cc32) $(WISH_CFLAGS) -o$@ $? - -$(TMPDIR)\tkSquare.obj: $(GENERICDIR)\tkSquare.c - $(cc32) $(WISH_CFLAGS) -o$@ $? - -$(TMPDIR)\winMain.obj: $(WINDIR)\winMain.c - $(cc32) $(WISH_CFLAGS) -o$@ $? - -$(TMPDIR)\tkStubLib.obj : $(GENERICDIR)\tkStubLib.c - $(cc32) $(TK_CFLAGS) -DSTATIC_BUILD -o$@ $? - -# -# Implicit rules -# - -{$(XLIBDIR)}.c{$(TMPDIR)}.obj: - $(cc32) -DDLL_BUILD -DBUILD_tk $(TK_CFLAGS) -o$@ $< - -{$(GENERICDIR)}.c{$(TMPDIR)}.obj: - $(cc32) -DDLL_BUILD -DBUILD_tk $(TK_CFLAGS) -o$@ $< - -{$(WINDIR)}.c{$(TMPDIR)}.obj: - $(cc32) -DDLL_BUILD -DBUILD_tk $(TK_CFLAGS) -o$@ $< - -{$(ROOT)\unix}.c{$(TMPDIR)}.obj: - $(cc32) -DDLL_BUILD -DBUILD_tk $(TK_CFLAGS) -o$@ $< - -{$(RCDIR)}.rc{$(TMPDIR)}.res: - $(rc32) -I"$(GENERICDIR)" -I"$(TOOLS32)\include" -I"$(TCLDIR)\generic" \ - -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< - -clean: - -@del $(OUTDIR)\*.exp - -@del $(OUTDIR)\*.lib - -@del $(OUTDIR)\*.dll - -@del $(OUTDIR)\*.exe - -@del $(OUTDIR)\*.pdb - -@del $(TMPDIR)\*.pch - -@del $(TMPDIR)\*.obj - -@del $(TMPDIR)\*.res - -@del $(TMPDIR)\*.exe - -@rmd $(OUTDIR) - -@rmd $(TMPDIR) - -# dependencies - -$(TMPDIR)\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)/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)/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 - - +# +# Makefile for Borland C++ 5.5 (or C++ Builder 5), adapted from the makefile +# for Visual C++ that came with tk 8.3.3 +# +# Some "not so obvious" details in this makefile are preceded by a comment +# "maintenance hint", which tries to explain what's going on. Better to +# leave those in place. +# Helmut Giese, July 2002 +# +# See the file "license.terms" for information on usage and redistribution +# of this file, and for a DISCLAIMER OF ALL WARRANTIES. +# +# Copyright (c) 1995-1997 Sun Microsystems, Inc. +# Copyright (c) 1998-2000 Ajuba Solutions. + +# Does not depend on the presence of any environment variables in +# order to compile tcl; all needed information is derived from +# location of the compiler directories. + +# +# Project directories +# +# ROOT = top of source tree +# +# TMPDIR = location where .obj files should be stored during build +# +# TOOLS32 = location of Borland development tools. +# +# TCLDIR = location of top of Tcl source hierarchy +# + +ROOT = .. +TCLDIR = ..\..\tcl8.4 +INSTALLDIR = D:\tmp\tcl + +# If you have C++ Builder 5 or the free Borland C++ 5.5 compiler +# adapt the following paths as appropriate for your system +TOOLS32 = d:\cbld5 +TOOLS32_rc = d:\cbld5 +#TOOLS32 = c:\bc55 +#TOOLS32_rc = c:\bc55 + +cc32 = "$(TOOLS32)\bin\bcc32.exe" +link32 = "$(TOOLS32)\bin\ilink32.exe" +lib32 = "$(TOOLS32)\bin\tlib.exe" +rc32 = "$(TOOLS32_rc)\bin\brcc32.exe" +include32 = -I"$(TOOLS32)\include;$(TOOLS32)\include\mfc" +libpath32 = -L"$(TOOLS32)\lib" + +# Uncomment the following line to compile with thread support +#THREADDEFINES = -DTCL_THREADS=1 + +# Allow definition of NDEBUG via command line +# Set NODEBUG to 0 to compile with symbols +!if !defined(NODEBUG) +NODEBUG = 1 +!endif + +# uncomment the following two lines to compile with TCL_MEM_DEBUG +#DEBUGDEFINES =-DTCL_MEM_DEBUG + +###################################################################### +# Do not modify below this line +###################################################################### + +TCLNAMEPREFIX = tcl +TKNAMEPREFIX = tk +WISHNAMEPREFIX = wish +VERSION = 84 +DOTVERSION = 8.4 + +TCLSTUBPREFIX = $(TCLNAMEPREFIX)stub +TKSTUBPREFIX = $(TKNAMEPREFIX)stub + + +BINROOT = . +!IF "$(NODEBUG)" == "1" +TMPDIRNAME = Release +DBGX = +!ELSE +TMPDIRNAME = Debug +DBGX = +#DBGX = d +!ENDIF +TMPDIR = $(BINROOT)\$(TMPDIRNAME) +OUTDIRNAME = $(TMPDIRNAME) +OUTDIR = $(TMPDIR) + +TCLLIB = $(TCLNAMEPREFIX)$(VERSION)$(DBGX).lib +TCLPLUGINLIB = $(TCLNAMEPREFIX)$(VERSION)p.lib +TCLSTUBLIB = $(TCLSTUBPREFIX)$(VERSION)$(DBGX).lib +TKDLLNAME = $(TKNAMEPREFIX)$(VERSION)$(DBGX).dll +TKDLL = $(OUTDIR)\$(TKDLLNAME) +TKLIB = $(OUTDIR)\$(TKNAMEPREFIX)$(VERSION)$(DBGX).lib +TKSTUBLIBNAME = $(TKSTUBPREFIX)$(VERSION)$(DBGX).lib +TKSTUBLIB = $(OUTDIR)\$(TKSTUBLIBNAME) +TKPLUGINDLLNAME = $(TKNAMEPREFIX)$(VERSION)p$(DBG).dll +TKPLUGINDLL = $(OUTDIR)\$(TKPLUGINDLLNAME) +TKPLUGINLIB = $(OUTDIR)\$(TKNAMEPREFIX)$(VERSION)p$(DBGX).lib + +WISH = $(OUTDIR)\$(WISHNAMEPREFIX)$(VERSION)$(DBGX).exe +WISHC = $(OUTDIR)\$(WISHNAMEPREFIX)c$(VERSION)$(DBGX).exe +WISHP = $(OUTDIR)\$(WISHNAMEPREFIX)p$(VERSION)$(DBGX).exe +TKTEST = $(OUTDIR)\$(TKNAMEPREFIX)test.exe +CAT32 = $(TMPDIR)\cat32.exe + +BIN_INSTALL_DIR = $(INSTALLDIR)\bin +INCLUDE_INSTALL_DIR = $(INSTALLDIR)\include +LIB_INSTALL_DIR = $(INSTALLDIR)\lib +SCRIPT_INSTALL_DIR = $(LIB_INSTALL_DIR)\tk$(DOTVERSION) + +WISHOBJS = \ + $(TMPDIR)\winMain.obj + +TKTESTOBJS = \ + $(TMPDIR)\tkTest.obj \ + $(TMPDIR)\tkSquare.obj \ + $(TMPDIR)\testMain.obj \ + $(TMPDIR)\tkOldTest.obj \ + $(TMPDIR)\tkWinTest.obj \ + $(TCLLIBDIR)\tclThreadTest.obj + +XLIBOBJS = \ + $(TMPDIR)\xcolors.obj \ + $(TMPDIR)\xdraw.obj \ + $(TMPDIR)\xgc.obj \ + $(TMPDIR)\ximage.obj \ + $(TMPDIR)\xutil.obj + +TKOBJS = \ + $(TMPDIR)\tkConsole.obj \ + $(TMPDIR)\tkUnixMenubu.obj \ + $(TMPDIR)\tkUnixScale.obj \ + $(XLIBOBJS) \ + $(TMPDIR)\tkWin3d.obj \ + $(TMPDIR)\tkWin32Dll.obj \ + $(TMPDIR)\tkWinButton.obj \ + $(TMPDIR)\tkWinClipboard.obj \ + $(TMPDIR)\tkWinColor.obj \ + $(TMPDIR)\tkWinConfig.obj \ + $(TMPDIR)\tkWinCursor.obj \ + $(TMPDIR)\tkWinDialog.obj \ + $(TMPDIR)\tkWinDraw.obj \ + $(TMPDIR)\tkWinEmbed.obj \ + $(TMPDIR)\tkWinFont.obj \ + $(TMPDIR)\tkWinImage.obj \ + $(TMPDIR)\tkWinInit.obj \ + $(TMPDIR)\tkWinKey.obj \ + $(TMPDIR)\tkWinMenu.obj \ + $(TMPDIR)\tkWinPixmap.obj \ + $(TMPDIR)\tkWinPointer.obj \ + $(TMPDIR)\tkWinRegion.obj \ + $(TMPDIR)\tkWinScrlbr.obj \ + $(TMPDIR)\tkWinSend.obj \ + $(TMPDIR)\tkWinWindow.obj \ + $(TMPDIR)\tkWinWm.obj \ + $(TMPDIR)\tkWinX.obj \ + $(TMPDIR)\stubs.obj \ + $(TMPDIR)\tk3d.obj \ + $(TMPDIR)\tkArgv.obj \ + $(TMPDIR)\tkAtom.obj \ + $(TMPDIR)\tkBind.obj \ + $(TMPDIR)\tkBitmap.obj \ + $(TMPDIR)\tkButton.obj \ + $(TMPDIR)\tkCanvArc.obj \ + $(TMPDIR)\tkCanvBmap.obj \ + $(TMPDIR)\tkCanvImg.obj \ + $(TMPDIR)\tkCanvLine.obj \ + $(TMPDIR)\tkCanvPoly.obj \ + $(TMPDIR)\tkCanvPs.obj \ + $(TMPDIR)\tkCanvText.obj \ + $(TMPDIR)\tkCanvUtil.obj \ + $(TMPDIR)\tkCanvWind.obj \ + $(TMPDIR)\tkCanvas.obj \ + $(TMPDIR)\tkClipboard.obj \ + $(TMPDIR)\tkCmds.obj \ + $(TMPDIR)\tkColor.obj \ + $(TMPDIR)\tkConfig.obj \ + $(TMPDIR)\tkCursor.obj \ + $(TMPDIR)\tkEntry.obj \ + $(TMPDIR)\tkError.obj \ + $(TMPDIR)\tkEvent.obj \ + $(TMPDIR)\tkFileFilter.obj \ + $(TMPDIR)\tkFocus.obj \ + $(TMPDIR)\tkFont.obj \ + $(TMPDIR)\tkFrame.obj \ + $(TMPDIR)\tkGC.obj \ + $(TMPDIR)\tkGeometry.obj \ + $(TMPDIR)\tkGet.obj \ + $(TMPDIR)\tkGrab.obj \ + $(TMPDIR)\tkGrid.obj \ + $(TMPDIR)\tkImage.obj \ + $(TMPDIR)\tkImgBmap.obj \ + $(TMPDIR)\tkImgGIF.obj \ + $(TMPDIR)\tkImgPPM.obj \ + $(TMPDIR)\tkImgPhoto.obj \ + $(TMPDIR)\tkImgUtil.obj \ + $(TMPDIR)\tkListbox.obj \ + $(TMPDIR)\tkMacWinMenu.obj \ + $(TMPDIR)\tkMain.obj \ + $(TMPDIR)\tkMenu.obj \ + $(TMPDIR)\tkMenubutton.obj \ + $(TMPDIR)\tkMenuDraw.obj \ + $(TMPDIR)\tkMessage.obj \ + $(TMP_DIR)\tkPanedWindow.obj \ + $(TMPDIR)\tkObj.obj \ + $(TMPDIR)\tkOldConfig.obj \ + $(TMPDIR)\tkOption.obj \ + $(TMPDIR)\tkPack.obj \ + $(TMPDIR)\tkPlace.obj \ + $(TMPDIR)\tkPointer.obj \ + $(TMPDIR)\tkRectOval.obj \ + $(TMPDIR)\tkScale.obj \ + $(TMPDIR)\tkScrollbar.obj \ + $(TMPDIR)\tkSelect.obj \ + $(TMPDIR)\tkText.obj \ + $(TMPDIR)\tkTextBTree.obj \ + $(TMPDIR)\tkTextDisp.obj \ + $(TMPDIR)\tkTextImage.obj \ + $(TMPDIR)\tkTextIndex.obj \ + $(TMPDIR)\tkTextMark.obj \ + $(TMPDIR)\tkTextTag.obj \ + $(TMPDIR)\tkTextWind.obj \ + $(TMPDIR)\tkTrig.obj \ + $(TMPDIR)\tkUtil.obj \ + $(TMPDIR)\tkVisual.obj \ + $(TMPDIR)\tkStubInit.obj \ + $(TMPDIR)\tkWindow.obj + +# Maintenance hint: Please have multiple members of TKSTUBOBJS be separated +# by exactly one ' ' (see below the rule for making TKSTUBLIB) +TKSTUBOBJS = $(TMPDIR)\tkStubLib.obj + +WINDIR = $(ROOT)\win +GENERICDIR = $(ROOT)\generic +XLIBDIR = $(ROOT)\xlib +BITMAPDIR = $(ROOT)\bitmaps +TCLLIBDIR = $(TCLDIR)\win\$(OUTDIRNAME) +RCDIR = $(WINDIR)\rc + +TK_INCLUDES = -I$(WINDIR) -I$(GENERICDIR) -I$(BITMAPDIR) -I$(XLIBDIR) \ + -I$(TCLDIR)\generic -I$(TCLDIR)\win + +TK_DEFINES = -D__WIN32__ $(DEBUGDEFINES) $(THREADDEFINES) SUPPORT_CONFIG_EMBEDDED + +###################################################################### +# Compile flags +###################################################################### + +!IF "$(NODEBUG)" == "1" +# these macros cause maximum optimization and no symbols +cdebug = -v- -vi- -O2 -D_DEBUG +!ELSE +# these macros enable debugging +cdebug = -k -Od -r- -v -vi- -y +!ENDIF + +SYSDEFINES = _MT;NO_STRICT;_NO_VCL + +# declarations common to all compiler options +cbase = -3 -a4 -c -g0 -tWM -Ve -Vx -X- +WARNINGS = -w-rch -w-pch -w-par -w-dup -w-pro -w-dpu + +ccons = -tWC + +CFLAGS = $(cdebug) $(cbase) $(WARNINGS) -D$(SYSDEFINES) + +CON_CFLAGS = $(CFLAGS) $(TK_DEFINES) $(include32) $(ccons) +WISH_CFLAGS = $(CFLAGS) $(include32) $(TK_INCLUDES) $(TK_DEFINES) +TK_CFLAGS = $(CFLAGS) $(include32) $(TK_INCLUDES) $(TK_DEFINES) \ + -DUSE_TCL_STUBS + +###################################################################### +# Link flags +###################################################################### + +!IF "$(NODEBUG)" == "1" +ldebug = +!ELSE +ldebug = -v +!ENDIF + +# declarations common to all linker options +LNFLAGS = -D"" -Gn -I$(TMPDIR) -x $(ldebug) $(libpath32) +# -Gi: create lib file (is -Gl in doc) +# -aa: Windows app, -ap: Windows console app +LNFLAGS_DLL = -ap -Gi -Tpd +LNFLAGS_CONS = -ap -Tpe +LNFLAGS_GUI = -aa -Tpe + +LNLIBS = import32 cw32mt + + +###################################################################### +# Project specific targets +###################################################################### + +all: setup $(WISH) $(CAT32) +install: install-binaries install-libraries +plugin: setup $(TKPLUGINDLL) $(WISHP) +tktest: setup $(TKTEST) $(CAT32) + +# Maintenance hint: We want to set environment variables before calling tktest. +# If we do this in the form of normal commands, they will not persist up to +# the call of tktest. Therfore we put all commands wanted into a batch file. +# The normal way of using 'echo >x.bat' and 'echo >>x.bat' does not work here +# because we cannot write '... > tktest.txt' this way. Hence this advanced +# form of loop hopping: +# - Have MAKE produce a temporary file with the content we want. +# - Use it as input to the COPY command to produce a batch file. +# - Run the batch file and be happy. +# +test: setup $(TKTEST) $(TKLIB) $(CAT32) + copy &&! + set TCL_LIBRARY=$(TCLDIR)/library + set PATH=$(TCLDIR)\win\$(TMPDIRNAME);$(PATH) + $(TKTEST) $(ROOT)/tests/all.tcl > tktest.txt +! _test.bat + _test.bat +# del _test.bat + +runtest: setup $(TKTEST) $(TKLIB) $(CAT32) + echo set TCL_LIBRARY=$(TCLDIR)/library > _test2.bat + echo set PATH=$(TCLDIR)\win\$(TMPDIRNAME);$(PATH) >> _test2.bat + echo $(TKTEST) >> _test2.bat + _test2.bat +# del _test2.bat + +console-wish : all $(WISHC) + +stubs: + $(TCLDIR)\win\$(TMPDIRNAME)\tclsh$(VERSION)$(DBGX) \ + $(TCLDIR)\tools\genStubs.tcl $(GENERICDIR) \ + $(GENERICDIR)\tk.decls $(GENERICDIR)\tkInt.decls + +setup: + @mkd $(TMPDIR) + @mkd $(OUTDIR) + +install-binaries: + @mkd "$(BIN_INSTALL_DIR)" + copy $(TKDLL) "$(BIN_INSTALL_DIR)" + copy $(WISH) "$(BIN_INSTALL_DIR)" + @mkd "$(LIB_INSTALL_DIR)" + copy $(TKLIB) "$(LIB_INSTALL_DIR)" + +install-libraries: + @mkd "$(INCLUDE_INSTALL_DIR)" + @mkd "$(INCLUDE_INSTALL_DIR)\X11" + copy "$(GENERICDIR)\tk.h" "$(INCLUDE_INSTALL_DIR)" + copy "$(GENERICDIR)\tkDecls.h" "$(INCLUDE_INSTALL_DIR)" + copy "$(GENERICDIR)\tkPlatDecls.h" "$(INCLUDE_INSTALL_DIR)" + copy "$(GENERICDIR)\tkIntXlibDecls.h" "$(INCLUDE_INSTALL_DIR)" + xcopy "$(XLIBDIR)\X11\*.h" "$(INCLUDE_INSTALL_DIR)\X11" + @mkd "$(SCRIPT_INSTALL_DIR)" + @mkd "$(SCRIPT_INSTALL_DIR)\images" + @mkd "$(SCRIPT_INSTALL_DIR)\demos" + @mkd "$(SCRIPT_INSTALL_DIR)\demos\images" + @mkd "$(SCRIPT_INSTALL_DIR)\msgs" + xcopy "$(ROOT)\library" "$(SCRIPT_INSTALL_DIR)" + xcopy "$(ROOT)\library\images" "$(SCRIPT_INSTALL_DIR)\images" + xcopy "$(ROOT)\library\demos" "$(SCRIPT_INSTALL_DIR)\demos" + xcopy "$(ROOT)\library\demos\images" "$(SCRIPT_INSTALL_DIR)\demos\images" + xcopy "$(ROOT)\library\msgs" "$(SCRIPT_INSTALL_DIR)\msgs" + +$(TKLIB): $(TKDLL) $(TKSTUBLIB) + +# Maintenance hint: The macro puts a '+-' before the first member of +# TKSTUBOBJS, than replaces any ' ' with ' +-' - together putting '+-' in +# front of any member of TKSTUBOBJS (provided, they are separated in their +# defintion by just one space). +# +# The first time you *make* this target, you will get a warning +# tkStubLib not found in library +# This is (probably) because of the '-' option, telling TLIB to remove +# 'tkStubLib' when it does not yet exist. Forcing a re-make when it already +# exists avoids this warning. +# +$(TKSTUBLIB): $(TKSTUBOBJS) + $(lib32) $@ +-$(TKSTUBOBJS: = +-) + +# $(lib32) $@ @&&! +#+-$(TKSTUBOBJS: = &^ +#+-) +#! + +$(TKDLL): $(TKOBJS) $(TMPDIR)\tk.res + $(link32) $(ldebug) $(LNFLAGS) $(LNFLAGS_DLL) $(TOOLS32)\lib\c0d32 @&&! + $(TKOBJS), $@, -x, $(LNLIBS) $(TCLLIBDIR)\$(TCLSTUBLIB),, $(TMPDIR)\tk.res +! + +$(TKPLUGINLIB): $(TKPLUGINDLL) + +#$(TKPLUGINDLL): $(TKOBJS) $(TMPDIR)\tk.res +# $(link32) $(ldebug) $(dlllflags) \ +# -out:$@ $(TMPDIR)\tk.res $(TCLLIBDIR)\$(TCLPLUGINLIB) \ +# $(guilibsdll) @<< +# $(TKOBJS) +#<< + +$(WISH): $(WISHOBJS) $(TKLIB) $(TMPDIR)\wish.res + $(link32) $(ldebug) -S:2400000 $(LNFLAGS) $(LNFLAGS_GUI) $(TOOLS32)\lib\c0x32 @&&! + $(WISHOBJS), $@, -x, $(LNLIBS) $(TCLLIBDIR)\$(TCLLIB) $(TKLIB),, $(TMPDIR)\wish.res +! + +$(WISHC): $(WISHOBJS) $(TKLIB) $(TMPDIR)\wish.res + $(link32) $(ldebug) -S:2400000 $(LNFLAGS) $(LNFLAGS_CONS) $(TOOLS32)\lib\c0x32 @&&! + $(WISHOBJS), $@, -x, $(LNLIBS) $(TCLLIBDIR)\$(TCLLIB) $(TKLIB),, $(TMPDIR)\wish.res +! + +$(WISHP): $(WISHOBJS) $(TKPLUGINLIB) $(TMPDIR)\wish.res + $(link32) $(ldebug) $(guilflags) $(TMPDIR)\wish.res -out:$@ \ + $(guilibsdll) $(TCLLIBDIR)\$(TCLPLUGINLIB) \ + $(TKPLUGINLIB) $(WISHOBJS) + +$(TKTEST): $(TKTESTOBJS) $(TKLIB) $(TMPDIR)\wish.res + $(link32) $(ldebug) -S:2400000 $(LNFLAGS) $(LNFLAGS_GUI) $(TOOLS32)\lib\c0x32 @&&! + $(TKTESTOBJS), $@, -x, $(LNLIBS) $(TCLLIBDIR)\$(TCLLIB) $(TKLIB),, $(TMPDIR)\wish.res +! +# $(link32) $(ldebug) $(guilflags) $(TMPDIR)\wish.res -out:$@ \ +# $(guilibsdll) $(TCLLIBDIR)\$(TCLLIB) $(TKLIB) $(TKTESTOBJS) + +#$(CAT32): $(TCLDIR)\win\cat.c +# $(cc32) $(CON_CFLAGS) -o$(TMPDIR)\cat.obj $? +# $(link32) $(conlflags) -out:$@ -stack:16384 $(TMPDIR)\cat.obj $(conlibs) + +$(CAT32): $(TCLDIR)\win\cat.c + $(cc32) $(CONS_CFLAGS) -o$(TMPDIR)\cat.obj $? + $(link32) $(ldebug) $(LNFLAGS) $(LNFLAGS_CONS) $(TOOLS32)\lib\c0x32 \ + $(TMPDIR)\cat.obj, $@, -x, $(LNLIBS),, + +# +# Regenerate the stubs files. +# + +genstubs: + tclsh$(VERSION) $(TCLDIR)\tools\genStubs.tcl $(GENERICDIR) \ + $(GENERICDIR)\tk.decls $(GENERICDIR)\tkInt.decls + +# +# Special case object file targets +# + +$(TMPDIR)\testMain.obj: $(WINDIR)\winMain.c + $(cc32) $(WISH_CFLAGS) -DTK_TEST -o$@ $? + +$(TMPDIR)\tkTest.obj: $(GENERICDIR)\tkTest.c + $(cc32) $(WISH_CFLAGS) -o$@ $? + +$(TMPDIR)\tkOldTest.obj: $(GENERICDIR)\tkOldTest.c + $(cc32) $(WISH_CFLAGS) -o$@ $? + +$(TMPDIR)\tkWinTest.obj: $(WINDIR)\tkWinTest.c + $(cc32) $(WISH_CFLAGS) -o$@ $? + +$(TMPDIR)\tkSquare.obj: $(GENERICDIR)\tkSquare.c + $(cc32) $(WISH_CFLAGS) -o$@ $? + +$(TMPDIR)\winMain.obj: $(WINDIR)\winMain.c + $(cc32) $(WISH_CFLAGS) -o$@ $? + +$(TMPDIR)\tkStubLib.obj : $(GENERICDIR)\tkStubLib.c + $(cc32) $(TK_CFLAGS) -DSTATIC_BUILD -o$@ $? + +# +# Implicit rules +# + +{$(XLIBDIR)}.c{$(TMPDIR)}.obj: + $(cc32) -DDLL_BUILD -DBUILD_tk $(TK_CFLAGS) -o$@ $< + +{$(GENERICDIR)}.c{$(TMPDIR)}.obj: + $(cc32) -DDLL_BUILD -DBUILD_tk $(TK_CFLAGS) -o$@ $< + +{$(WINDIR)}.c{$(TMPDIR)}.obj: + $(cc32) -DDLL_BUILD -DBUILD_tk $(TK_CFLAGS) -o$@ $< + +{$(ROOT)\unix}.c{$(TMPDIR)}.obj: + $(cc32) -DDLL_BUILD -DBUILD_tk $(TK_CFLAGS) -o$@ $< + +{$(RCDIR)}.rc{$(TMPDIR)}.res: + $(rc32) -I"$(GENERICDIR)" -I"$(TOOLS32)\include" -I"$(TCLDIR)\generic" \ + -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + +clean: + -@del $(OUTDIR)\*.exp + -@del $(OUTDIR)\*.lib + -@del $(OUTDIR)\*.dll + -@del $(OUTDIR)\*.exe + -@del $(OUTDIR)\*.pdb + -@del $(TMPDIR)\*.pch + -@del $(TMPDIR)\*.obj + -@del $(TMPDIR)\*.res + -@del $(TMPDIR)\*.exe + -@rmd $(OUTDIR) + -@rmd $(TMPDIR) + +# dependencies + +$(TMPDIR)\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)/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)/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 + + diff --git a/win/makefile.vc b/win/makefile.vc index 8fbe917..4b9475f 100644 --- a/win/makefile.vc +++ b/win/makefile.vc @@ -1,1028 +1,1028 @@ -#------------------------------------------------------------- -*- 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 -# VCINSTALLDIR) or with the MS Platform SDK (MSSDK or WindowsSDKDir) -!if !defined(MSDEVDIR) && !defined(MSVCDIR) && !defined(VCINSTALLDIR) && !defined(MSSDK) && !defined(WINDOWSSDKDIR) -MSG = ^ -You need to run vcvars32.bat from Developer Studio or setenv.bat from the^ -Platform SDK first to setup the environment. Jump to this line to read^ -the build instructions. -!error $(MSG) -!endif - -#------------------------------------------------------------------------------ -# HOW TO USE this makefile: -# -# 1) It is now necessary to have MSVCDir, MSDevDir or MSSDK set in the -# environment. This is used as a check to see if vcvars32.bat had been -# run prior to running nmake or during the installation of Microsoft -# Visual C++, MSVCDir had been set globally and the PATH adjusted. -# Either way is valid. -# -# You'll need to run vcvars32.bat contained in the MsDev's vc(98)/bin -# directory to setup the proper environment, if needed, for your -# current setup. This is a needed bootstrap requirement and allows the -# swapping of different environments to be easier. -# -# 2) To use the Platform SDK (not expressly needed), run setenv.bat after -# vcvars32.bat according to the instructions for it. This can also -# turn on the 64-bit compiler, if your SDK has it. -# -# 3) Targets are: -# 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. -# 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. -# 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= -# Sets the location for where to find the Tcl headers and -# libraries. The install point is assumed when not specified. -# Tk does need the source directory, though. Tk comes very close -# to not needing the sources, but does, in fact, require them. -# -# INSTALLDIR= -# Sets where to install Tcl from the built binaries. -# C:\Progra~1\Tcl is assumed when not specified. -# -# 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. -# -# 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. -# 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. -# 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=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. -# -# compdbg = Enables byte compilation logging. -# memdbg = Enables the debugging memory allocator. -# -# CHECKS=64bit,fullwarn,nodep,none -# Sets special macros for checking compatability. -# -# 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. If the CPU environment variable has been -# set (ie: recent Platform SDK) then MACHINE is set from CPU. -# -# TMP_DIR= -# OUT_DIR= -# Hooks to allow the intermediate and output directories to be -# changed. $(OUT_DIR) is assumed to be -# $(BINROOT)\(Release|Debug) based on if symbols are requested. -# $(TMP_DIR) will de $(OUT_DIR)\ by default. -# -# TESTPAT= -# Reads the tests requested to be run from this file. -# -# 5) Examples: -# -# Basic syntax of calling nmake looks like this: -# nmake [-nologo] -f makefile.vc [target|macrodef [target|macrodef] [...]] -# -# Standard (no frills) -# c:\tk_src\win\>c:\progra~1\micros~1\vc98\bin\vcvars32.bat -# Setting environment for using Microsoft Visual C++ tools. -# c:\tk_src\win\>nmake -f makefile.vc release -# c:\tk_src\win\>nmake -f makefile.vc install INSTALLDIR=c:\progra~1\tcl -# -# Building for Win64 -# c:\tk_src\win\>c:\progra~1\micros~1\vc98\bin\vcvars32.bat -# Setting environment for using Microsoft Visual C++ tools. -# c:\tk_src\win\>c:\progra~1\platfo~1\setenv.bat /pre64 /RETAIL -# Targeting Windows pre64 RETAIL -# c:\tk_src\win\>nmake -f makefile.vc MACHINE=IA64 -# -#------------------------------------------------------------------------------ -#============================================================================== -############################################################################### - - -# //==================================================================\\ -# >>[ -> Do not modify below this line. <- ]<< -# >>[ Please, use the commandline macros to modify how Tcl is built. ]<< -# >>[ If you need more features, send us a patch for more macros. ]<< -# \\==================================================================// - - -############################################################################### -#============================================================================== -#------------------------------------------------------------------------------ - -!if !exist("makefile.vc") -MSG = ^ -You must run this makefile only from the directory it is in.^ -Please `cd` to its location first. -!error $(MSG) -!endif - -PROJECT = tk -!include "rules.vc" - -!if $(TCLINSTALL) -!message *** Warning: Tk requires the source distribution of Tcl to build from, -!message *** at this time, sorry. Please set the TCLDIR macro to point to the -!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 -WISHNAMEPREFIX = wish - -BINROOT = $(MAKEDIR) # originally . -ROOT = $(MAKEDIR)\.. # originally .. - -TK_LIBRARY = $(ROOT)\library - -TKIMPLIB = "$(OUT_DIR)\$(PROJECT)$(TK_VERSION)$(SUFX).lib" -TKLIBNAME = $(PROJECT)$(TK_VERSION)$(SUFX).$(EXT) -TKLIB = "$(OUT_DIR)\$(TKLIBNAME)" - -TKSTUBLIBNAME = $(STUBPREFIX)$(TK_VERSION).lib -TKSTUBLIB = "$(OUT_DIR)\$(TKSTUBLIBNAME)" - -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" - -LIB_INSTALL_DIR = $(_INSTALLDIR)\lib -BIN_INSTALL_DIR = $(_INSTALLDIR)\bin -DOC_INSTALL_DIR = $(_INSTALLDIR)\doc -SCRIPT_INSTALL_DIR = $(_INSTALLDIR)\lib\$(PROJECT)$(TK_DOTVERSION) -INCLUDE_INSTALL_DIR = $(_INSTALLDIR)\include - -WISHOBJS = \ - $(TMP_DIR)\winMain.obj \ -!if $(TCL_USE_STATIC_PACKAGES) - $(TCLDDELIB) \ - $(TCLREGLIB) \ -!endif - $(TMP_DIR)\wish.res - -TKTESTOBJS = \ - $(TMP_DIR)\testMain.obj \ - $(TMP_DIR)\tkSquare.obj \ - $(TMP_DIR)\tkTest.obj \ - $(TMP_DIR)\tkOldTest.obj \ - $(TMP_DIR)\tkWinTest.obj - -XLIBOBJS = \ - $(TMP_DIR)\xcolors.obj \ - $(TMP_DIR)\xdraw.obj \ - $(TMP_DIR)\xgc.obj \ - $(TMP_DIR)\ximage.obj \ - $(TMP_DIR)\xutil.obj - -TKOBJS = \ - $(TMP_DIR)\tkConsole.obj \ - $(TMP_DIR)\tkUnixMenubu.obj \ - $(TMP_DIR)\tkUnixScale.obj \ - $(XLIBOBJS) \ - $(TMP_DIR)\tkWin3d.obj \ - $(TMP_DIR)\tkWin32Dll.obj \ - $(TMP_DIR)\tkWinButton.obj \ - $(TMP_DIR)\tkWinClipboard.obj \ - $(TMP_DIR)\tkWinColor.obj \ - $(TMP_DIR)\tkWinConfig.obj \ - $(TMP_DIR)\tkWinCursor.obj \ - $(TMP_DIR)\tkWinDialog.obj \ - $(TMP_DIR)\tkWinDraw.obj \ - $(TMP_DIR)\tkWinEmbed.obj \ - $(TMP_DIR)\tkWinFont.obj \ - $(TMP_DIR)\tkWinImage.obj \ - $(TMP_DIR)\tkWinInit.obj \ - $(TMP_DIR)\tkWinKey.obj \ - $(TMP_DIR)\tkWinMenu.obj \ - $(TMP_DIR)\tkWinPixmap.obj \ - $(TMP_DIR)\tkWinPointer.obj \ - $(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 \ - $(TMP_DIR)\stubs.obj \ - $(TMP_DIR)\tk3d.obj \ - $(TMP_DIR)\tkArgv.obj \ - $(TMP_DIR)\tkAtom.obj \ - $(TMP_DIR)\tkBind.obj \ - $(TMP_DIR)\tkBitmap.obj \ - $(TMP_DIR)\tkButton.obj \ - $(TMP_DIR)\tkCanvArc.obj \ - $(TMP_DIR)\tkCanvBmap.obj \ - $(TMP_DIR)\tkCanvImg.obj \ - $(TMP_DIR)\tkCanvLine.obj \ - $(TMP_DIR)\tkCanvPoly.obj \ - $(TMP_DIR)\tkCanvPs.obj \ - $(TMP_DIR)\tkCanvText.obj \ - $(TMP_DIR)\tkCanvUtil.obj \ - $(TMP_DIR)\tkCanvWind.obj \ - $(TMP_DIR)\tkCanvas.obj \ - $(TMP_DIR)\tkClipboard.obj \ - $(TMP_DIR)\tkCmds.obj \ - $(TMP_DIR)\tkColor.obj \ - $(TMP_DIR)\tkConfig.obj \ - $(TMP_DIR)\tkCursor.obj \ - $(TMP_DIR)\tkEntry.obj \ - $(TMP_DIR)\tkError.obj \ - $(TMP_DIR)\tkEvent.obj \ - $(TMP_DIR)\tkFileFilter.obj \ - $(TMP_DIR)\tkFocus.obj \ - $(TMP_DIR)\tkFont.obj \ - $(TMP_DIR)\tkFrame.obj \ - $(TMP_DIR)\tkGC.obj \ - $(TMP_DIR)\tkGeometry.obj \ - $(TMP_DIR)\tkGet.obj \ - $(TMP_DIR)\tkGrab.obj \ - $(TMP_DIR)\tkGrid.obj \ - $(TMP_DIR)\tkImage.obj \ - $(TMP_DIR)\tkImgBmap.obj \ - $(TMP_DIR)\tkImgGIF.obj \ - $(TMP_DIR)\tkImgPPM.obj \ - $(TMP_DIR)\tkImgPhoto.obj \ - $(TMP_DIR)\tkImgUtil.obj \ - $(TMP_DIR)\tkListbox.obj \ - $(TMP_DIR)\tkMacWinMenu.obj \ - $(TMP_DIR)\tkMain.obj \ - $(TMP_DIR)\tkMenu.obj \ - $(TMP_DIR)\tkMenubutton.obj \ - $(TMP_DIR)\tkMenuDraw.obj \ - $(TMP_DIR)\tkMessage.obj \ - $(TMP_DIR)\tkPanedWindow.obj \ - $(TMP_DIR)\tkObj.obj \ - $(TMP_DIR)\tkOldConfig.obj \ - $(TMP_DIR)\tkOption.obj \ - $(TMP_DIR)\tkPack.obj \ - $(TMP_DIR)\tkPlace.obj \ - $(TMP_DIR)\tkPointer.obj \ - $(TMP_DIR)\tkRectOval.obj \ - $(TMP_DIR)\tkScale.obj \ - $(TMP_DIR)\tkScrollbar.obj \ - $(TMP_DIR)\tkSelect.obj \ - $(TMP_DIR)\tkStyle.obj \ - $(TMP_DIR)\tkText.obj \ - $(TMP_DIR)\tkTextBTree.obj \ - $(TMP_DIR)\tkTextDisp.obj \ - $(TMP_DIR)\tkTextImage.obj \ - $(TMP_DIR)\tkTextIndex.obj \ - $(TMP_DIR)\tkTextMark.obj \ - $(TMP_DIR)\tkTextTag.obj \ - $(TMP_DIR)\tkTextWind.obj \ - $(TMP_DIR)\tkTrig.obj \ - $(TMP_DIR)\tkUndo.obj \ - $(TMP_DIR)\tkUtil.obj \ - $(TMP_DIR)\tkVisual.obj \ - $(TMP_DIR)\tkStubInit.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)\ttkStubLib.obj - - -WINDIR = $(ROOT)\win -GENERICDIR = $(ROOT)\generic -XLIBDIR = $(ROOT)\xlib -TTKDIR = $(ROOT)\generic\ttk -BITMAPDIR = $(ROOT)\bitmaps -DOCDIR = $(ROOT)\doc -RCDIR = $(WINDIR)\rc - -TK_INCLUDES = -I"$(WINDIR)" -I"$(GENERICDIR)" -I"$(BITMAPDIR)" -I"$(XLIBDIR)" \ - $(TCL_INCLUDES) - -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 -#--------------------------------------------------------------------- - -!if !$(DEBUG) -!if $(OPTIMIZING) -### This cranks the optimization level to maximize speed -### 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) -!else -cdebug = -Zi -WX $(DEBUGFLAGS) -!endif - -### Declarations common to all compiler options -cwarn = $(WARNINGS) -D _CRT_SECURE_NO_DEPRECATE -D _CRT_NONSTDC_NO_DEPRECATE -cflags = -nologo -c $(COMPILERFLAGS) $(cwarn) -Fp$(TMP_DIR)^\ - -!if $(MSVCRT) -!if $(DEBUG) && !$(UNCHECKED) -crt = -MDd -!else -crt = -MD -!endif -!else -!if $(DEBUG) && !$(UNCHECKED) -crt = -MTd -!else -crt = -MT -!endif -!endif - -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 -#--------------------------------------------------------------------- - -!if $(DEBUG) -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 $(PROFILE) -lflags = $(lflags) -profile -!endif - -!if $(ALIGN98_HACK) && !$(STATIC_BUILD) -### Align sections for PE size savings. -lflags = $(lflags) -opt:nowin98 -!else if !$(ALIGN98_HACK) && $(STATIC_BUILD) -### Align sections for speed in loading by choosing the virtual page size. -lflags = $(lflags) -align:4096 -!endif - -!if $(LOIMPACT) -lflags = $(lflags) -ws:aggressive -!endif - -dlllflags = $(lflags) -dll -conlflags = $(lflags) -subsystem:console -guilflags = $(lflags) -subsystem:windows - -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 -!endif -guilibs = $(baselibs) gdi32.lib - - -#--------------------------------------------------------------------- -# TkTest flags -#--------------------------------------------------------------------- - -!if "$(TESTPAT)" != "" -TESTFLAGS = $(TESTFLAGS) -file $(TESTPAT) -!endif - - -#--------------------------------------------------------------------- -# Project specific targets -#--------------------------------------------------------------------- - -release: setup $(TKSTUBLIB) $(WISH) -all: release $(CAT32) -core: setup $(TKSTUBLIB) $(TKLIB) -cwish: $(WISHC) -install: install-binaries install-libraries install-docs -tktest: setup $(TKTEST) $(CAT32) - - -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) -!else - @set PATH=$(_TCLDIR)\win\$(BUILDDIRTOP);$(PATH) -!endif -!if "$(OS)" == "Windows_NT" || "$(MSVCDIR)" == "IDE" - $(DEBUGGER) $(TKTEST) "$(ROOT:\=/)/tests/ttk/all.tcl" $(TESTFLAGS) | $(CAT32) -!else - $(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 TCLLIBPATH= -!if $(TCLINSTALL) - @set PATH=$(_TCLDIR)\bin;$(PATH) -!else - @set PATH=$(_TCLDIR)\win\$(BUILDDIRTOP);$(PATH) -!endif - $(DEBUGGER) $(TKTEST) - -rundemo: 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 - $(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) -!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) - -!if !$(STATIC_BUILD) -$(TKIMPLIB): $(TKLIB) -!endif - -$(TKLIB): $(TKOBJS) -!if $(STATIC_BUILD) - $(lib32) -nologo -out:$@ @<< -$** -<< -!else - $(link32) $(dlllflags) -base:@$(COFFBASE),tk -out:$@ $(guilibs) \ - $(TCLSTUBLIB) @<< -$** -<< - $(_VC_MANIFEST_EMBED_DLL) - -@del $*.exp -!endif - - -$(TKSTUBLIB): $(TKSTUBOBJS) - $(lib32) -nologo -nodefaultlib -out:$@ $** - - -$(WISH): $(WISHOBJS) $(TKIMPLIB) - $(link32) $(guilflags) -stack:2300000 -out:$@ $(guilibs) $(TCLIMPLIB) $** - $(_VC_MANIFEST_EMBED_EXE) - - -$(WISHC): $(WISHOBJS) $(TKIMPLIB) - $(link32) $(conlflags) -stack:2300000 -out:$@ $(guilibs) $(TCLIMPLIB) $** - $(_VC_MANIFEST_EMBED_EXE) - - -$(TKTEST): $(TKTESTOBJS) $(TKIMPLIB) - $(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) - -#--------------------------------------------------------------------- -# 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 - - -#--------------------------------------------------------------------- -# Build the Windows HTML help file. -#--------------------------------------------------------------------- - -# 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) - -$(CHMFILE): $(DOCDIR)\* - @$(TCLSH) $(TCLTOOLSDIR)\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)$(TK_VERSION) -HELPFILE = $(OUT_DIR)\$(HLPBASE).hlp -HELPCNT = $(OUT_DIR)\$(HLPBASE).cnt -DOCTMP_DIR = $(OUT_DIR)\$(PROJECT)_docs -HELPRTF = $(DOCTMP_DIR)\$(PROJECT).rtf -MAN2HELP = $(DOCTMP_DIR)\man2help.tcl -MAN2HELP2 = $(DOCTMP_DIR)\man2help2.tcl -INDEX = $(DOCTMP_DIR)\index.tcl -BMP = $(DOCTMP_DIR)\lamp.bmp -BMP_NOPATH = lamp.bmp -MAN2TCL = $(DOCTMP_DIR)\man2tcl.exe - -winhelp: docsetup $(HELPFILE) - -docsetup: - @if not exist $(DOCTMP_DIR)\nul mkdir $(DOCTMP_DIR) - -$(MAN2HELP) $(MAN2HELP2) $(INDEX): $(TCLTOOLSDIR)\$$(@F) - $(CPY) $(TCLTOOLSDIR)\$(@F) $(@D) - -$(BMP): - $(CPY) $(WINDIR)\rc\$(@F) $(@D) - -$(HELPFILE): $(HELPRTF) $(BMP) - cd $(DOCTMP_DIR) - start /wait hcrtf.exe -x <<$(PROJECT).hpj -[OPTIONS] -COMPRESS=12 Hall Zeck -LCID=0x409 0x0 0x0 ; English (United States) -TITLE=Tk Reference Manual -BMROOT=. -CNT=$(@B).cnt -HLP=$(@B).hlp - -[FILES] -$(PROJECT).rtf - -[WINDOWS] -main="Tcl/Tk Reference Manual",,27648,(r15263976),(r4227327) - -[CONFIG] -BrowseButtons() -CreateButton(1, "Web", ExecFile("http://www.tcl.tk")) -CreateButton(2, "SF", ExecFile("http://sf.net/projects/tcl")) -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)" - -$(MAN2TCL): $(TCLTOOLSDIR)\$$(@B).c - $(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) $(TK_VERSION) $(DOCDIR:\=/) - -install-docs: -!if exist($(HELPFILE)) - $(CPY) "$(HELPFILE)" "$(DOC_INSTALL_DIR)\" - $(CPY) "$(HELPCNT)" "$(DOC_INSTALL_DIR)\" - $(TCLSH) << -puts "Installing $(PROJECT)'s helpfile contents into Tcl's ..." -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 == $(TK_VERSION)} { - puts "Already installed." - exit - } else { - # do something here logical to remove (or replace) it. - puts "$$ver != $(TK_VERSION), unfinished code path, die, die!" - exit 1 - } - } -} -close $$f -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$(TK_VERSION).hlp -!endif - -#--------------------------------------------------------------------- -# Special case object file targets -#--------------------------------------------------------------------- - -$(TMP_DIR)\testMain.obj: $(WINDIR)\winMain.c - $(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$@ $? - -$(TMP_DIR)\tkSquare.obj: $(GENERICDIR)\tkSquare.c - $(cc32) $(WISH_CFLAGS) -Fo$@ $? - -$(TMP_DIR)\winMain.obj: $(WINDIR)\winMain.c - $(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) $(STUB_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 -<< - -#--------------------------------------------------------------------- -# 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. -#--------------------------------------------------------------------- - -depend: -!if !exist($(TCLSH)) - @echo Build tclsh first! -!else - 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 - -!if exist("$(OUT_DIR)\depend.mk") -!include "$(OUT_DIR)\depend.mk" -!message *** Dependency rules in use. -!else -!message *** Dependency rules are not being used. -!endif - -### add a spacer in the output -!message - -#--------------------------------------------------------------------- -# Implicit rules -#--------------------------------------------------------------------- - -{$(XLIBDIR)}.c{$(TMP_DIR)}.obj:: - $(cc32) -DBUILD_tk $(TK_CFLAGS) -Fo$(TMP_DIR)\ @<< -$< -<< - -{$(GENERICDIR)}.c{$(TMP_DIR)}.obj:: - $(cc32) -DBUILD_tk $(TK_CFLAGS) -Fo$(TMP_DIR)\ @<< -$< -<< - -{$(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)\ @<< -$< -<< - -{$(ROOT)\unix}.c{$(TMP_DIR)}.obj:: - $(cc32) -DBUILD_tk $(TK_CFLAGS) -Fo$(TMP_DIR)\ @<< -$< -<< - -{$(RCDIR)}.rc{$(TMP_DIR)}.res: - $(rc32) -fo $@ -r -i "$(GENERICDIR)" -i "$(TMP_DIR)" $(TCL_INCLUDES) \ - -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 - - -#--------------------------------------------------------------------- -# Installation. -#--------------------------------------------------------------------- - -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 - -#" - -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\" - -#" - -#--------------------------------------------------------------------- -# 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) +#------------------------------------------------------------- -*- 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 +# VCINSTALLDIR) or with the MS Platform SDK (MSSDK or WindowsSDKDir) +!if !defined(MSDEVDIR) && !defined(MSVCDIR) && !defined(VCINSTALLDIR) && !defined(MSSDK) && !defined(WINDOWSSDKDIR) +MSG = ^ +You need to run vcvars32.bat from Developer Studio or setenv.bat from the^ +Platform SDK first to setup the environment. Jump to this line to read^ +the build instructions. +!error $(MSG) +!endif + +#------------------------------------------------------------------------------ +# HOW TO USE this makefile: +# +# 1) It is now necessary to have MSVCDir, MSDevDir or MSSDK set in the +# environment. This is used as a check to see if vcvars32.bat had been +# run prior to running nmake or during the installation of Microsoft +# Visual C++, MSVCDir had been set globally and the PATH adjusted. +# Either way is valid. +# +# You'll need to run vcvars32.bat contained in the MsDev's vc(98)/bin +# directory to setup the proper environment, if needed, for your +# current setup. This is a needed bootstrap requirement and allows the +# swapping of different environments to be easier. +# +# 2) To use the Platform SDK (not expressly needed), run setenv.bat after +# vcvars32.bat according to the instructions for it. This can also +# turn on the 64-bit compiler, if your SDK has it. +# +# 3) Targets are: +# 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. +# 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. +# 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= +# Sets the location for where to find the Tcl headers and +# libraries. The install point is assumed when not specified. +# Tk does need the source directory, though. Tk comes very close +# to not needing the sources, but does, in fact, require them. +# +# INSTALLDIR= +# Sets where to install Tcl from the built binaries. +# C:\Progra~1\Tcl is assumed when not specified. +# +# 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. +# +# 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. +# 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. +# 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=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. +# +# compdbg = Enables byte compilation logging. +# memdbg = Enables the debugging memory allocator. +# +# CHECKS=64bit,fullwarn,nodep,none +# Sets special macros for checking compatability. +# +# 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. If the CPU environment variable has been +# set (ie: recent Platform SDK) then MACHINE is set from CPU. +# +# TMP_DIR= +# OUT_DIR= +# Hooks to allow the intermediate and output directories to be +# changed. $(OUT_DIR) is assumed to be +# $(BINROOT)\(Release|Debug) based on if symbols are requested. +# $(TMP_DIR) will de $(OUT_DIR)\ by default. +# +# TESTPAT= +# Reads the tests requested to be run from this file. +# +# 5) Examples: +# +# Basic syntax of calling nmake looks like this: +# nmake [-nologo] -f makefile.vc [target|macrodef [target|macrodef] [...]] +# +# Standard (no frills) +# c:\tk_src\win\>c:\progra~1\micros~1\vc98\bin\vcvars32.bat +# Setting environment for using Microsoft Visual C++ tools. +# c:\tk_src\win\>nmake -f makefile.vc release +# c:\tk_src\win\>nmake -f makefile.vc install INSTALLDIR=c:\progra~1\tcl +# +# Building for Win64 +# c:\tk_src\win\>c:\progra~1\micros~1\vc98\bin\vcvars32.bat +# Setting environment for using Microsoft Visual C++ tools. +# c:\tk_src\win\>c:\progra~1\platfo~1\setenv.bat /pre64 /RETAIL +# Targeting Windows pre64 RETAIL +# c:\tk_src\win\>nmake -f makefile.vc MACHINE=IA64 +# +#------------------------------------------------------------------------------ +#============================================================================== +############################################################################### + + +# //==================================================================\\ +# >>[ -> Do not modify below this line. <- ]<< +# >>[ Please, use the commandline macros to modify how Tcl is built. ]<< +# >>[ If you need more features, send us a patch for more macros. ]<< +# \\==================================================================// + + +############################################################################### +#============================================================================== +#------------------------------------------------------------------------------ + +!if !exist("makefile.vc") +MSG = ^ +You must run this makefile only from the directory it is in.^ +Please `cd` to its location first. +!error $(MSG) +!endif + +PROJECT = tk +!include "rules.vc" + +!if $(TCLINSTALL) +!message *** Warning: Tk requires the source distribution of Tcl to build from, +!message *** at this time, sorry. Please set the TCLDIR macro to point to the +!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 +WISHNAMEPREFIX = wish + +BINROOT = $(MAKEDIR) # originally . +ROOT = $(MAKEDIR)\.. # originally .. + +TK_LIBRARY = $(ROOT)\library + +TKIMPLIB = "$(OUT_DIR)\$(PROJECT)$(TK_VERSION)$(SUFX).lib" +TKLIBNAME = $(PROJECT)$(TK_VERSION)$(SUFX).$(EXT) +TKLIB = "$(OUT_DIR)\$(TKLIBNAME)" + +TKSTUBLIBNAME = $(STUBPREFIX)$(TK_VERSION).lib +TKSTUBLIB = "$(OUT_DIR)\$(TKSTUBLIBNAME)" + +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" + +LIB_INSTALL_DIR = $(_INSTALLDIR)\lib +BIN_INSTALL_DIR = $(_INSTALLDIR)\bin +DOC_INSTALL_DIR = $(_INSTALLDIR)\doc +SCRIPT_INSTALL_DIR = $(_INSTALLDIR)\lib\$(PROJECT)$(TK_DOTVERSION) +INCLUDE_INSTALL_DIR = $(_INSTALLDIR)\include + +WISHOBJS = \ + $(TMP_DIR)\winMain.obj \ +!if $(TCL_USE_STATIC_PACKAGES) + $(TCLDDELIB) \ + $(TCLREGLIB) \ +!endif + $(TMP_DIR)\wish.res + +TKTESTOBJS = \ + $(TMP_DIR)\testMain.obj \ + $(TMP_DIR)\tkSquare.obj \ + $(TMP_DIR)\tkTest.obj \ + $(TMP_DIR)\tkOldTest.obj \ + $(TMP_DIR)\tkWinTest.obj + +XLIBOBJS = \ + $(TMP_DIR)\xcolors.obj \ + $(TMP_DIR)\xdraw.obj \ + $(TMP_DIR)\xgc.obj \ + $(TMP_DIR)\ximage.obj \ + $(TMP_DIR)\xutil.obj + +TKOBJS = \ + $(TMP_DIR)\tkConsole.obj \ + $(TMP_DIR)\tkUnixMenubu.obj \ + $(TMP_DIR)\tkUnixScale.obj \ + $(XLIBOBJS) \ + $(TMP_DIR)\tkWin3d.obj \ + $(TMP_DIR)\tkWin32Dll.obj \ + $(TMP_DIR)\tkWinButton.obj \ + $(TMP_DIR)\tkWinClipboard.obj \ + $(TMP_DIR)\tkWinColor.obj \ + $(TMP_DIR)\tkWinConfig.obj \ + $(TMP_DIR)\tkWinCursor.obj \ + $(TMP_DIR)\tkWinDialog.obj \ + $(TMP_DIR)\tkWinDraw.obj \ + $(TMP_DIR)\tkWinEmbed.obj \ + $(TMP_DIR)\tkWinFont.obj \ + $(TMP_DIR)\tkWinImage.obj \ + $(TMP_DIR)\tkWinInit.obj \ + $(TMP_DIR)\tkWinKey.obj \ + $(TMP_DIR)\tkWinMenu.obj \ + $(TMP_DIR)\tkWinPixmap.obj \ + $(TMP_DIR)\tkWinPointer.obj \ + $(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 \ + $(TMP_DIR)\stubs.obj \ + $(TMP_DIR)\tk3d.obj \ + $(TMP_DIR)\tkArgv.obj \ + $(TMP_DIR)\tkAtom.obj \ + $(TMP_DIR)\tkBind.obj \ + $(TMP_DIR)\tkBitmap.obj \ + $(TMP_DIR)\tkButton.obj \ + $(TMP_DIR)\tkCanvArc.obj \ + $(TMP_DIR)\tkCanvBmap.obj \ + $(TMP_DIR)\tkCanvImg.obj \ + $(TMP_DIR)\tkCanvLine.obj \ + $(TMP_DIR)\tkCanvPoly.obj \ + $(TMP_DIR)\tkCanvPs.obj \ + $(TMP_DIR)\tkCanvText.obj \ + $(TMP_DIR)\tkCanvUtil.obj \ + $(TMP_DIR)\tkCanvWind.obj \ + $(TMP_DIR)\tkCanvas.obj \ + $(TMP_DIR)\tkClipboard.obj \ + $(TMP_DIR)\tkCmds.obj \ + $(TMP_DIR)\tkColor.obj \ + $(TMP_DIR)\tkConfig.obj \ + $(TMP_DIR)\tkCursor.obj \ + $(TMP_DIR)\tkEntry.obj \ + $(TMP_DIR)\tkError.obj \ + $(TMP_DIR)\tkEvent.obj \ + $(TMP_DIR)\tkFileFilter.obj \ + $(TMP_DIR)\tkFocus.obj \ + $(TMP_DIR)\tkFont.obj \ + $(TMP_DIR)\tkFrame.obj \ + $(TMP_DIR)\tkGC.obj \ + $(TMP_DIR)\tkGeometry.obj \ + $(TMP_DIR)\tkGet.obj \ + $(TMP_DIR)\tkGrab.obj \ + $(TMP_DIR)\tkGrid.obj \ + $(TMP_DIR)\tkImage.obj \ + $(TMP_DIR)\tkImgBmap.obj \ + $(TMP_DIR)\tkImgGIF.obj \ + $(TMP_DIR)\tkImgPPM.obj \ + $(TMP_DIR)\tkImgPhoto.obj \ + $(TMP_DIR)\tkImgUtil.obj \ + $(TMP_DIR)\tkListbox.obj \ + $(TMP_DIR)\tkMacWinMenu.obj \ + $(TMP_DIR)\tkMain.obj \ + $(TMP_DIR)\tkMenu.obj \ + $(TMP_DIR)\tkMenubutton.obj \ + $(TMP_DIR)\tkMenuDraw.obj \ + $(TMP_DIR)\tkMessage.obj \ + $(TMP_DIR)\tkPanedWindow.obj \ + $(TMP_DIR)\tkObj.obj \ + $(TMP_DIR)\tkOldConfig.obj \ + $(TMP_DIR)\tkOption.obj \ + $(TMP_DIR)\tkPack.obj \ + $(TMP_DIR)\tkPlace.obj \ + $(TMP_DIR)\tkPointer.obj \ + $(TMP_DIR)\tkRectOval.obj \ + $(TMP_DIR)\tkScale.obj \ + $(TMP_DIR)\tkScrollbar.obj \ + $(TMP_DIR)\tkSelect.obj \ + $(TMP_DIR)\tkStyle.obj \ + $(TMP_DIR)\tkText.obj \ + $(TMP_DIR)\tkTextBTree.obj \ + $(TMP_DIR)\tkTextDisp.obj \ + $(TMP_DIR)\tkTextImage.obj \ + $(TMP_DIR)\tkTextIndex.obj \ + $(TMP_DIR)\tkTextMark.obj \ + $(TMP_DIR)\tkTextTag.obj \ + $(TMP_DIR)\tkTextWind.obj \ + $(TMP_DIR)\tkTrig.obj \ + $(TMP_DIR)\tkUndo.obj \ + $(TMP_DIR)\tkUtil.obj \ + $(TMP_DIR)\tkVisual.obj \ + $(TMP_DIR)\tkStubInit.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)\ttkStubLib.obj + + +WINDIR = $(ROOT)\win +GENERICDIR = $(ROOT)\generic +XLIBDIR = $(ROOT)\xlib +TTKDIR = $(ROOT)\generic\ttk +BITMAPDIR = $(ROOT)\bitmaps +DOCDIR = $(ROOT)\doc +RCDIR = $(WINDIR)\rc + +TK_INCLUDES = -I"$(WINDIR)" -I"$(GENERICDIR)" -I"$(BITMAPDIR)" -I"$(XLIBDIR)" \ + $(TCL_INCLUDES) + +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 +#--------------------------------------------------------------------- + +!if !$(DEBUG) +!if $(OPTIMIZING) +### This cranks the optimization level to maximize speed +### 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) +!else +cdebug = -Zi -WX $(DEBUGFLAGS) +!endif + +### Declarations common to all compiler options +cwarn = $(WARNINGS) -D _CRT_SECURE_NO_DEPRECATE -D _CRT_NONSTDC_NO_DEPRECATE +cflags = -nologo -c $(COMPILERFLAGS) $(cwarn) -Fp$(TMP_DIR)^\ + +!if $(MSVCRT) +!if $(DEBUG) && !$(UNCHECKED) +crt = -MDd +!else +crt = -MD +!endif +!else +!if $(DEBUG) && !$(UNCHECKED) +crt = -MTd +!else +crt = -MT +!endif +!endif + +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 +#--------------------------------------------------------------------- + +!if $(DEBUG) +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 $(PROFILE) +lflags = $(lflags) -profile +!endif + +!if $(ALIGN98_HACK) && !$(STATIC_BUILD) +### Align sections for PE size savings. +lflags = $(lflags) -opt:nowin98 +!else if !$(ALIGN98_HACK) && $(STATIC_BUILD) +### Align sections for speed in loading by choosing the virtual page size. +lflags = $(lflags) -align:4096 +!endif + +!if $(LOIMPACT) +lflags = $(lflags) -ws:aggressive +!endif + +dlllflags = $(lflags) -dll +conlflags = $(lflags) -subsystem:console +guilflags = $(lflags) -subsystem:windows + +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 +!endif +guilibs = $(baselibs) gdi32.lib + + +#--------------------------------------------------------------------- +# TkTest flags +#--------------------------------------------------------------------- + +!if "$(TESTPAT)" != "" +TESTFLAGS = $(TESTFLAGS) -file $(TESTPAT) +!endif + + +#--------------------------------------------------------------------- +# Project specific targets +#--------------------------------------------------------------------- + +release: setup $(TKSTUBLIB) $(WISH) +all: release $(CAT32) +core: setup $(TKSTUBLIB) $(TKLIB) +cwish: $(WISHC) +install: install-binaries install-libraries install-docs +tktest: setup $(TKTEST) $(CAT32) + + +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) +!else + @set PATH=$(_TCLDIR)\win\$(BUILDDIRTOP);$(PATH) +!endif +!if "$(OS)" == "Windows_NT" || "$(MSVCDIR)" == "IDE" + $(DEBUGGER) $(TKTEST) "$(ROOT:\=/)/tests/ttk/all.tcl" $(TESTFLAGS) | $(CAT32) +!else + $(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 TCLLIBPATH= +!if $(TCLINSTALL) + @set PATH=$(_TCLDIR)\bin;$(PATH) +!else + @set PATH=$(_TCLDIR)\win\$(BUILDDIRTOP);$(PATH) +!endif + $(DEBUGGER) $(TKTEST) + +rundemo: 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 + $(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) +!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) + +!if !$(STATIC_BUILD) +$(TKIMPLIB): $(TKLIB) +!endif + +$(TKLIB): $(TKOBJS) +!if $(STATIC_BUILD) + $(lib32) -nologo -out:$@ @<< +$** +<< +!else + $(link32) $(dlllflags) -base:@$(COFFBASE),tk -out:$@ $(guilibs) \ + $(TCLSTUBLIB) @<< +$** +<< + $(_VC_MANIFEST_EMBED_DLL) + -@del $*.exp +!endif + + +$(TKSTUBLIB): $(TKSTUBOBJS) + $(lib32) -nologo -nodefaultlib -out:$@ $** + + +$(WISH): $(WISHOBJS) $(TKIMPLIB) + $(link32) $(guilflags) -stack:2300000 -out:$@ $(guilibs) $(TCLIMPLIB) $** + $(_VC_MANIFEST_EMBED_EXE) + + +$(WISHC): $(WISHOBJS) $(TKIMPLIB) + $(link32) $(conlflags) -stack:2300000 -out:$@ $(guilibs) $(TCLIMPLIB) $** + $(_VC_MANIFEST_EMBED_EXE) + + +$(TKTEST): $(TKTESTOBJS) $(TKIMPLIB) + $(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) + +#--------------------------------------------------------------------- +# 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 + + +#--------------------------------------------------------------------- +# Build the Windows HTML help file. +#--------------------------------------------------------------------- + +# 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) + +$(CHMFILE): $(DOCDIR)\* + @$(TCLSH) $(TCLTOOLSDIR)\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)$(TK_VERSION) +HELPFILE = $(OUT_DIR)\$(HLPBASE).hlp +HELPCNT = $(OUT_DIR)\$(HLPBASE).cnt +DOCTMP_DIR = $(OUT_DIR)\$(PROJECT)_docs +HELPRTF = $(DOCTMP_DIR)\$(PROJECT).rtf +MAN2HELP = $(DOCTMP_DIR)\man2help.tcl +MAN2HELP2 = $(DOCTMP_DIR)\man2help2.tcl +INDEX = $(DOCTMP_DIR)\index.tcl +BMP = $(DOCTMP_DIR)\lamp.bmp +BMP_NOPATH = lamp.bmp +MAN2TCL = $(DOCTMP_DIR)\man2tcl.exe + +winhelp: docsetup $(HELPFILE) + +docsetup: + @if not exist $(DOCTMP_DIR)\nul mkdir $(DOCTMP_DIR) + +$(MAN2HELP) $(MAN2HELP2) $(INDEX): $(TCLTOOLSDIR)\$$(@F) + $(CPY) $(TCLTOOLSDIR)\$(@F) $(@D) + +$(BMP): + $(CPY) $(WINDIR)\rc\$(@F) $(@D) + +$(HELPFILE): $(HELPRTF) $(BMP) + cd $(DOCTMP_DIR) + start /wait hcrtf.exe -x <<$(PROJECT).hpj +[OPTIONS] +COMPRESS=12 Hall Zeck +LCID=0x409 0x0 0x0 ; English (United States) +TITLE=Tk Reference Manual +BMROOT=. +CNT=$(@B).cnt +HLP=$(@B).hlp + +[FILES] +$(PROJECT).rtf + +[WINDOWS] +main="Tcl/Tk Reference Manual",,27648,(r15263976),(r4227327) + +[CONFIG] +BrowseButtons() +CreateButton(1, "Web", ExecFile("http://www.tcl.tk")) +CreateButton(2, "SF", ExecFile("http://sf.net/projects/tcl")) +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)" + +$(MAN2TCL): $(TCLTOOLSDIR)\$$(@B).c + $(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) $(TK_VERSION) $(DOCDIR:\=/) + +install-docs: +!if exist($(HELPFILE)) + $(CPY) "$(HELPFILE)" "$(DOC_INSTALL_DIR)\" + $(CPY) "$(HELPCNT)" "$(DOC_INSTALL_DIR)\" + $(TCLSH) << +puts "Installing $(PROJECT)'s helpfile contents into Tcl's ..." +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 == $(TK_VERSION)} { + puts "Already installed." + exit + } else { + # do something here logical to remove (or replace) it. + puts "$$ver != $(TK_VERSION), unfinished code path, die, die!" + exit 1 + } + } +} +close $$f +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$(TK_VERSION).hlp +!endif + +#--------------------------------------------------------------------- +# Special case object file targets +#--------------------------------------------------------------------- + +$(TMP_DIR)\testMain.obj: $(WINDIR)\winMain.c + $(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$@ $? + +$(TMP_DIR)\tkSquare.obj: $(GENERICDIR)\tkSquare.c + $(cc32) $(WISH_CFLAGS) -Fo$@ $? + +$(TMP_DIR)\winMain.obj: $(WINDIR)\winMain.c + $(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) $(STUB_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 +<< + +#--------------------------------------------------------------------- +# 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. +#--------------------------------------------------------------------- + +depend: +!if !exist($(TCLSH)) + @echo Build tclsh first! +!else + 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 + +!if exist("$(OUT_DIR)\depend.mk") +!include "$(OUT_DIR)\depend.mk" +!message *** Dependency rules in use. +!else +!message *** Dependency rules are not being used. +!endif + +### add a spacer in the output +!message + +#--------------------------------------------------------------------- +# Implicit rules +#--------------------------------------------------------------------- + +{$(XLIBDIR)}.c{$(TMP_DIR)}.obj:: + $(cc32) -DBUILD_tk $(TK_CFLAGS) -Fo$(TMP_DIR)\ @<< +$< +<< + +{$(GENERICDIR)}.c{$(TMP_DIR)}.obj:: + $(cc32) -DBUILD_tk $(TK_CFLAGS) -Fo$(TMP_DIR)\ @<< +$< +<< + +{$(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)\ @<< +$< +<< + +{$(ROOT)\unix}.c{$(TMP_DIR)}.obj:: + $(cc32) -DBUILD_tk $(TK_CFLAGS) -Fo$(TMP_DIR)\ @<< +$< +<< + +{$(RCDIR)}.rc{$(TMP_DIR)}.res: + $(rc32) -fo $@ -r -i "$(GENERICDIR)" -i "$(TMP_DIR)" $(TCL_INCLUDES) \ + -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 + + +#--------------------------------------------------------------------- +# Installation. +#--------------------------------------------------------------------- + +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 + +#" + +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\" + +#" + +#--------------------------------------------------------------------- +# 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) diff --git a/win/mkd.bat b/win/mkd.bat index f741daf..1bd5ccb 100644 --- a/win/mkd.bat +++ b/win/mkd.bat @@ -1,12 +1,12 @@ -@echo off - -if exist %1\nul goto end - -md %1 -if errorlevel 1 goto end - -echo Created directory %1 - -:end - - +@echo off + +if exist %1\nul goto end + +md %1 +if errorlevel 1 goto end + +echo Created directory %1 + +:end + + diff --git a/win/rc/tk_base.rc b/win/rc/tk_base.rc index 3e065c9..e6ab016 100644 --- a/win/rc/tk_base.rc +++ b/win/rc/tk_base.rc @@ -26,12 +26,12 @@ FONT 8, "Helv" BEGIN LTEXT "Directory &name:",-1,8,6,118,9 EDITTEXT edt10,8,26,144,12, WS_TABSTOP | ES_AUTOHSCROLL - LISTBOX lst2,8,40,144,64,LBS_SORT | LBS_OWNERDRAWFIXED | - LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | + LISTBOX lst2,8,40,144,64,LBS_SORT | LBS_OWNERDRAWFIXED | + LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | WS_VSCROLL | WS_TABSTOP LTEXT "Dri&ves:",stc4,8,106,92,9 - COMBOBOX cmb2,8,115,144,68,CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | - CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_BORDER | + COMBOBOX cmb2,8,115,144,68,CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | + CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_BORDER | WS_VSCROLL | WS_TABSTOP DEFPUSHBUTTON "OK",1,160,6,50,14,WS_GROUP PUSHBUTTON "Cancel",2,160,24,50,14,WS_GROUP @@ -42,8 +42,8 @@ BEGIN LTEXT "a",stc3,9,143,114,15 EDITTEXT edt1,7,158,135,20,NOT WS_TABSTOP LISTBOX lst1,8,205,134,42,LBS_NOINTEGRALHEIGHT - COMBOBOX cmb1,8,253,135,21,CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | - CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_BORDER | + COMBOBOX cmb1,8,253,135,21,CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | + CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_BORDER | WS_VSCROLL END diff --git a/win/rc/wish.rc b/win/rc/wish.rc index 5cc2fa4..53e02fa 100644 --- a/win/rc/wish.rc +++ b/win/rc/wish.rc @@ -63,7 +63,7 @@ END // // Icon -// +// // The icon whose name or resource ID is lexigraphically first, is used // as the application's icon. // diff --git a/win/rmd.bat b/win/rmd.bat index d260936..820b76f 100644 --- a/win/rmd.bat +++ b/win/rmd.bat @@ -1,20 +1,20 @@ -@echo off - -if not exist %1\nul goto end - -echo Removing directory %1 - -if "%OS%" == "Windows_NT" goto winnt - -deltree /y %1 -if errorlevel 1 goto end -goto success - -:winnt -rmdir /s /q %1 -if errorlevel 1 goto end - -:success -echo Deleted directory %1 - -:end +@echo off + +if not exist %1\nul goto end + +echo Removing directory %1 + +if "%OS%" == "Windows_NT" goto winnt + +deltree /y %1 +if errorlevel 1 goto end +goto success + +:winnt +rmdir /s /q %1 +if errorlevel 1 goto end + +:success +echo Deleted directory %1 + +:end diff --git a/win/rules.vc b/win/rules.vc index dd417c8..a43fac6 100644 --- a/win/rules.vc +++ b/win/rules.vc @@ -1,716 +1,716 @@ -#------------------------------------------------------------------------------ -# rules.vc -- -# -# Microsoft Visual C++ makefile include for decoding the commandline -# macros. This file does not need editing to build Tcl. -# -# See the file "license.terms" for information on usage and redistribution -# of this file, and for a DISCLAIMER OF ALL WARRANTIES. -# -# Copyright (c) 2001-2003 David Gravereaux. -# Copyright (c) 2003-2008 Patrick Thoyts -#------------------------------------------------------------------------------ - -!ifndef _RULES_VC -_RULES_VC = 1 - -cc32 = $(CC) # built-in default. -link32 = link -lib32 = lib -rc32 = $(RC) # built-in default. - -!ifndef INSTALLDIR -### Assume the normal default. -_INSTALLDIR = C:\Program Files\Tcl -!else -### Fix the path separators. -_INSTALLDIR = $(INSTALLDIR:/=\) -!endif - -#---------------------------------------------------------- -# Set the proper copy method to avoid overwrite questions -# to the user when copying files and selecting the right -# "delete all" method. -#---------------------------------------------------------- - -!if "$(OS)" == "Windows_NT" -RMDIR = rmdir /S /Q -ERRNULL = 2>NUL -!if ![ver | find "4.0" > nul] -CPY = echo y | xcopy /i >NUL -COPY = copy >NUL -!else -CPY = xcopy /i /y >NUL -COPY = copy /y >NUL -!endif -!else # "$(OS)" != "Windows_NT" -CPY = xcopy /i >_JUNK.OUT # On Win98 NUL does not work here. -COPY = copy >_JUNK.OUT # On Win98 NUL does not work here. -RMDIR = deltree /Y -NULL = \NUL # Used in testing directory existence -ERRNULL = >NUL # Win9x shell cannot redirect stderr -!endif -MKDIR = mkdir - -#------------------------------------------------------------------------------ -# Determine the host and target architectures and compiler version. -#------------------------------------------------------------------------------ - -_HASH=^# -_VC_MANIFEST_EMBED_EXE= -_VC_MANIFEST_EMBED_DLL= -VCVER=0 -!if ![echo VCVERSION=_MSC_VER > vercl.x] \ - && ![echo $(_HASH)if defined(_M_IX86) >> vercl.x] \ - && ![echo ARCH=IX86 >> vercl.x] \ - && ![echo $(_HASH)elif defined(_M_AMD64) >> vercl.x] \ - && ![echo ARCH=AMD64 >> vercl.x] \ - && ![echo $(_HASH)endif >> vercl.x] \ - && ![cl -nologo -TC -P vercl.x $(ERRNULL)] -!include vercl.i -!if ![echo VCVER= ^\> vercl.vc] \ - && ![set /a $(VCVERSION) / 100 - 6 >> vercl.vc] -!include vercl.vc -!endif -!endif -!if ![del $(ERRNUL) /q/f vercl.x vercl.i vercl.vc] -!endif - -!if ![reg query HKLM\Hardware\Description\System\CentralProcessor\0 /v Identifier | findstr /i x86] -NATIVE_ARCH=IX86 -!else -NATIVE_ARCH=AMD64 -!endif - -# Since MSVC8 we must deal with manifest resources. -!if $(VCVERSION) >= 1400 -_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 -!endif - -!ifndef MACHINE -MACHINE=$(ARCH) -!endif - -!ifndef CFG_ENCODING -CFG_ENCODING = \"cp1252\" -!endif - -!message =============================================================================== - -#---------------------------------------------------------- -# build the helper app we need to overcome nmake's limiting -# environment. -#---------------------------------------------------------- - -!if !exist(nmakehlp.exe) -!if [$(cc32) -nologo nmakehlp.c -link -subsystem:console > nul] -!endif -!endif - -#---------------------------------------------------------- -# Test for compiler features -#---------------------------------------------------------- - -### test for optimizations -!if [nmakehlp -c -Ot] -!message *** Compiler has 'Optimizations' -OPTIMIZING = 1 -!else -!message *** Compiler does not have 'Optimizations' -OPTIMIZING = 0 -!endif - -OPTIMIZATIONS = - -!if [nmakehlp -c -Ot] -OPTIMIZATIONS = $(OPTIMIZATIONS) -Ot -!endif - -!if [nmakehlp -c -Oi] -OPTIMIZATIONS = $(OPTIMIZATIONS) -Oi -!endif - -!if [nmakehlp -c -Op] -OPTIMIZATIONS = $(OPTIMIZATIONS) -Op -!endif - -!if [nmakehlp -c -fp:strict] -OPTIMIZATIONS = $(OPTIMIZATIONS) -fp:strict -!endif - -!if [nmakehlp -c -Gs] -OPTIMIZATIONS = $(OPTIMIZATIONS) -Gs -!endif - -!if [nmakehlp -c -GS] -OPTIMIZATIONS = $(OPTIMIZATIONS) -GS -!endif - -!if [nmakehlp -c -GL] -OPTIMIZATIONS = $(OPTIMIZATIONS) -GL -!endif - -DEBUGFLAGS = - -!if [nmakehlp -c -RTC1] -DEBUGFLAGS = $(DEBUGFLAGS) -RTC1 -!elseif [nmakehlp -c -GZ] -DEBUGFLAGS = $(DEBUGFLAGS) -GZ -!endif - -COMPILERFLAGS =-W3 - -# In v13 -GL and -YX are incompatible. -!if [nmakehlp -c -YX] -!if ![nmakehlp -c -GL] -OPTIMIZATIONS = $(OPTIMIZATIONS) -YX -!endif -!endif - -!if "$(MACHINE)" == "IX86" -### test for pentium errata -!if [nmakehlp -c -QI0f] -!message *** Compiler has 'Pentium 0x0f fix' -COMPILERFLAGS = $(COMPILERFLAGS) -QI0f -!else -!message *** Compiler does not have 'Pentium 0x0f fix' -!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' -ALIGN98_HACK = 1 -!else -!message *** Linker does not have 'Win98 alignment problem' -ALIGN98_HACK = 0 -!endif -!else -ALIGN98_HACK = 0 -!endif - -LINKERFLAGS = - -!if [nmakehlp -l -ltcg] -LINKERFLAGS =-ltcg -!endif - -#---------------------------------------------------------- -# Decode the options requested. -#---------------------------------------------------------- - -!if "$(OPTS)" == "" || [nmakehlp -f "$(OPTS)" "none"] -STATIC_BUILD = 0 -TCL_THREADS = 0 -DEBUG = 0 -SYMBOLS = 0 -PROFILE = 0 -PGO = 0 -MSVCRT = 1 -LOIMPACT = 0 -TCL_USE_STATIC_PACKAGES = 0 -USE_THREAD_ALLOC = 0 -UNCHECKED = 0 -!else -!if [nmakehlp -f $(OPTS) "static"] -!message *** Doing static -STATIC_BUILD = 1 -!else -STATIC_BUILD = 0 -!endif -!if [nmakehlp -f $(OPTS) "msvcrt"] -!message *** Doing msvcrt -MSVCRT = 1 -!else -!if !$(STATIC_BUILD) -MSVCRT = 1 -!else -MSVCRT = 0 -!endif -!endif -!if [nmakehlp -f $(OPTS) "staticpkg"] && $(STATIC_BUILD) -!message *** Doing staticpkg -TCL_USE_STATIC_PACKAGES = 1 -!else -TCL_USE_STATIC_PACKAGES = 0 -!endif -!if [nmakehlp -f $(OPTS) "threads"] -!message *** Doing threads -TCL_THREADS = 1 -USE_THREAD_ALLOC = 1 -!else -TCL_THREADS = 0 -USE_THREAD_ALLOC = 0 -!endif -!if [nmakehlp -f $(OPTS) "symbols"] -!message *** Doing symbols -DEBUG = 1 -!else -DEBUG = 0 -!endif -!if [nmakehlp -f $(OPTS) "pdbs"] -!message *** Doing pdbs -SYMBOLS = 1 -!else -SYMBOLS = 0 -!endif -!if [nmakehlp -f $(OPTS) "profile"] -!message *** Doing profile -PROFILE = 1 -!else -PROFILE = 0 -!endif -!if [nmakehlp -f $(OPTS) "pgi"] -!message *** Doing profile guided optimization instrumentation -PGO = 1 -!elseif [nmakehlp -f $(OPTS) "pgo"] -!message *** Doing profile guided optimization -PGO = 2 -!else -PGO = 0 -!endif -!if [nmakehlp -f $(OPTS) "loimpact"] -!message *** Doing loimpact -LOIMPACT = 1 -!else -LOIMPACT = 0 -!endif -!if [nmakehlp -f $(OPTS) "thrdalloc"] -!message *** Doing thrdalloc -USE_THREAD_ALLOC = 1 -!endif -!if [nmakehlp -f $(OPTS) "tclalloc"] -!message *** Doing tclalloc -USE_THREAD_ALLOC = 0 -!endif -!if [nmakehlp -f $(OPTS) "unchecked"] -!message *** Doing unchecked -UNCHECKED = 1 -!else -UNCHECKED = 0 -!endif -!endif - -#---------------------------------------------------------- -# Figure-out how to name our intermediate and output directories. -# We wouldn't want different builds to use the same .obj files -# by accident. -#---------------------------------------------------------- - -#---------------------------------------- -# Naming convention: -# t = full thread support. -# s = static library (as opposed to an -# import library) -# g = linked to the debug enabled C -# run-time. -# x = special static build when it -# links to the dynamic C run-time. -#---------------------------------------- -SUFX = tsgx - -!if $(DEBUG) -BUILDDIRTOP = Debug -!else -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 - -TMP_DIRFULL = .\$(BUILDDIRTOP)\$(PROJECT)_ThreadedDynamicStaticX - -!if !$(STATIC_BUILD) -TMP_DIRFULL = $(TMP_DIRFULL:Static=) -SUFX = $(SUFX:s=) -EXT = dll -TMP_DIRFULL = $(TMP_DIRFULL:X=) -SUFX = $(SUFX:x=) -!else -TMP_DIRFULL = $(TMP_DIRFULL:Dynamic=) -EXT = lib -!if !$(MSVCRT) -TMP_DIRFULL = $(TMP_DIRFULL:X=) -SUFX = $(SUFX:x=) -!endif -!endif - -!if !$(TCL_THREADS) -TMP_DIRFULL = $(TMP_DIRFULL:Threaded=) -SUFX = $(SUFX:t=) -!endif - -!ifndef TMP_DIR -TMP_DIR = $(TMP_DIRFULL) -!ifndef OUT_DIR -OUT_DIR = .\$(BUILDDIRTOP) -!endif -!else -!ifndef OUT_DIR -OUT_DIR = $(TMP_DIR) -!endif -!endif - - -#---------------------------------------------------------- -# Decode the statistics requested. -#---------------------------------------------------------- - -!if "$(STATS)" == "" || [nmakehlp -f "$(STATS)" "none"] -TCL_MEM_DEBUG = 0 -TCL_COMPILE_DEBUG = 0 -!else -!if [nmakehlp -f $(STATS) "memdbg"] -!message *** Doing memdbg -TCL_MEM_DEBUG = 1 -!else -TCL_MEM_DEBUG = 0 -!endif -!if [nmakehlp -f $(STATS) "compdbg"] -!message *** Doing compdbg -TCL_COMPILE_DEBUG = 1 -!else -TCL_COMPILE_DEBUG = 0 -!endif -!endif - - -#---------------------------------------------------------- -# Decode the checks requested. -#---------------------------------------------------------- - -!if "$(CHECKS)" == "" || [nmakehlp -f "$(CHECKS)" "none"] -TCL_NO_DEPRECATED = 0 -WARNINGS = -W3 -!else -!if [nmakehlp -f $(CHECKS) "nodep"] -!message *** Doing nodep check -TCL_NO_DEPRECATED = 1 -!else -TCL_NO_DEPRECATED = 0 -!endif -!if [nmakehlp -f $(CHECKS) "fullwarn"] -!message *** Doing full warnings check -WARNINGS = -W4 -!if [nmakehlp -l -warn:3] -LINKERFLAGS = $(LINKERFLAGS) -warn:3 -!endif -!else -WARNINGS = -W3 -!endif -!if [nmakehlp -f $(CHECKS) "64bit"] && [nmakehlp -c -Wp64] -!message *** Doing 64bit portability warnings -WARNINGS = $(WARNINGS) -Wp64 -!endif -!endif - -!if $(PGO) > 1 -!if [nmakehlp -l -ltcg:pgoptimize] -LINKERFLAGS = $(LINKERFLAGS:-ltcg=) -ltcg:pgoptimize -!else -MSG=^ -This compiler does not support profile guided optimization. -!error $(MSG) -!endif -!elseif $(PGO) > 0 -!if [nmakehlp -l -ltcg:pginstrument] -LINKERFLAGS = $(LINKERFLAGS:-ltcg=) -ltcg:pginstrument -!else -MSG=^ -This compiler does not support profile guided optimization. -!error $(MSG) -!endif -!endif - -#---------------------------------------------------------- -# Set our defines now armed with our options. -#---------------------------------------------------------- - -OPTDEFINES = -DTCL_CFGVAL_ENCODING=$(CFG_ENCODING) -DSTDC_HEADERS - -!if $(TCL_MEM_DEBUG) -OPTDEFINES = $(OPTDEFINES) -DTCL_MEM_DEBUG -!endif -!if $(TCL_COMPILE_DEBUG) -OPTDEFINES = $(OPTDEFINES) -DTCL_COMPILE_DEBUG -DTCL_COMPILE_STATS -!endif -!if $(TCL_THREADS) -OPTDEFINES = $(OPTDEFINES) -DTCL_THREADS=1 -!if $(USE_THREAD_ALLOC) -OPTDEFINES = $(OPTDEFINES) -DUSE_THREAD_ALLOC=1 -!endif -!endif -!if $(STATIC_BUILD) -OPTDEFINES = $(OPTDEFINES) -DSTATIC_BUILD -!endif -!if $(TCL_NO_DEPRECATED) -OPTDEFINES = $(OPTDEFINES) -DTCL_NO_DEPRECATED -!endif - -!if !$(DEBUG) -OPTDEFINES = $(OPTDEFINES) -DNDEBUG -!if $(OPTIMIZING) -OPTDEFINES = $(OPTDEFINES) -DTCL_CFG_OPTIMIZED -!endif -!endif -!if $(PROFILE) -OPTDEFINES = $(OPTDEFINES) -DTCL_CFG_PROFILED -!endif -!if "$(MACHINE)" == "IA64" || "$(MACHINE)" == "AMD64" -OPTDEFINES = $(OPTDEFINES) -DTCL_CFG_DO64BIT -!endif -!if $(VCVERSION) < 1300 -OPTDEFINES = $(OPTDEFINES) -DNO_STRTOI64 -!endif - -#---------------------------------------------------------- -# Locate the Tcl headers to build against -#---------------------------------------------------------- - -!if "$(PROJECT)" == "tcl" - -_TCL_H = ..\generic\tcl.h - -!else - -# If INSTALLDIR set to tcl root dir then reset to the lib dir. -!if exist("$(_INSTALLDIR)\include\tcl.h") -_INSTALLDIR=$(_INSTALLDIR)\lib -!endif - -!if !defined(TCLDIR) -!if exist("$(_INSTALLDIR)\..\include\tcl.h") -TCLINSTALL = 1 -_TCLDIR = $(_INSTALLDIR)\.. -_TCL_H = $(_INSTALLDIR)\..\include\tcl.h -TCLDIR = $(_INSTALLDIR)\.. -!else -MSG=^ -Failed to find tcl.h. Set the TCLDIR macro. -!error $(MSG) -!endif -!else -_TCLDIR = $(TCLDIR:/=\) -!if exist("$(_TCLDIR)\include\tcl.h") -TCLINSTALL = 1 -_TCL_H = $(_TCLDIR)\include\tcl.h -!elseif exist("$(_TCLDIR)\generic\tcl.h") -TCLINSTALL = 0 -_TCL_H = $(_TCLDIR)\generic\tcl.h -!else -MSG =^ -Failed to find tcl.h. The TCLDIR macro does not appear correct. -!error $(MSG) -!endif -!endif -!endif - -#-------------------------------------------------------------- -# Extract various version numbers from tcl headers -# The generated file is then included in the makefile. -#-------------------------------------------------------------- - -!if [echo REM = This file is generated from rules.vc > versions.vc] -!endif -!if [echo TCL_MAJOR_VERSION = \>> versions.vc] \ - && [nmakehlp -V "$(_TCL_H)" TCL_MAJOR_VERSION >> versions.vc] -!endif -!if [echo TCL_MINOR_VERSION = \>> versions.vc] \ - && [nmakehlp -V "$(_TCL_H)" TCL_MINOR_VERSION >> versions.vc] -!endif -!if [echo TCL_PATCH_LEVEL = \>> versions.vc] \ - && [nmakehlp -V "$(_TCL_H)" TCL_PATCH_LEVEL >> versions.vc] -!endif - -# If building the tcl core then we need additional package versions -!if "$(PROJECT)" == "tcl" -!if [echo PKG_HTTP_VER = \>> versions.vc] \ - && [nmakehlp -V ..\library\http\pkgIndex.tcl http >> versions.vc] -!endif -!if [echo PKG_TCLTEST_VER = \>> versions.vc] \ - && [nmakehlp -V ..\library\tcltest\pkgIndex.tcl tcltest >> versions.vc] -!endif -!if [echo PKG_MSGCAT_VER = \>> versions.vc] \ - && [nmakehlp -V ..\library\msgcat\pkgIndex.tcl msgcat >> versions.vc] -!endif -!if [echo PKG_PLATFORM_VER = \>> versions.vc] \ - && [nmakehlp -V ..\library\platform\pkgIndex.tcl "platform " >> versions.vc] -!endif -!if [echo PKG_SHELL_VER = \>> versions.vc] \ - && [nmakehlp -V ..\library\platform\pkgIndex.tcl "platform::shell" >> versions.vc] -!endif -!if [echo PKG_DDE_VER = \>> versions.vc] \ - && [nmakehlp -V ..\library\dde\pkgIndex.tcl "dde " >> versions.vc] -!endif -!if [echo PKG_REG_VER =\>> versions.vc] \ - && [nmakehlp -V ..\library\reg\pkgIndex.tcl registry >> versions.vc] -!endif -!endif - -!include versions.vc - -#-------------------------------------------------------------- -# Setup tcl version dependent stuff headers -#-------------------------------------------------------------- - -!if "$(PROJECT)" != "tcl" - -TCL_VERSION = $(TCL_MAJOR_VERSION)$(TCL_MINOR_VERSION) - -!if $(TCLINSTALL) -TCLSH = "$(_TCLDIR)\bin\tclsh$(TCL_VERSION)$(SUFX).exe" -!if !exist($(TCLSH)) -TCLSH = "$(_TCLDIR)\bin\tclsh$(TCL_VERSION)$(SUFX:x=).exe" -!endif -TCLSTUBLIB = "$(_TCLDIR)\lib\tclstub$(TCL_VERSION).lib" -TCLIMPLIB = "$(_TCLDIR)\lib\tcl$(TCL_VERSION)$(SUFX).lib" -!if !exist($(TCLIMPLIB)) -TCLIMPLIB = "$(_TCLDIR)\lib\tcl$(TCL_VERSION)$(SUFX:x=).lib" -!endif -TCL_LIBRARY = $(_TCLDIR)\lib -TCLREGLIB = "$(_TCLDIR)\lib\tclreg12$(SUFX:t=).lib" -TCLDDELIB = "$(_TCLDIR)\lib\tcldde13$(SUFX:t=).lib" -COFFBASE = \must\have\tcl\sources\to\build\this\target -TCLTOOLSDIR = \must\have\tcl\sources\to\build\this\target -TCL_INCLUDES = -I"$(_TCLDIR)\include" -!else -TCLSH = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tclsh$(TCL_VERSION)$(SUFX).exe" -!if !exist($(TCLSH)) -TCLSH = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tclsh$(TCL_VERSION)$(SUFX:x=).exe" -!endif -TCLSTUBLIB = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tclstub$(TCL_VERSION).lib" -TCLIMPLIB = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tcl$(TCL_VERSION)$(SUFX).lib" -!if !exist($(TCLIMPLIB)) -TCLIMPLIB = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tcl$(TCL_VERSION)$(SUFX:x=).lib" -!endif -TCL_LIBRARY = $(_TCLDIR)\library -TCLREGLIB = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tclreg12$(SUFX:t=).lib" -TCLDDELIB = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tcldde13$(SUFX:t=).lib" -COFFBASE = "$(_TCLDIR)\win\coffbase.txt" -TCLTOOLSDIR = $(_TCLDIR)\tools -TCL_INCLUDES = -I"$(_TCLDIR)\generic" -I"$(_TCLDIR)\win" -!endif - -!endif - -#------------------------------------------------------------------------- -# Locate the Tk headers to build against -#------------------------------------------------------------------------- - -!if "$(PROJECT)" == "tk" -_TK_H = ..\generic\tk.h -_INSTALLDIR = $(_INSTALLDIR)\.. -!endif - -!ifdef PROJECT_REQUIRES_TK -!if !defined(TKDIR) -!if exist("$(_INSTALLDIR)\..\include\tk.h") -TKINSTALL = 1 -_TKDIR = $(_INSTALLDIR)\.. -_TK_H = $(_TKDIR)\include\tk.h -TKDIR = $(_TKDIR) -!elseif exist("$(_TCLDIR)\include\tk.h") -TKINSTALL = 1 -_TKDIR = $(_TCLDIR) -_TK_H = $(_TKDIR)\include\tk.h -TKDIR = $(_TKDIR) -!endif -!else -_TKDIR = $(TKDIR:/=\) -!if exist("$(_TKDIR)\include\tk.h") -TKINSTALL = 1 -_TK_H = $(_TKDIR)\include\tk.h -!elseif exist("$(_TKDIR)\generic\tk.h") -TKINSTALL = 0 -_TK_H = $(_TKDIR)\generic\tk.h -!else -MSG =^ -Failed to find tk.h. The TKDIR macro does not appear correct. -!error $(MSG) -!endif -!endif -!endif - -#------------------------------------------------------------------------- -# Extract Tk version numbers -#------------------------------------------------------------------------- - -!if defined(PROJECT_REQUIRES_TK) || "$(PROJECT)" == "tk" - -!if [echo TK_MAJOR_VERSION = \>> versions.vc] \ - && [nmakehlp -V $(_TK_H) TK_MAJOR_VERSION >> versions.vc] -!endif -!if [echo TK_MINOR_VERSION = \>> versions.vc] \ - && [nmakehlp -V $(_TK_H) TK_MINOR_VERSION >> versions.vc] -!endif -!if [echo TK_PATCH_LEVEL = \>> versions.vc] \ - && [nmakehlp -V $(_TK_H) TK_PATCH_LEVEL >> versions.vc] -!endif - -!include versions.vc - -TK_DOTVERSION = $(TK_MAJOR_VERSION).$(TK_MINOR_VERSION) -TK_VERSION = $(TK_MAJOR_VERSION)$(TK_MINOR_VERSION) - -!if "$(PROJECT)" != "tk" -!if $(TKINSTALL) -WISH = "$(_TKDIR)\bin\wish$(TK_VERSION)$(SUFX).exe" -!if !exist($(WISH)) -WISH = "$(_TKDIR)\bin\wish$(TK_VERSION)$(SUFX:x=).exe" -!endif -TKSTUBLIB = "$(_TKDIR)\lib\tkstub$(TK_VERSION).lib" -TKIMPLIB = "$(_TKDIR)\lib\tk$(TK_VERSION)$(SUFX).lib" -!if !exist($(TKIMPLIB)) -TKIMPLIB = "$(_TKDIR)\win\$(BUILDDIRTOP)\tk$(TCL_VERSION)$(SUFX:x=).lib" -!endif -TK_INCLUDES = -I"$(_TKDIR)\include" -!else -WISH = "$(_TKDIR)\win\$(BUILDDIRTOP)\wish$(TCL_VERSION)$(SUFX).exe" -!if !exist($(WISH)) -WISH = "$(_TKDIR)\win\$(BUILDDIRTOP)\wish$(TCL_VERSION)$(SUFX:x=).exe" -!endif -TKSTUBLIB = "$(_TKDIR)\win\$(BUILDDIRTOP)\tkstub$(TCL_VERSION).lib" -TKIMPLIB = "$(_TKDIR)\win\$(BUILDDIRTOP)\tk$(TCL_VERSION)$(SUFX).lib" -!if !exist($(TKIMPLIB)) -TKIMPLIB = "$(_TKDIR)\win\$(BUILDDIRTOP)\tk$(TCL_VERSION)$(SUFX:x=).lib" -!endif -TK_INCLUDES = -I"$(_TKDIR)\generic" -I"$(_TKDIR)\win" -I"$(_TKDIR)\xlib" -!endif -!endif - -!endif - -#---------------------------------------------------------- -# Display stats being used. -#---------------------------------------------------------- - -!message *** Intermediate directory will be '$(TMP_DIR)' -!message *** Output directory will be '$(OUT_DIR)' -!message *** Suffix for binaries will be '$(SUFX)' -!message *** Optional defines are '$(OPTDEFINES)' -!message *** Compiler version $(VCVER). Target machine is $(MACHINE) -!message *** Host architecture is $(NATIVE_ARCH) -!message *** Compiler options '$(COMPILERFLAGS) $(OPTIMIZATIONS) $(DEBUGFLAGS) $(WARNINGS)' -!message *** Link options '$(LINKERFLAGS)' - -!endif +#------------------------------------------------------------------------------ +# rules.vc -- +# +# Microsoft Visual C++ makefile include for decoding the commandline +# macros. This file does not need editing to build Tcl. +# +# See the file "license.terms" for information on usage and redistribution +# of this file, and for a DISCLAIMER OF ALL WARRANTIES. +# +# Copyright (c) 2001-2003 David Gravereaux. +# Copyright (c) 2003-2008 Patrick Thoyts +#------------------------------------------------------------------------------ + +!ifndef _RULES_VC +_RULES_VC = 1 + +cc32 = $(CC) # built-in default. +link32 = link +lib32 = lib +rc32 = $(RC) # built-in default. + +!ifndef INSTALLDIR +### Assume the normal default. +_INSTALLDIR = C:\Program Files\Tcl +!else +### Fix the path separators. +_INSTALLDIR = $(INSTALLDIR:/=\) +!endif + +#---------------------------------------------------------- +# Set the proper copy method to avoid overwrite questions +# to the user when copying files and selecting the right +# "delete all" method. +#---------------------------------------------------------- + +!if "$(OS)" == "Windows_NT" +RMDIR = rmdir /S /Q +ERRNULL = 2>NUL +!if ![ver | find "4.0" > nul] +CPY = echo y | xcopy /i >NUL +COPY = copy >NUL +!else +CPY = xcopy /i /y >NUL +COPY = copy /y >NUL +!endif +!else # "$(OS)" != "Windows_NT" +CPY = xcopy /i >_JUNK.OUT # On Win98 NUL does not work here. +COPY = copy >_JUNK.OUT # On Win98 NUL does not work here. +RMDIR = deltree /Y +NULL = \NUL # Used in testing directory existence +ERRNULL = >NUL # Win9x shell cannot redirect stderr +!endif +MKDIR = mkdir + +#------------------------------------------------------------------------------ +# Determine the host and target architectures and compiler version. +#------------------------------------------------------------------------------ + +_HASH=^# +_VC_MANIFEST_EMBED_EXE= +_VC_MANIFEST_EMBED_DLL= +VCVER=0 +!if ![echo VCVERSION=_MSC_VER > vercl.x] \ + && ![echo $(_HASH)if defined(_M_IX86) >> vercl.x] \ + && ![echo ARCH=IX86 >> vercl.x] \ + && ![echo $(_HASH)elif defined(_M_AMD64) >> vercl.x] \ + && ![echo ARCH=AMD64 >> vercl.x] \ + && ![echo $(_HASH)endif >> vercl.x] \ + && ![cl -nologo -TC -P vercl.x $(ERRNULL)] +!include vercl.i +!if ![echo VCVER= ^\> vercl.vc] \ + && ![set /a $(VCVERSION) / 100 - 6 >> vercl.vc] +!include vercl.vc +!endif +!endif +!if ![del $(ERRNUL) /q/f vercl.x vercl.i vercl.vc] +!endif + +!if ![reg query HKLM\Hardware\Description\System\CentralProcessor\0 /v Identifier | findstr /i x86] +NATIVE_ARCH=IX86 +!else +NATIVE_ARCH=AMD64 +!endif + +# Since MSVC8 we must deal with manifest resources. +!if $(VCVERSION) >= 1400 +_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 +!endif + +!ifndef MACHINE +MACHINE=$(ARCH) +!endif + +!ifndef CFG_ENCODING +CFG_ENCODING = \"cp1252\" +!endif + +!message =============================================================================== + +#---------------------------------------------------------- +# build the helper app we need to overcome nmake's limiting +# environment. +#---------------------------------------------------------- + +!if !exist(nmakehlp.exe) +!if [$(cc32) -nologo nmakehlp.c -link -subsystem:console > nul] +!endif +!endif + +#---------------------------------------------------------- +# Test for compiler features +#---------------------------------------------------------- + +### test for optimizations +!if [nmakehlp -c -Ot] +!message *** Compiler has 'Optimizations' +OPTIMIZING = 1 +!else +!message *** Compiler does not have 'Optimizations' +OPTIMIZING = 0 +!endif + +OPTIMIZATIONS = + +!if [nmakehlp -c -Ot] +OPTIMIZATIONS = $(OPTIMIZATIONS) -Ot +!endif + +!if [nmakehlp -c -Oi] +OPTIMIZATIONS = $(OPTIMIZATIONS) -Oi +!endif + +!if [nmakehlp -c -Op] +OPTIMIZATIONS = $(OPTIMIZATIONS) -Op +!endif + +!if [nmakehlp -c -fp:strict] +OPTIMIZATIONS = $(OPTIMIZATIONS) -fp:strict +!endif + +!if [nmakehlp -c -Gs] +OPTIMIZATIONS = $(OPTIMIZATIONS) -Gs +!endif + +!if [nmakehlp -c -GS] +OPTIMIZATIONS = $(OPTIMIZATIONS) -GS +!endif + +!if [nmakehlp -c -GL] +OPTIMIZATIONS = $(OPTIMIZATIONS) -GL +!endif + +DEBUGFLAGS = + +!if [nmakehlp -c -RTC1] +DEBUGFLAGS = $(DEBUGFLAGS) -RTC1 +!elseif [nmakehlp -c -GZ] +DEBUGFLAGS = $(DEBUGFLAGS) -GZ +!endif + +COMPILERFLAGS =-W3 + +# In v13 -GL and -YX are incompatible. +!if [nmakehlp -c -YX] +!if ![nmakehlp -c -GL] +OPTIMIZATIONS = $(OPTIMIZATIONS) -YX +!endif +!endif + +!if "$(MACHINE)" == "IX86" +### test for pentium errata +!if [nmakehlp -c -QI0f] +!message *** Compiler has 'Pentium 0x0f fix' +COMPILERFLAGS = $(COMPILERFLAGS) -QI0f +!else +!message *** Compiler does not have 'Pentium 0x0f fix' +!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' +ALIGN98_HACK = 1 +!else +!message *** Linker does not have 'Win98 alignment problem' +ALIGN98_HACK = 0 +!endif +!else +ALIGN98_HACK = 0 +!endif + +LINKERFLAGS = + +!if [nmakehlp -l -ltcg] +LINKERFLAGS =-ltcg +!endif + +#---------------------------------------------------------- +# Decode the options requested. +#---------------------------------------------------------- + +!if "$(OPTS)" == "" || [nmakehlp -f "$(OPTS)" "none"] +STATIC_BUILD = 0 +TCL_THREADS = 0 +DEBUG = 0 +SYMBOLS = 0 +PROFILE = 0 +PGO = 0 +MSVCRT = 1 +LOIMPACT = 0 +TCL_USE_STATIC_PACKAGES = 0 +USE_THREAD_ALLOC = 0 +UNCHECKED = 0 +!else +!if [nmakehlp -f $(OPTS) "static"] +!message *** Doing static +STATIC_BUILD = 1 +!else +STATIC_BUILD = 0 +!endif +!if [nmakehlp -f $(OPTS) "msvcrt"] +!message *** Doing msvcrt +MSVCRT = 1 +!else +!if !$(STATIC_BUILD) +MSVCRT = 1 +!else +MSVCRT = 0 +!endif +!endif +!if [nmakehlp -f $(OPTS) "staticpkg"] && $(STATIC_BUILD) +!message *** Doing staticpkg +TCL_USE_STATIC_PACKAGES = 1 +!else +TCL_USE_STATIC_PACKAGES = 0 +!endif +!if [nmakehlp -f $(OPTS) "threads"] +!message *** Doing threads +TCL_THREADS = 1 +USE_THREAD_ALLOC = 1 +!else +TCL_THREADS = 0 +USE_THREAD_ALLOC = 0 +!endif +!if [nmakehlp -f $(OPTS) "symbols"] +!message *** Doing symbols +DEBUG = 1 +!else +DEBUG = 0 +!endif +!if [nmakehlp -f $(OPTS) "pdbs"] +!message *** Doing pdbs +SYMBOLS = 1 +!else +SYMBOLS = 0 +!endif +!if [nmakehlp -f $(OPTS) "profile"] +!message *** Doing profile +PROFILE = 1 +!else +PROFILE = 0 +!endif +!if [nmakehlp -f $(OPTS) "pgi"] +!message *** Doing profile guided optimization instrumentation +PGO = 1 +!elseif [nmakehlp -f $(OPTS) "pgo"] +!message *** Doing profile guided optimization +PGO = 2 +!else +PGO = 0 +!endif +!if [nmakehlp -f $(OPTS) "loimpact"] +!message *** Doing loimpact +LOIMPACT = 1 +!else +LOIMPACT = 0 +!endif +!if [nmakehlp -f $(OPTS) "thrdalloc"] +!message *** Doing thrdalloc +USE_THREAD_ALLOC = 1 +!endif +!if [nmakehlp -f $(OPTS) "tclalloc"] +!message *** Doing tclalloc +USE_THREAD_ALLOC = 0 +!endif +!if [nmakehlp -f $(OPTS) "unchecked"] +!message *** Doing unchecked +UNCHECKED = 1 +!else +UNCHECKED = 0 +!endif +!endif + +#---------------------------------------------------------- +# Figure-out how to name our intermediate and output directories. +# We wouldn't want different builds to use the same .obj files +# by accident. +#---------------------------------------------------------- + +#---------------------------------------- +# Naming convention: +# t = full thread support. +# s = static library (as opposed to an +# import library) +# g = linked to the debug enabled C +# run-time. +# x = special static build when it +# links to the dynamic C run-time. +#---------------------------------------- +SUFX = tsgx + +!if $(DEBUG) +BUILDDIRTOP = Debug +!else +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 + +TMP_DIRFULL = .\$(BUILDDIRTOP)\$(PROJECT)_ThreadedDynamicStaticX + +!if !$(STATIC_BUILD) +TMP_DIRFULL = $(TMP_DIRFULL:Static=) +SUFX = $(SUFX:s=) +EXT = dll +TMP_DIRFULL = $(TMP_DIRFULL:X=) +SUFX = $(SUFX:x=) +!else +TMP_DIRFULL = $(TMP_DIRFULL:Dynamic=) +EXT = lib +!if !$(MSVCRT) +TMP_DIRFULL = $(TMP_DIRFULL:X=) +SUFX = $(SUFX:x=) +!endif +!endif + +!if !$(TCL_THREADS) +TMP_DIRFULL = $(TMP_DIRFULL:Threaded=) +SUFX = $(SUFX:t=) +!endif + +!ifndef TMP_DIR +TMP_DIR = $(TMP_DIRFULL) +!ifndef OUT_DIR +OUT_DIR = .\$(BUILDDIRTOP) +!endif +!else +!ifndef OUT_DIR +OUT_DIR = $(TMP_DIR) +!endif +!endif + + +#---------------------------------------------------------- +# Decode the statistics requested. +#---------------------------------------------------------- + +!if "$(STATS)" == "" || [nmakehlp -f "$(STATS)" "none"] +TCL_MEM_DEBUG = 0 +TCL_COMPILE_DEBUG = 0 +!else +!if [nmakehlp -f $(STATS) "memdbg"] +!message *** Doing memdbg +TCL_MEM_DEBUG = 1 +!else +TCL_MEM_DEBUG = 0 +!endif +!if [nmakehlp -f $(STATS) "compdbg"] +!message *** Doing compdbg +TCL_COMPILE_DEBUG = 1 +!else +TCL_COMPILE_DEBUG = 0 +!endif +!endif + + +#---------------------------------------------------------- +# Decode the checks requested. +#---------------------------------------------------------- + +!if "$(CHECKS)" == "" || [nmakehlp -f "$(CHECKS)" "none"] +TCL_NO_DEPRECATED = 0 +WARNINGS = -W3 +!else +!if [nmakehlp -f $(CHECKS) "nodep"] +!message *** Doing nodep check +TCL_NO_DEPRECATED = 1 +!else +TCL_NO_DEPRECATED = 0 +!endif +!if [nmakehlp -f $(CHECKS) "fullwarn"] +!message *** Doing full warnings check +WARNINGS = -W4 +!if [nmakehlp -l -warn:3] +LINKERFLAGS = $(LINKERFLAGS) -warn:3 +!endif +!else +WARNINGS = -W3 +!endif +!if [nmakehlp -f $(CHECKS) "64bit"] && [nmakehlp -c -Wp64] +!message *** Doing 64bit portability warnings +WARNINGS = $(WARNINGS) -Wp64 +!endif +!endif + +!if $(PGO) > 1 +!if [nmakehlp -l -ltcg:pgoptimize] +LINKERFLAGS = $(LINKERFLAGS:-ltcg=) -ltcg:pgoptimize +!else +MSG=^ +This compiler does not support profile guided optimization. +!error $(MSG) +!endif +!elseif $(PGO) > 0 +!if [nmakehlp -l -ltcg:pginstrument] +LINKERFLAGS = $(LINKERFLAGS:-ltcg=) -ltcg:pginstrument +!else +MSG=^ +This compiler does not support profile guided optimization. +!error $(MSG) +!endif +!endif + +#---------------------------------------------------------- +# Set our defines now armed with our options. +#---------------------------------------------------------- + +OPTDEFINES = -DTCL_CFGVAL_ENCODING=$(CFG_ENCODING) -DSTDC_HEADERS + +!if $(TCL_MEM_DEBUG) +OPTDEFINES = $(OPTDEFINES) -DTCL_MEM_DEBUG +!endif +!if $(TCL_COMPILE_DEBUG) +OPTDEFINES = $(OPTDEFINES) -DTCL_COMPILE_DEBUG -DTCL_COMPILE_STATS +!endif +!if $(TCL_THREADS) +OPTDEFINES = $(OPTDEFINES) -DTCL_THREADS=1 +!if $(USE_THREAD_ALLOC) +OPTDEFINES = $(OPTDEFINES) -DUSE_THREAD_ALLOC=1 +!endif +!endif +!if $(STATIC_BUILD) +OPTDEFINES = $(OPTDEFINES) -DSTATIC_BUILD +!endif +!if $(TCL_NO_DEPRECATED) +OPTDEFINES = $(OPTDEFINES) -DTCL_NO_DEPRECATED +!endif + +!if !$(DEBUG) +OPTDEFINES = $(OPTDEFINES) -DNDEBUG +!if $(OPTIMIZING) +OPTDEFINES = $(OPTDEFINES) -DTCL_CFG_OPTIMIZED +!endif +!endif +!if $(PROFILE) +OPTDEFINES = $(OPTDEFINES) -DTCL_CFG_PROFILED +!endif +!if "$(MACHINE)" == "IA64" || "$(MACHINE)" == "AMD64" +OPTDEFINES = $(OPTDEFINES) -DTCL_CFG_DO64BIT +!endif +!if $(VCVERSION) < 1300 +OPTDEFINES = $(OPTDEFINES) -DNO_STRTOI64 +!endif + +#---------------------------------------------------------- +# Locate the Tcl headers to build against +#---------------------------------------------------------- + +!if "$(PROJECT)" == "tcl" + +_TCL_H = ..\generic\tcl.h + +!else + +# If INSTALLDIR set to tcl root dir then reset to the lib dir. +!if exist("$(_INSTALLDIR)\include\tcl.h") +_INSTALLDIR=$(_INSTALLDIR)\lib +!endif + +!if !defined(TCLDIR) +!if exist("$(_INSTALLDIR)\..\include\tcl.h") +TCLINSTALL = 1 +_TCLDIR = $(_INSTALLDIR)\.. +_TCL_H = $(_INSTALLDIR)\..\include\tcl.h +TCLDIR = $(_INSTALLDIR)\.. +!else +MSG=^ +Failed to find tcl.h. Set the TCLDIR macro. +!error $(MSG) +!endif +!else +_TCLDIR = $(TCLDIR:/=\) +!if exist("$(_TCLDIR)\include\tcl.h") +TCLINSTALL = 1 +_TCL_H = $(_TCLDIR)\include\tcl.h +!elseif exist("$(_TCLDIR)\generic\tcl.h") +TCLINSTALL = 0 +_TCL_H = $(_TCLDIR)\generic\tcl.h +!else +MSG =^ +Failed to find tcl.h. The TCLDIR macro does not appear correct. +!error $(MSG) +!endif +!endif +!endif + +#-------------------------------------------------------------- +# Extract various version numbers from tcl headers +# The generated file is then included in the makefile. +#-------------------------------------------------------------- + +!if [echo REM = This file is generated from rules.vc > versions.vc] +!endif +!if [echo TCL_MAJOR_VERSION = \>> versions.vc] \ + && [nmakehlp -V "$(_TCL_H)" TCL_MAJOR_VERSION >> versions.vc] +!endif +!if [echo TCL_MINOR_VERSION = \>> versions.vc] \ + && [nmakehlp -V "$(_TCL_H)" TCL_MINOR_VERSION >> versions.vc] +!endif +!if [echo TCL_PATCH_LEVEL = \>> versions.vc] \ + && [nmakehlp -V "$(_TCL_H)" TCL_PATCH_LEVEL >> versions.vc] +!endif + +# If building the tcl core then we need additional package versions +!if "$(PROJECT)" == "tcl" +!if [echo PKG_HTTP_VER = \>> versions.vc] \ + && [nmakehlp -V ..\library\http\pkgIndex.tcl http >> versions.vc] +!endif +!if [echo PKG_TCLTEST_VER = \>> versions.vc] \ + && [nmakehlp -V ..\library\tcltest\pkgIndex.tcl tcltest >> versions.vc] +!endif +!if [echo PKG_MSGCAT_VER = \>> versions.vc] \ + && [nmakehlp -V ..\library\msgcat\pkgIndex.tcl msgcat >> versions.vc] +!endif +!if [echo PKG_PLATFORM_VER = \>> versions.vc] \ + && [nmakehlp -V ..\library\platform\pkgIndex.tcl "platform " >> versions.vc] +!endif +!if [echo PKG_SHELL_VER = \>> versions.vc] \ + && [nmakehlp -V ..\library\platform\pkgIndex.tcl "platform::shell" >> versions.vc] +!endif +!if [echo PKG_DDE_VER = \>> versions.vc] \ + && [nmakehlp -V ..\library\dde\pkgIndex.tcl "dde " >> versions.vc] +!endif +!if [echo PKG_REG_VER =\>> versions.vc] \ + && [nmakehlp -V ..\library\reg\pkgIndex.tcl registry >> versions.vc] +!endif +!endif + +!include versions.vc + +#-------------------------------------------------------------- +# Setup tcl version dependent stuff headers +#-------------------------------------------------------------- + +!if "$(PROJECT)" != "tcl" + +TCL_VERSION = $(TCL_MAJOR_VERSION)$(TCL_MINOR_VERSION) + +!if $(TCLINSTALL) +TCLSH = "$(_TCLDIR)\bin\tclsh$(TCL_VERSION)$(SUFX).exe" +!if !exist($(TCLSH)) +TCLSH = "$(_TCLDIR)\bin\tclsh$(TCL_VERSION)$(SUFX:x=).exe" +!endif +TCLSTUBLIB = "$(_TCLDIR)\lib\tclstub$(TCL_VERSION).lib" +TCLIMPLIB = "$(_TCLDIR)\lib\tcl$(TCL_VERSION)$(SUFX).lib" +!if !exist($(TCLIMPLIB)) +TCLIMPLIB = "$(_TCLDIR)\lib\tcl$(TCL_VERSION)$(SUFX:x=).lib" +!endif +TCL_LIBRARY = $(_TCLDIR)\lib +TCLREGLIB = "$(_TCLDIR)\lib\tclreg12$(SUFX:t=).lib" +TCLDDELIB = "$(_TCLDIR)\lib\tcldde13$(SUFX:t=).lib" +COFFBASE = \must\have\tcl\sources\to\build\this\target +TCLTOOLSDIR = \must\have\tcl\sources\to\build\this\target +TCL_INCLUDES = -I"$(_TCLDIR)\include" +!else +TCLSH = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tclsh$(TCL_VERSION)$(SUFX).exe" +!if !exist($(TCLSH)) +TCLSH = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tclsh$(TCL_VERSION)$(SUFX:x=).exe" +!endif +TCLSTUBLIB = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tclstub$(TCL_VERSION).lib" +TCLIMPLIB = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tcl$(TCL_VERSION)$(SUFX).lib" +!if !exist($(TCLIMPLIB)) +TCLIMPLIB = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tcl$(TCL_VERSION)$(SUFX:x=).lib" +!endif +TCL_LIBRARY = $(_TCLDIR)\library +TCLREGLIB = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tclreg12$(SUFX:t=).lib" +TCLDDELIB = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tcldde13$(SUFX:t=).lib" +COFFBASE = "$(_TCLDIR)\win\coffbase.txt" +TCLTOOLSDIR = $(_TCLDIR)\tools +TCL_INCLUDES = -I"$(_TCLDIR)\generic" -I"$(_TCLDIR)\win" +!endif + +!endif + +#------------------------------------------------------------------------- +# Locate the Tk headers to build against +#------------------------------------------------------------------------- + +!if "$(PROJECT)" == "tk" +_TK_H = ..\generic\tk.h +_INSTALLDIR = $(_INSTALLDIR)\.. +!endif + +!ifdef PROJECT_REQUIRES_TK +!if !defined(TKDIR) +!if exist("$(_INSTALLDIR)\..\include\tk.h") +TKINSTALL = 1 +_TKDIR = $(_INSTALLDIR)\.. +_TK_H = $(_TKDIR)\include\tk.h +TKDIR = $(_TKDIR) +!elseif exist("$(_TCLDIR)\include\tk.h") +TKINSTALL = 1 +_TKDIR = $(_TCLDIR) +_TK_H = $(_TKDIR)\include\tk.h +TKDIR = $(_TKDIR) +!endif +!else +_TKDIR = $(TKDIR:/=\) +!if exist("$(_TKDIR)\include\tk.h") +TKINSTALL = 1 +_TK_H = $(_TKDIR)\include\tk.h +!elseif exist("$(_TKDIR)\generic\tk.h") +TKINSTALL = 0 +_TK_H = $(_TKDIR)\generic\tk.h +!else +MSG =^ +Failed to find tk.h. The TKDIR macro does not appear correct. +!error $(MSG) +!endif +!endif +!endif + +#------------------------------------------------------------------------- +# Extract Tk version numbers +#------------------------------------------------------------------------- + +!if defined(PROJECT_REQUIRES_TK) || "$(PROJECT)" == "tk" + +!if [echo TK_MAJOR_VERSION = \>> versions.vc] \ + && [nmakehlp -V $(_TK_H) TK_MAJOR_VERSION >> versions.vc] +!endif +!if [echo TK_MINOR_VERSION = \>> versions.vc] \ + && [nmakehlp -V $(_TK_H) TK_MINOR_VERSION >> versions.vc] +!endif +!if [echo TK_PATCH_LEVEL = \>> versions.vc] \ + && [nmakehlp -V $(_TK_H) TK_PATCH_LEVEL >> versions.vc] +!endif + +!include versions.vc + +TK_DOTVERSION = $(TK_MAJOR_VERSION).$(TK_MINOR_VERSION) +TK_VERSION = $(TK_MAJOR_VERSION)$(TK_MINOR_VERSION) + +!if "$(PROJECT)" != "tk" +!if $(TKINSTALL) +WISH = "$(_TKDIR)\bin\wish$(TK_VERSION)$(SUFX).exe" +!if !exist($(WISH)) +WISH = "$(_TKDIR)\bin\wish$(TK_VERSION)$(SUFX:x=).exe" +!endif +TKSTUBLIB = "$(_TKDIR)\lib\tkstub$(TK_VERSION).lib" +TKIMPLIB = "$(_TKDIR)\lib\tk$(TK_VERSION)$(SUFX).lib" +!if !exist($(TKIMPLIB)) +TKIMPLIB = "$(_TKDIR)\win\$(BUILDDIRTOP)\tk$(TCL_VERSION)$(SUFX:x=).lib" +!endif +TK_INCLUDES = -I"$(_TKDIR)\include" +!else +WISH = "$(_TKDIR)\win\$(BUILDDIRTOP)\wish$(TCL_VERSION)$(SUFX).exe" +!if !exist($(WISH)) +WISH = "$(_TKDIR)\win\$(BUILDDIRTOP)\wish$(TCL_VERSION)$(SUFX:x=).exe" +!endif +TKSTUBLIB = "$(_TKDIR)\win\$(BUILDDIRTOP)\tkstub$(TCL_VERSION).lib" +TKIMPLIB = "$(_TKDIR)\win\$(BUILDDIRTOP)\tk$(TCL_VERSION)$(SUFX).lib" +!if !exist($(TKIMPLIB)) +TKIMPLIB = "$(_TKDIR)\win\$(BUILDDIRTOP)\tk$(TCL_VERSION)$(SUFX:x=).lib" +!endif +TK_INCLUDES = -I"$(_TKDIR)\generic" -I"$(_TKDIR)\win" -I"$(_TKDIR)\xlib" +!endif +!endif + +!endif + +#---------------------------------------------------------- +# Display stats being used. +#---------------------------------------------------------- + +!message *** Intermediate directory will be '$(TMP_DIR)' +!message *** Output directory will be '$(OUT_DIR)' +!message *** Suffix for binaries will be '$(SUFX)' +!message *** Optional defines are '$(OPTDEFINES)' +!message *** Compiler version $(VCVER). Target machine is $(MACHINE) +!message *** Host architecture is $(NATIVE_ARCH) +!message *** Compiler options '$(COMPILERFLAGS) $(OPTIMIZATIONS) $(DEBUGFLAGS) $(WARNINGS)' +!message *** Link options '$(LINKERFLAGS)' + +!endif diff --git a/win/tkConfig.sh.in b/win/tkConfig.sh.in index 7816b15..c511312 100644 --- a/win/tkConfig.sh.in +++ b/win/tkConfig.sh.in @@ -1,5 +1,5 @@ # tkConfig.sh -- -# +# # This shell script (for sh) is generated automatically by Tk's # configure script. It will create shell variables for most of # the configuration options discovered by the configure script. -- cgit v0.12