Import Tk 8.6.8

This commit is contained in:
Cheryl Sabella
2018-02-22 14:31:15 -05:00
parent b1c28856bb
commit 8e57feeeb9
193 changed files with 6172 additions and 4033 deletions

View File

@@ -11,37 +11,20 @@
# Copyright (c) 2001-2005 ActiveState Corporation.
# Copyright (c) 2001-2004 David Gravereaux.
# Copyright (c) 2003-2008 Pat Thoyts.
# Copyright (c) 2017 Ashok P. Nadkarni
#------------------------------------------------------------------------------
# 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:
# General usage:
# nmake [-nologo] -f makefile.vc [TARGET|MACRODEF [TARGET|MACRODEF] [...]]
#
# 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.
# For MACRODEF, see TIP 477 (https://core.tcl.tk/tips/doc/trunk/tip/477.md)
# or examine Sections 6-8 in rules.vc. This makefile has the following
# values for the OPTS macro in addition to the ones described there.
# noxp = If you do not have the uxtheme.h header then you
# cannot include support for XP themeing.
# square = Include the demo square widget.
#
# 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:
# Possible values for TARGET are:
# release -- Builds the core, the shell and the dlls. (default)
# dlls -- Just builds the windows extensions.
# shell -- Just builds the shell and the core.
@@ -62,136 +45,59 @@ the build instructions.
# troff manual pages found in $(ROOT)\doc. You need to
# have installed the HTML Help Compiler package from Microsoft
# to produce the .chm file.
# winhelp -- Builds the windows .hlp file for Tcl from the troff man
# files found in $(ROOT)\doc.
#
# 4) Macros usable on the commandline:
# TCLDIR=<path>
# 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.
# The steps to setup a Visual C++ environment depend on which
# version of Visual Studio and/or the Windows SDK you are building
# against and are not described here. The simplest method is generally
# to start a command shell using one of the short cuts installed by
# Visual Studio/Windows SDK for the appropriate target architecture.
#
# INSTALLDIR=<path>
# Sets where to install Tcl from the built binaries.
# C:\Progra~1\Tcl is assumed when not specified.
# NOTE: For older (Visual C++ 6 or the 2003 SDK), 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.
#
# 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.
# Examples:
# Assumign Tcl sources lie in ../../tcl
# c:\tcl_src\win\>nmake -f makefile.vc release
# If Tcl sources are not in ../../tcl, use the TCLDIR macro to specify dir
# c:\tcl_src\win\>nmake -f makefile.vc release TCLDIR=c:\src\tcl
# Run the test suite
# c:\tcl_src\win\>nmake -f makefile.vc test
# Install Tk in location specified by INSTALLDIR macro
# c:\tcl_src\win\>nmake -f makefile.vc install INSTALLDIR=c:\progra~1\tcl
# Build release with PDF files
# c:\tcl_src\win\>nmake -f makefile.vc release OPTS=pdbs
# Build debug version
# c:\tcl_src\win\>nmake -f makefile.vc release OPTS=symbols
#
# 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=<path>
# OUT_DIR=<path>
# 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)\<buildtype> by default.
#
# TESTPAT=<file>
# 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
# The PROJECT macro is used by rules.vc for generating appropriate
# macros and rules.
PROJECT = tk
!include "rules.vc"
# Default target to build if no target is specified. If unspecified, the
# rules.vc file will set up "all" as the target.
DEFAULT_BUILD_TARGET = release
# We have a custom resource file
RCFILE = tk.rc
# The rules.vc file does much of the hard work in terms of defining
# the build configuration, macros, output directories etc.
!include "rules-ext.vc"
# TCLINSTALL is set to 1 by rules.vc to indicate we are building against
# an installed Tcl and 0 if building against Tcl source. Tk needs the latter.
!message TCLINSTALL=$(TCLINSTALL)
!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...
# Extra makefile options processing for non-standard OPTS values ...
!if "$(OPTS)" == "" || [nmakehlp -f "$(OPTS)" "none"]
HAVE_UXTHEME_H = 1
TTK_SQUARE_WIDGET = 0
@@ -210,33 +116,11 @@ 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"
WISHC = "$(OUT_DIR)\$(WISHNAMEPREFIX)c$(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)
@@ -409,17 +293,15 @@ TKSTUBOBJS = \
$(TMP_DIR)\tkStubLib.obj \
$(TMP_DIR)\ttkStubLib.obj
WINDIR = $(ROOT)\win
GENERICDIR = $(ROOT)\generic
### The following paths CANNOT have spaces in them as they appear on
### the left side of implicit rules.
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)
# Additional include and C macro definitions for the implicit rules
# defined in rules.vc
PRJ_INCLUDES = -I"$(BITMAPDIR)" -I"$(XLIBDIR)"
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 \
@@ -432,110 +314,10 @@ CONFIG_DEFS =-DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 \
-DTTK_SQUARE_WIDGET=1 \
!endif
TK_DEFINES =-DBUILD_ttk $(OPTDEFINES) $(CONFIG_DEFS) -Dinline=__inline
PRJ_DEFINES = -DBUILD_ttk $(CONFIG_DEFS) -Dinline=__inline -D _CRT_SECURE_NO_DEPRECATE -D _CRT_NONSTDC_NO_DEPRECATE
#---------------------------------------------------------------------
# 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 $(MSVCRT) && !($(DEBUG) && !$(UNCHECKED)) && $(VCVERSION) >= 1900
lflags = $(lflags) -nodefaultlib:libucrt.lib
!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
tcllibs = $(TCLSTUBLIB) $(TCLIMPLIB)
baselibs = netapi32.lib kernel32.lib user32.lib advapi32.lib userenv.lib ws2_32.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
!if $(MSVCRT) && !($(DEBUG) && !$(UNCHECKED)) && $(VCVERSION) >= 1900
baselibs = $(baselibs) ucrt.lib
!endif
guilibs = $(baselibs) gdi32.lib
# Additional Link libraries needed beyond those in rules.vc
PRJ_LIBS = netapi32.lib gdi32.lib user32.lib userenv.lib
#---------------------------------------------------------------------
@@ -546,7 +328,6 @@ guilibs = $(baselibs) gdi32.lib
TESTFLAGS = $(TESTFLAGS) -file $(TESTPAT)
!endif
#---------------------------------------------------------------------
# Project specific targets
#---------------------------------------------------------------------
@@ -558,12 +339,13 @@ cwish: $(WISHC)
install: install-binaries install-libraries install-docs
tktest: setup $(TKTEST) $(CAT32)
setup: default-setup
test: test-classic test-ttk
test-classic: setup $(TKTEST) $(TKLIB) $(CAT32)
@set TCL_LIBRARY=$(TCL_LIBRARY:\=/)
@set TK_LIBRARY=$(TK_LIBRARY:\=/)
@set TK_LIBRARY=$(LIBDIR:\=/)
@set TCLLIBPATH=
!if $(TCLINSTALL)
@set PATH=$(_TCLDIR)\bin;$(PATH)
@@ -574,7 +356,7 @@ test-classic: setup $(TKTEST) $(TKLIB) $(CAT32)
test-ttk: setup $(TKTEST) $(TKLIB) $(CAT32)
@set TCL_LIBRARY=$(TCL_LIBRARY:\=/)
@set TK_LIBRARY=$(TK_LIBRARY:\=/)
@set TK_LIBRARY=$(LIBDIR:\=/)
@set TCLLIBPATH=
!if $(TCLINSTALL)
@set PATH=$(_TCLDIR)\bin;$(PATH)
@@ -585,7 +367,7 @@ test-ttk: setup $(TKTEST) $(TKLIB) $(CAT32)
runtest: setup $(TKTEST) $(TKLIB) $(CAT32)
@set TCL_LIBRARY=$(TCL_LIBRARY:\=/)
@set TK_LIBRARY=$(TK_LIBRARY:\=/)
@set TK_LIBRARY=$(LIBDIR:\=/)
@set TCLLIBPATH=
!if $(TCLINSTALL)
@set PATH=$(_TCLDIR)\bin;$(PATH)
@@ -596,7 +378,7 @@ runtest: setup $(TKTEST) $(TKLIB) $(CAT32)
rundemo: setup $(TKTEST) $(TKLIB) $(CAT32)
@set TCL_LIBRARY=$(TCL_LIBRARY:\=/)
@set TK_LIBRARY=$(TK_LIBRARY:\=/)
@set TK_LIBRARY=$(LIBDIR:\=/)
@set TCLLIBPATH=
!if $(TCLINSTALL)
@set PATH=$(_TCLDIR)\bin;$(PATH)
@@ -607,7 +389,7 @@ rundemo: setup $(TKTEST) $(TKLIB) $(CAT32)
shell: setup $(WISH)
@set TCL_LIBRARY=$(TCL_LIBRARY:\=/)
@set TK_LIBRARY=$(TK_LIBRARY:\=/)
@set TK_LIBRARY=$(LIBDIR:\=/)
@set TCLLIBPATH=
!if $(TCLINSTALL)
@set PATH=$(_TCLDIR)\bin;$(PATH)
@@ -620,7 +402,7 @@ shell: setup $(WISH)
dbgshell: setup $(WISH)
@set TCL_LIBRARY=$(TCL_LIBRARY:\=/)
@set TK_LIBRARY=$(TK_LIBRARY:\=/)
@set TK_LIBRARY=$(LIBDIR:\=/)
@set TCLLIBPATH=
!if $(TCLINSTALL)
@set PATH=$(_TCLDIR)\bin;$(PATH)
@@ -629,51 +411,48 @@ dbgshell: setup $(WISH)
!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
!if $(STATIC_BUILD)
$(TKLIB): $(TKOBJS)
!if $(STATIC_BUILD)
$(lib32) -nologo -out:$@ @<<
$(LIBCMD) @<<
$**
<<
!else
$(link32) $(dlllflags) -base:@$(COFFBASE),tk -out:$@ $(guilibs) \
$(TCLSTUBLIB) @<<
$(TKLIB): $(TKOBJS)
$(DLLCMD) @<<
$**
<<
$(_VC_MANIFEST_EMBED_DLL)
-@del $*.exp
!endif
@if exist $*.exp del $*.exp
$(TKIMPLIB): $(TKLIB)
!endif # $(STATIC_BUILD)
$(TKSTUBLIB): $(TKSTUBOBJS)
$(lib32) -nologo -nodefaultlib -out:$@ $**
$(LIBCMD) -nodefaultlib $**
$(WISH): $(WISHOBJS) $(TKSTUBLIB) $(TKIMPLIB)
$(link32) $(guilflags) -stack:2300000 -out:$@ $(guilibs) $(tcllibs) $**
$(GUIEXECMD) -stack:2300000 $**
$(_VC_MANIFEST_EMBED_EXE)
$(WISHC): $(WISHOBJS) $(TKSTUBLIB) $(TKIMPLIB)
$(link32) $(conlflags) -stack:2300000 -out:$@ $(guilibs) $(tcllibs) $**
$(CONEXECMD) -stack:2300000 $**
$(_VC_MANIFEST_EMBED_EXE)
$(TKTEST): $(TKTESTOBJS) $(TKSTUBLIB) $(TKIMPLIB)
$(link32) $(guilflags) -stack:2300000 -out:$@ $(guilibs) $(tcllibs) $**
$(GUIEXECMD) -stack:2300000 $**
$(_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)
$(cc32) $(cflags) $(crt) -D_CRT_NONSTDC_NO_DEPRECATE -DCONSOLE -Fo$(TMP_DIR)\ $?
$(CONEXECMD) -DCONSOLE -stack:16384 $(TMP_DIR)\cat.obj
$(_VC_MANIFEST_EMBED_EXE)
#---------------------------------------------------------------------
@@ -694,12 +473,13 @@ genstubs:
# 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""
!if defined(PROCESSOR_ARCHITECTURE) && "$(PROCESSOR_ARCHITECTURE)" == "AMD64"
HHC="%ProgramFiles(x86)%\HTML Help Workshop\hhc.exe"
!else
HHC="%ProgramFiles%\HTML Help Workshop\hhc.exe"
!endif
HTMLDIR=$(ROOT)\html
HTMLBASE=TclTk$(VERSION)
HTMLBASE=TclTk$(TCL_VERSION)
HHPFILE=$(HTMLDIR)\$(HTMLBASE).hhp
CHMFILE=$(HTMLDIR)\$(HTMLBASE).chm
@@ -708,14 +488,14 @@ htmlhelp: chmsetup $(CHMFILE)
$(CHMFILE): $(DOCDIR)\*
@$(TCLSH) $(TCLTOOLSDIR)\tcltk-man2html.tcl
@echo Compiling HTML help project
@$(HHC) <<$(HHPFILE) >NUL
@"$(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
Title=Tcl/Tk $(TCL_DOTVERSION) Help
[FILES]
contents.htm
docs.css
@@ -730,137 +510,54 @@ 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
!if exist("$(CHMFILE)")
@echo Installing compiled HTML help
@$(CPY) "$(CHMFILE)" "$(DOC_INSTALL_DIR)\"
!endif
# "emacs font-lock highlighting fix
#---------------------------------------------------------------------
# Special case object file targets
#---------------------------------------------------------------------
$(TMP_DIR)\testMain.obj: $(WINDIR)\winMain.c
$(cc32) $(WISH_CFLAGS) -DTK_TEST \
$(cc32) $(appcflags_nostubs) -DTK_TEST \
-DTCL_USE_STATIC_PACKAGES=$(TCL_USE_STATIC_PACKAGES) \
-Fo$@ $?
$(TMP_DIR)\tkTest.obj: $(GENERICDIR)\tkTest.c
$(cc32) $(WISH_CFLAGS) -Fo$@ $?
$(cc32) $(appcflags_nostubs) -Fo$@ $?
$(TMP_DIR)\tkOldTest.obj: $(GENERICDIR)\tkOldTest.c
$(cc32) $(WISH_CFLAGS) -Fo$@ $?
$(cc32) $(appcflags_nostubs) -Fo$@ $?
$(TMP_DIR)\tkWinTest.obj: $(WINDIR)\tkWinTest.c
$(cc32) $(WISH_CFLAGS) -Fo$@ $?
$(cc32) $(appcflags_nostubs) -Fo$@ $?
$(TMP_DIR)\tkSquare.obj: $(GENERICDIR)\tkSquare.c
$(cc32) $(WISH_CFLAGS) -Fo$@ $?
$(cc32) $(appcflags_nostubs) -Fo$@ $?
$(TMP_DIR)\winMain.obj: $(WINDIR)\winMain.c
$(cc32) $(WISH_CFLAGS) \
$(cc32) $(appcflags_nostubs) \
-DTCL_USE_STATIC_PACKAGES=$(TCL_USE_STATIC_PACKAGES) \
-Fo$@ $?
$(TMP_DIR)\tkMain2.obj: $(GENERICDIR)\tkMain.c
$(cc32) -DBUILD_tk $(TK_CFLAGS) -DTK_ASCII_MAIN -Fo$@ $?
$(cc32) $(pkgcflags) -DTK_ASCII_MAIN -Fo$@ $?
# The following objects are part of the stub library and should not
# be built as DLL objects but none of the symbols should be exported
# and no reference made to a C runtime.
$(TMP_DIR)\tkStubLib.obj : $(GENERICDIR)\tkStubLib.c
$(cc32) $(STUB_CFLAGS) $(TK_INCLUDES) -Zl -DSTATIC_BUILD -Fo$@ $?
$(cc32) $(stubscflags) -Fo$@ $?
$(TMP_DIR)\wish.exe.manifest: $(WINDIR)\wish.exe.manifest.in
@nmakehlp -s << $** >$@
@MACHINE@ $(MACHINE:IX86=X86)
@TK_WIN_VERSION@ $(TK_DOTVERSION).0.0
@TK_WIN_VERSION@ $(DOTVERSION).0.0
<<
#---------------------------------------------------------------------
@@ -908,37 +605,20 @@ $(TMP_DIR)\tk.res: \
#---------------------------------------------------------------------
{$(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)\ @<<
$(CCPKGCMD) @<<
$<
<<
{$(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)\ @<<
$(CCPKGCMD) @<<
$<
<<
{$(ROOT)\unix}.c{$(TMP_DIR)}.obj::
$(cc32) -DBUILD_tk $(TK_CFLAGS) -Fo$(TMP_DIR)\ @<<
$(CCPKGCMD) @<<
$<
<<
{$(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
@@ -953,7 +633,7 @@ $(TMP_DIR)\wish.res: $(TMP_DIR)\wish.exe.manifest
install-binaries:
@echo installing binaries
@$(CPY) "$(WISH)" "$(BIN_INSTALL_DIR)\"
!if $(TKLIB) != $(TKIMPLIB)
!if "$(TKLIB)" != "$(TKIMPLIB)"
@$(CPY) "$(TKLIB)" "$(BIN_INSTALL_DIR)\"
!endif
@$(CPY) "$(TKIMPLIB)" "$(LIB_INSTALL_DIR)\"
@@ -964,7 +644,7 @@ install-binaries:
if {[catch {package present Tcl 8.6.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]
package ifneeded Tk $(TK_PATCH_LEVEL) [list load [file join $$dir .. .. bin libtk$(DOTVERSION).dll] Tk]
} else {
package ifneeded Tk $(TK_PATCH_LEVEL) [list load [file join $$dir .. .. bin $(TKLIBNAME)] Tk]
}
@@ -982,16 +662,16 @@ install-libraries:
@$(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)\"
@$(CPY) "$(LIBDIR)\*" "$(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\"
@$(CPY) "$(LIBDIR)\ttk\*" "$(SCRIPT_INSTALL_DIR)\ttk\"
@echo installing images
@$(CPY) "$(ROOT)\library\images\*" "$(SCRIPT_INSTALL_DIR)\images\"
@$(CPY) "$(LIBDIR)\images\*" "$(SCRIPT_INSTALL_DIR)\images\"
@echo installing language files
@$(CPY) "$(ROOT)\library\msgs\*" "$(SCRIPT_INSTALL_DIR)\msgs\"
@$(CPY) "$(LIBDIR)\msgs\*" "$(SCRIPT_INSTALL_DIR)\msgs\"
@echo installing demos
@$(CPY) "$(DEMODIR)\*" "$(DEMO_INSTALL_DIR)\"
@$(CPY) "$(DEMODIR)\images\*" "$(DEMO_INSTALL_DIR)\images\"
#"
@@ -999,8 +679,11 @@ install-libraries:
# Clean up
#---------------------------------------------------------------------
clean: default-clean
realclean: hose
hose: default-hose
tidy:
!if $(TKLIB) != $(TKIMPLIB)
!if "$(TKLIB)" != "$(TKIMPLIB)"
@echo Removing $(TKLIB) ...
@if exist $(TKLIB) del $(TKLIB)
!endif
@@ -1013,24 +696,3 @@ tidy:
@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)