sl@0: #------------------------------------------------------------------------------
sl@0: # makefile.vc --
sl@0: #
sl@0: #	Microsoft Visual C++ makefile for use with nmake.exe v1.62+ (VC++ 5.0+)
sl@0: #
sl@0: # See the file "license.terms" for information on usage and redistribution
sl@0: # of this file, and for a DISCLAIMER OF ALL WARRANTIES.
sl@0: # 
sl@0: # Copyright (c) 1995-1996 Sun Microsystems, Inc.
sl@0: # Copyright (c) 1998-2000 Ajuba Solutions.
sl@0: # Copyright (c) 2001-2005 ActiveState Corporation.
sl@0: # Copyright (c) 2001-2002 David Gravereaux.
sl@0: #
sl@0: #------------------------------------------------------------------------------
sl@0: # RCS: @(#) $Id: makefile.vc,v 1.100.2.9 2006/09/26 21:40:36 patthoyts Exp $
sl@0: #------------------------------------------------------------------------------
sl@0: 
sl@0: # Check to see we are configured to build with MSVC (MSDEVDIR or MSVCDIR)
sl@0: # or with the MS Platform SDK (MSSDK). Visual Studio .NET 2003 and 2005 define
sl@0: # VCINSTALLDIR instead.
sl@0: !if !defined(MSDEVDIR) && !defined(MSVCDIR) && !defined(MSSDK) && !defined(VCINSTALLDIR)
sl@0: MSG = ^
sl@0: You need to run vcvars32.bat from Developer Studio or setenv.bat from the^
sl@0: Platform SDK first to setup the environment.  Jump to this line to read^
sl@0: the build instructions.
sl@0: !error $(MSG)
sl@0: !endif
sl@0: 
sl@0: #------------------------------------------------------------------------------
sl@0: # HOW TO USE this makefile:
sl@0: #
sl@0: # 1)  It is now necessary to have MSVCDir, MSDevDir or MSSDK set in the
sl@0: #     environment.  This is used as a check to see if vcvars32.bat had been
sl@0: #     run prior to running nmake or during the installation of Microsoft
sl@0: #     Visual C++, MSVCDir had been set globally and the PATH adjusted.
sl@0: #     Either way is valid.
sl@0: #
sl@0: #     You'll need to run vcvars32.bat contained in the MsDev's vc(98)/bin
sl@0: #     directory to setup the proper environment, if needed, for your
sl@0: #     current setup.  This is a needed bootstrap requirement and allows the
sl@0: #     swapping of different environments to be easier.
sl@0: #
sl@0: # 2)  To use the Platform SDK (not expressly needed), run setenv.bat after
sl@0: #     vcvars32.bat according to the instructions for it.  This can also
sl@0: #     turn on the 64-bit compiler, if your SDK has it.
sl@0: #
sl@0: # 3)  Targets are:
sl@0: #	release  -- Builds the core, the shell and the dlls. (default)
sl@0: #	dlls     -- Just builds the windows extensions and the 16-bit DOS
sl@0: #		    pipe/thunk helper app.
sl@0: #	shell    -- Just builds the shell and the core.
sl@0: #	core     -- Only builds the core [tclXX.(dll|lib)].
sl@0: #	all      -- Builds everything.
sl@0: #	test     -- Builds and runs the test suite.
sl@0: #	tcltest  -- Just builds the test shell.
sl@0: #	install  -- Installs the built binaries and libraries to $(INSTALLDIR)
sl@0: #		    as the root of the install tree.
sl@0: #	tidy/clean/hose -- varying levels of cleaning.
sl@0: #	genstubs -- Rebuilds the Stubs table and support files (dev only).
sl@0: #	depend   -- Generates an accurate set of source dependancies for this
sl@0: #		    makefile.  Helpful to avoid problems when the sources are
sl@0: #		    refreshed and you rebuild, but can "overbuild" when common
sl@0: #		    headers like tclInt.h just get small changes.
sl@0: #	winhelp  -- Builds the windows .hlp file for Tcl from the troff man
sl@0: #		    files found in $(ROOT)\doc .
sl@0: #
sl@0: # 4)  Macros usable on the commandline:
sl@0: #	INSTALLDIR=<path>
sl@0: #		Sets where to install Tcl from the built binaries.
sl@0: #		C:\Progra~1\Tcl is assumed when not specified.
sl@0: #
sl@0: #	OPTS=static,msvcrt,staticpkg,threads,symbols,profile,loimpact,none
sl@0: #		Sets special options for the core.  The default is for none.
sl@0: #		Any combination of the above may be used (comma separated).
sl@0: #		'none' will over-ride everything to nothing.
sl@0: #
sl@0: #		static  =  Builds a static library of the core instead of a
sl@0: #			   dll.  The shell will be static (and large), as well.
sl@0: #		msvcrt  =  Effects the static option only to switch it from
sl@0: #			   using libcmt(d) as the C runtime [by default] to
sl@0: #			   msvcrt(d). This is useful for static embedding
sl@0: #			   support.
sl@0: #		staticpkg = Effects the static option only to switch
sl@0: #			   tclshXX.exe to have the dde and reg extension linked
sl@0: #			   inside it.
sl@0: #		threads =  Turns on full multithreading support.
sl@0: #		thrdalloc = Use the thread allocator (shared global free pool).
sl@0: #		symbols =  Adds symbols for step debugging.
sl@0: #		profile =  Adds profiling hooks.  Map file is assumed.
sl@0: #		loimpact =  Adds a flag for how NT treats the heap to keep memory
sl@0: #			   in use, low.  This is said to impact alloc performance.
sl@0: #
sl@0: #	STATS=memdbg,compdbg,none
sl@0: #		Sets optional memory and bytecode compiler debugging code added
sl@0: #		to the core.  The default is for none.  Any combination of the
sl@0: #		above may be used (comma separated).  'none' will over-ride
sl@0: #		everything to nothing.
sl@0: #
sl@0: #		memdbg   = Enables the debugging memory allocator.
sl@0: #		compdbg  = Enables byte compilation logging.
sl@0: #
sl@0: #	MACHINE=(IX86|IA64|ALPHA)
sl@0: #		Set the machine type used for the compiler, linker, and
sl@0: #		resource compiler.  This hook is needed to tell the tools
sl@0: #		when alternate platforms are requested.  IX86 is the default
sl@0: #		when not specified.
sl@0: #
sl@0: #	TMP_DIR=<path>
sl@0: #	OUT_DIR=<path>
sl@0: #		Hooks to allow the intermediate and output directories to be
sl@0: #		changed.  $(OUT_DIR) is assumed to be 
sl@0: #		$(BINROOT)\(Release|Debug) based on if symbols are requested.
sl@0: #		$(TMP_DIR) will de $(OUT_DIR)\<buildtype> by default.
sl@0: #
sl@0: #	TESTPAT=<file>
sl@0: #		Reads the tests requested to be run from this file.
sl@0: #
sl@0: # 5)  Examples:
sl@0: #
sl@0: #	Basic syntax of calling nmake looks like this:
sl@0: #	nmake [-nologo] -f makefile.vc [target|macrodef [target|macrodef] [...]]
sl@0: #
sl@0: #                        Standard (no frills)
sl@0: #       c:\tcl_src\win\>c:\progra~1\micros~1\vc98\bin\vcvars32.bat
sl@0: #       Setting environment for using Microsoft Visual C++ tools.
sl@0: #       c:\tcl_src\win\>nmake -f makefile.vc release
sl@0: #       c:\tcl_src\win\>nmake -f makefile.vc install INSTALLDIR=c:\progra~1\tcl
sl@0: #
sl@0: #                         Building for Win64
sl@0: #       c:\tcl_src\win\>c:\progra~1\micros~1\vc98\bin\vcvars32.bat
sl@0: #       Setting environment for using Microsoft Visual C++ tools.
sl@0: #       c:\tcl_src\win\>c:\progra~1\platfo~1\setenv.bat /pre64 /RETAIL
sl@0: #       Targeting Windows pre64 RETAIL
sl@0: #       c:\tcl_src\win\>nmake -f makefile.vc MACHINE=IA64
sl@0: #
sl@0: #------------------------------------------------------------------------------
sl@0: #==============================================================================
sl@0: ###############################################################################
sl@0: 
sl@0: 
sl@0: #    //==================================================================\\
sl@0: #   >>[               -> Do not modify below this line. <-               ]<<
sl@0: #   >>[  Please, use the commandline macros to modify how Tcl is built.  ]<<
sl@0: #   >>[  If you need more features, send us a patch for more macros.     ]<<
sl@0: #    \\==================================================================//
sl@0: 
sl@0: 
sl@0: ###############################################################################
sl@0: #==============================================================================
sl@0: #------------------------------------------------------------------------------
sl@0: 
sl@0: !if !exist("makefile.vc")
sl@0: MSG = ^
sl@0: You must run this makefile only from the directory it is in.^
sl@0: Please `cd` to its location first.
sl@0: !error $(MSG)
sl@0: !endif
sl@0: 
sl@0: PROJECT	= tcl
sl@0: !include "rules.vc"
sl@0: 
sl@0: STUBPREFIX = $(PROJECT)stub
sl@0: DOTVERSION = 8.4
sl@0: VERSION = $(DOTVERSION:.=)
sl@0: 
sl@0: DDEDOTVERSION = 1.2
sl@0: DDEVERSION = $(DDEDOTVERSION:.=)
sl@0: 
sl@0: REGDOTVERSION = 1.1
sl@0: REGVERSION = $(REGDOTVERSION:.=)
sl@0: 
sl@0: BINROOT		= .
sl@0: ROOT		= ..
sl@0: 
sl@0: TCLIMPLIB	= $(OUT_DIR)\$(PROJECT)$(VERSION)$(SUFX).lib
sl@0: TCLLIBNAME	= $(PROJECT)$(VERSION)$(SUFX).$(EXT)
sl@0: TCLLIB		= $(OUT_DIR)\$(TCLLIBNAME)
sl@0: 
sl@0: TCLSTUBLIBNAME	= $(STUBPREFIX)$(VERSION).lib
sl@0: TCLSTUBLIB	= $(OUT_DIR)\$(TCLSTUBLIBNAME)
sl@0: 
sl@0: TCLSHNAME	= $(PROJECT)sh$(VERSION)$(SUFX).exe
sl@0: TCLSH		= $(OUT_DIR)\$(TCLSHNAME)
sl@0: TCLPIPEDLLNAME	= $(PROJECT)pip$(VERSION)$(SUFX:t=).dll
sl@0: TCLPIPEDLL	= $(OUT_DIR)\$(TCLPIPEDLLNAME)
sl@0: 
sl@0: TCLREGLIBNAME	= $(PROJECT)reg$(REGVERSION)$(SUFX:t=).$(EXT)
sl@0: TCLREGLIB	= $(OUT_DIR)\$(TCLREGLIBNAME)
sl@0: 
sl@0: TCLDDELIBNAME	= $(PROJECT)dde$(DDEVERSION)$(SUFX:t=).$(EXT)
sl@0: TCLDDELIB	= $(OUT_DIR)\$(TCLDDELIBNAME)
sl@0: 
sl@0: TCLTEST		= $(OUT_DIR)\$(PROJECT)test.exe
sl@0: CAT32		= $(OUT_DIR)\cat32.exe
sl@0: 
sl@0: ### Make sure we use backslash only.
sl@0: LIB_INSTALL_DIR		= $(_INSTALLDIR)\lib
sl@0: BIN_INSTALL_DIR		= $(_INSTALLDIR)\bin
sl@0: DOC_INSTALL_DIR		= $(_INSTALLDIR)\doc
sl@0: SCRIPT_INSTALL_DIR	= $(_INSTALLDIR)\lib\tcl$(DOTVERSION)
sl@0: INCLUDE_INSTALL_DIR	= $(_INSTALLDIR)\include
sl@0: 
sl@0: TCLSHOBJS = \
sl@0: 	$(TMP_DIR)\tclAppInit.obj \
sl@0: !if $(TCL_USE_STATIC_PACKAGES)
sl@0: 	$(TMP_DIR)\tclWinReg.obj \
sl@0: 	$(TMP_DIR)\tclWinDde.obj \
sl@0: !endif
sl@0: 	$(TMP_DIR)\tclsh.res
sl@0: 
sl@0: TCLTESTOBJS = \
sl@0: 	$(TMP_DIR)\tclTest.obj \
sl@0: 	$(TMP_DIR)\tclTestObj.obj \
sl@0: 	$(TMP_DIR)\tclTestProcBodyObj.obj \
sl@0: 	$(TMP_DIR)\tclThreadTest.obj \
sl@0: 	$(TMP_DIR)\tclWinTest.obj \
sl@0: !if $(TCL_USE_STATIC_PACKAGES)
sl@0: 	$(TMP_DIR)\tclWinReg.obj \
sl@0: 	$(TMP_DIR)\tclWinDde.obj \
sl@0: !endif
sl@0: 	$(TMP_DIR)\testMain.obj
sl@0: 
sl@0: TCLOBJS = \
sl@0: 	$(TMP_DIR)\regcomp.obj \
sl@0: 	$(TMP_DIR)\regerror.obj \
sl@0: 	$(TMP_DIR)\regexec.obj \
sl@0: 	$(TMP_DIR)\regfree.obj \
sl@0: 	$(TMP_DIR)\strftime.obj \
sl@0: 	$(TMP_DIR)\strtoll.obj \
sl@0: 	$(TMP_DIR)\strtoull.obj \
sl@0: 	$(TMP_DIR)\tclAlloc.obj \
sl@0: 	$(TMP_DIR)\tclAsync.obj \
sl@0: 	$(TMP_DIR)\tclBasic.obj \
sl@0: 	$(TMP_DIR)\tclBinary.obj \
sl@0: 	$(TMP_DIR)\tclCkalloc.obj \
sl@0: 	$(TMP_DIR)\tclClock.obj \
sl@0: 	$(TMP_DIR)\tclCmdAH.obj \
sl@0: 	$(TMP_DIR)\tclCmdIL.obj \
sl@0: 	$(TMP_DIR)\tclCmdMZ.obj \
sl@0: 	$(TMP_DIR)\tclCompCmds.obj \
sl@0: 	$(TMP_DIR)\tclCompExpr.obj \
sl@0: 	$(TMP_DIR)\tclCompile.obj \
sl@0: 	$(TMP_DIR)\tclDate.obj \
sl@0: 	$(TMP_DIR)\tclEncoding.obj \
sl@0: 	$(TMP_DIR)\tclEnv.obj \
sl@0: 	$(TMP_DIR)\tclEvent.obj \
sl@0: 	$(TMP_DIR)\tclExecute.obj \
sl@0: 	$(TMP_DIR)\tclFCmd.obj \
sl@0: 	$(TMP_DIR)\tclFileName.obj \
sl@0: 	$(TMP_DIR)\tclGet.obj \
sl@0: 	$(TMP_DIR)\tclHash.obj \
sl@0: 	$(TMP_DIR)\tclHistory.obj \
sl@0: 	$(TMP_DIR)\tclIndexObj.obj \
sl@0: 	$(TMP_DIR)\tclInterp.obj \
sl@0: 	$(TMP_DIR)\tclIO.obj \
sl@0: 	$(TMP_DIR)\tclIOCmd.obj \
sl@0: 	$(TMP_DIR)\tclIOGT.obj \
sl@0: 	$(TMP_DIR)\tclIOSock.obj \
sl@0: 	$(TMP_DIR)\tclIOUtil.obj \
sl@0: 	$(TMP_DIR)\tclLink.obj \
sl@0: 	$(TMP_DIR)\tclListObj.obj \
sl@0: 	$(TMP_DIR)\tclLiteral.obj \
sl@0: 	$(TMP_DIR)\tclLoad.obj \
sl@0: 	$(TMP_DIR)\tclMain.obj \
sl@0: 	$(TMP_DIR)\tclNamesp.obj \
sl@0: 	$(TMP_DIR)\tclNotify.obj \
sl@0: 	$(TMP_DIR)\tclObj.obj \
sl@0: 	$(TMP_DIR)\tclPanic.obj \
sl@0: 	$(TMP_DIR)\tclParse.obj \
sl@0: 	$(TMP_DIR)\tclParseExpr.obj \
sl@0: 	$(TMP_DIR)\tclPipe.obj \
sl@0: 	$(TMP_DIR)\tclPkg.obj \
sl@0: 	$(TMP_DIR)\tclPosixStr.obj \
sl@0: 	$(TMP_DIR)\tclPreserve.obj \
sl@0: 	$(TMP_DIR)\tclProc.obj \
sl@0: 	$(TMP_DIR)\tclRegexp.obj \
sl@0: 	$(TMP_DIR)\tclResolve.obj \
sl@0: 	$(TMP_DIR)\tclResult.obj \
sl@0: 	$(TMP_DIR)\tclScan.obj \
sl@0: 	$(TMP_DIR)\tclStringObj.obj \
sl@0: 	$(TMP_DIR)\tclStubInit.obj \
sl@0: 	$(TMP_DIR)\tclStubLib.obj \
sl@0: 	$(TMP_DIR)\tclThread.obj \
sl@0: 	$(TMP_DIR)\tclThreadAlloc.obj \
sl@0: 	$(TMP_DIR)\tclThreadJoin.obj \
sl@0: 	$(TMP_DIR)\tclTimer.obj \
sl@0: 	$(TMP_DIR)\tclUtf.obj \
sl@0: 	$(TMP_DIR)\tclUtil.obj \
sl@0: 	$(TMP_DIR)\tclVar.obj \
sl@0: 	$(TMP_DIR)\tclWin32Dll.obj \
sl@0: 	$(TMP_DIR)\tclWinChan.obj \
sl@0: 	$(TMP_DIR)\tclWinConsole.obj \
sl@0: 	$(TMP_DIR)\tclWinSerial.obj \
sl@0: 	$(TMP_DIR)\tclWinError.obj \
sl@0: 	$(TMP_DIR)\tclWinFCmd.obj \
sl@0: 	$(TMP_DIR)\tclWinFile.obj \
sl@0: 	$(TMP_DIR)\tclWinInit.obj \
sl@0: 	$(TMP_DIR)\tclWinLoad.obj \
sl@0: 	$(TMP_DIR)\tclWinMtherr.obj \
sl@0: 	$(TMP_DIR)\tclWinNotify.obj \
sl@0: 	$(TMP_DIR)\tclWinPipe.obj \
sl@0: 	$(TMP_DIR)\tclWinSock.obj \
sl@0: 	$(TMP_DIR)\tclWinThrd.obj \
sl@0: 	$(TMP_DIR)\tclWinTime.obj \
sl@0: !if !$(STATIC_BUILD)
sl@0: 	$(TMP_DIR)\tcl.res
sl@0: !endif
sl@0: 
sl@0: TCLSTUBOBJS = $(TMP_DIR)\tclStubLib.obj
sl@0: 
sl@0: ### The following paths CANNOT have spaces in them.
sl@0: COMPATDIR	= $(ROOT)\compat
sl@0: DOCDIR		= $(ROOT)\doc
sl@0: GENERICDIR	= $(ROOT)\generic
sl@0: TOOLSDIR	= $(ROOT)\tools
sl@0: WINDIR		= $(ROOT)\win
sl@0: 
sl@0: 
sl@0: #---------------------------------------------------------------------
sl@0: # Compile flags
sl@0: #---------------------------------------------------------------------
sl@0: 
sl@0: !if !$(DEBUG)
sl@0: !if $(OPTIMIZING)
sl@0: ### This cranks the optimization level to maximize speed
sl@0: cdebug	= -O2 $(OPTIMIZATIONS)
sl@0: !else
sl@0: cdebug	=
sl@0: !endif
sl@0: !else if "$(MACHINE)" == "IA64"
sl@0: ### Warnings are too many, can't support warnings into errors.
sl@0: cdebug	= -Z7 -Od $(DEBUGFLAGS)
sl@0: !else
sl@0: cdebug	= -Z7 -WX $(DEBUGFLAGS)
sl@0: !endif
sl@0: 
sl@0: ### Declarations common to all compiler options
sl@0: cwarn = -D _CRT_SECURE_NO_DEPRECATE -D _CRT_NONSTDC_NO_DEPRECATE
sl@0: cflags = -nologo -c $(COMPILERFLAGS) $(cwarn) -Fp$(TMP_DIR)^\
sl@0: 
sl@0: !if $(FULLWARNINGS)
sl@0: cflags = $(cflags) -W4
sl@0: !else
sl@0: cflags = $(cflags) -W3
sl@0: !endif
sl@0: 
sl@0: !if $(MSVCRT)
sl@0: !if "$(DBGX)" == ""
sl@0: crt = -MD
sl@0: !else
sl@0: crt = -MDd
sl@0: !endif
sl@0: !else
sl@0: !if "$(DBGX)" == ""
sl@0: crt = -MT
sl@0: !else
sl@0: crt = -MTd
sl@0: !endif
sl@0: !endif
sl@0: 
sl@0: TCL_INCLUDES	= -I"$(WINDIR)" -I"$(GENERICDIR)"
sl@0: BASE_CFLAGS	= $(cflags) $(cdebug) $(crt) $(TCL_INCLUDES) \
sl@0: 			-DTCL_PIPE_DLL=\"$(TCLPIPEDLLNAME)\"
sl@0: CON_CFLAGS	= $(cflags) $(cdebug) $(crt) -DCONSOLE
sl@0: TCL_CFLAGS	= $(BASE_CFLAGS) $(OPTDEFINES)
sl@0: 
sl@0: 
sl@0: #---------------------------------------------------------------------
sl@0: # Link flags
sl@0: #---------------------------------------------------------------------
sl@0: 
sl@0: !if $(DEBUG)
sl@0: ldebug	= -debug:full -debugtype:cv
sl@0: !else
sl@0: ldebug	= -release -opt:ref -opt:icf,3
sl@0: !endif
sl@0: 
sl@0: ### Declarations common to all linker options
sl@0: lflags	= -nologo -machine:$(MACHINE) $(LINKERFLAGS) $(ldebug)
sl@0: 
sl@0: !if $(FULLWARNINGS)
sl@0: lflags = $(lflags) -warn:3
sl@0: !endif
sl@0: 
sl@0: !if $(PROFILE)
sl@0: lflags	= $(lflags) -profile
sl@0: !endif
sl@0: 
sl@0: !if $(ALIGN98_HACK) && !$(STATIC_BUILD)
sl@0: ### Align sections for PE size savings.
sl@0: lflags	= $(lflags) -opt:nowin98
sl@0: !else if !$(ALIGN98_HACK) && $(STATIC_BUILD)
sl@0: ### Align sections for speed in loading by choosing the virtual page size.
sl@0: lflags	= $(lflags) -align:4096
sl@0: !endif
sl@0: 
sl@0: !if $(LOIMPACT)
sl@0: lflags	= $(lflags) -ws:aggressive
sl@0: !endif
sl@0: 
sl@0: dlllflags = $(lflags) -dll
sl@0: conlflags = $(lflags) -subsystem:console
sl@0: guilflags = $(lflags) -subsystem:windows
sl@0: 
sl@0: baselibs  = kernel32.lib advapi32.lib user32.lib
sl@0: # Avoid 'unresolved external symbol __security_cookie' errors.
sl@0: # c.f. http://support.microsoft.com/?id=894573
sl@0: !if "$(MACHINE)" == "IA64" || "$(MACHINE)" == "AMD64"
sl@0: baselibs   = $(baselibs) bufferoverflowU.lib
sl@0: !endif
sl@0: 
sl@0: #---------------------------------------------------------------------
sl@0: # TclTest flags
sl@0: #---------------------------------------------------------------------
sl@0: 
sl@0: !IF "$(TESTPAT)" != ""
sl@0: TESTFLAGS = -file $(TESTPAT)
sl@0: !ENDIF
sl@0: 
sl@0: 
sl@0: #---------------------------------------------------------------------
sl@0: # Project specific targets
sl@0: #---------------------------------------------------------------------
sl@0: 
sl@0: release:    setup $(TCLSH) $(TCLSTUBLIB) dlls
sl@0: core:	    setup $(TCLLIB) $(TCLSTUBLIB)
sl@0: shell:	    setup $(TCLSH)
sl@0: dlls:	    setup $(TCLPIPEDLL) $(TCLREGLIB) $(TCLDDELIB)
sl@0: all:	    setup $(TCLSH) $(TCLSTUBLIB) dlls $(CAT32) 
sl@0: tcltest:    setup $(TCLTEST) dlls $(CAT32)
sl@0: install:    install-binaries install-libraries install-docs
sl@0: 
sl@0: 
sl@0: test: setup $(TCLTEST) dlls $(CAT32)
sl@0: 	set TCL_LIBRARY=$(ROOT)/library
sl@0: !if "$(OS)" == "Windows_NT"  || "$(MSVCDIR)" == "IDE"
sl@0: 	$(TCLTEST) "$(ROOT)/tests/all.tcl" $(TESTFLAGS)
sl@0: !else
sl@0: 	$(TCLTEST) "$(ROOT)/tests/all.tcl" $(TESTFLAGS) > tests.log
sl@0: 	type tests.log | more
sl@0: !endif
sl@0: 
sl@0: runtest: setup $(TCLTEST) dlls $(CAT32)
sl@0:        set TCL_LIBRARY=$(ROOT)/library
sl@0:        $(TCLTEST)
sl@0: 
sl@0: setup:
sl@0: 	@if not exist $(OUT_DIR)\nul mkdir $(OUT_DIR)
sl@0: 	@if not exist $(TMP_DIR)\nul mkdir $(TMP_DIR)
sl@0: 
sl@0: !if !$(STATIC_BUILD)
sl@0: $(TCLIMPLIB): $(TCLLIB)
sl@0: !endif
sl@0: 
sl@0: $(TCLLIB): $(TCLOBJS)
sl@0: !if $(STATIC_BUILD)
sl@0: 	$(lib32) -nologo -out:$@ @<<
sl@0: $**
sl@0: <<
sl@0: !else
sl@0: 	$(link32) $(dlllflags) -base:@$(WINDIR)\coffbase.txt,tcl -out:$@ \
sl@0: 		$(baselibs) @<<
sl@0: $**
sl@0: <<
sl@0: 	$(_VC_MANIFEST_EMBED_DLL)
sl@0: 	-@del $*.exp
sl@0: !endif
sl@0: 
sl@0: $(TCLSTUBLIB): $(TCLSTUBOBJS)
sl@0: 	$(lib32) -nologo -out:$@ $(TCLSTUBOBJS)
sl@0: 
sl@0: $(TCLSH): $(TCLSHOBJS) $(TCLIMPLIB)
sl@0: 	$(link32) $(conlflags) -stack:2300000 -out:$@ $(baselibs) $**
sl@0: 	$(_VC_MANIFEST_EMBED_EXE)
sl@0: 
sl@0: $(TCLTEST): $(TCLTESTOBJS) $(TCLIMPLIB)
sl@0: 	$(link32) $(conlflags) -stack:2300000 -out:$@ $(baselibs) $**
sl@0: 	$(_VC_MANIFEST_EMBED_EXE)
sl@0: 
sl@0: $(TCLPIPEDLL): $(WINDIR)\stub16.c
sl@0: 	$(cc32) $(CON_CFLAGS) -Fo$(TMP_DIR)\ $(WINDIR)\stub16.c
sl@0: 	$(link32) $(conlflags) -out:$@ $(TMP_DIR)\stub16.obj $(baselibs)
sl@0: 	$(_VC_MANIFEST_EMBED_DLL)
sl@0: 
sl@0: !if $(STATIC_BUILD)
sl@0: $(TCLDDELIB): $(TMP_DIR)\tclWinDde.obj
sl@0: 	$(lib32) -nologo -out:$@ $(TMP_DIR)\tclWinDde.obj
sl@0: !else
sl@0: $(TCLDDELIB): $(TMP_DIR)\tclWinDde.obj $(TCLSTUBLIB)
sl@0: 	$(link32) $(dlllflags) -base:@$(WINDIR)\coffbase.txt,tcldde -out:$@ \
sl@0: 		$** $(baselibs)
sl@0: 	$(_VC_MANIFEST_EMBED_DLL)
sl@0: 	-@del $*.exp
sl@0: 	-@del $*.lib
sl@0: !endif
sl@0: 
sl@0: !if $(STATIC_BUILD)
sl@0: $(TCLREGLIB): $(TMP_DIR)\tclWinReg.obj
sl@0: 	$(lib32) -nologo -out:$@ $(TMP_DIR)\tclWinReg.obj
sl@0: !else
sl@0: $(TCLREGLIB): $(TMP_DIR)\tclWinReg.obj $(TCLSTUBLIB)
sl@0: 	$(link32) $(dlllflags) -base:@$(WINDIR)\coffbase.txt,tclreg -out:$@ \
sl@0: 		$** $(baselibs)
sl@0: 	$(_VC_MANIFEST_EMBED_DLL)
sl@0: 	-@del $*.exp
sl@0: 	-@del $*.lib
sl@0: !endif
sl@0: 
sl@0: $(CAT32): $(WINDIR)\cat.c
sl@0: 	$(cc32) $(CON_CFLAGS) -Fo$(TMP_DIR)\ $?
sl@0: 	$(link32) $(conlflags) -out:$@ -stack:16384 $(TMP_DIR)\cat.obj \
sl@0: 		$(baselibs)
sl@0:         $(_VC_MANIFEST_EMBED_EXE)
sl@0: 
sl@0: #---------------------------------------------------------------------
sl@0: # Regenerate the stubs files.  [Development use only]
sl@0: #---------------------------------------------------------------------
sl@0: 
sl@0: genstubs:
sl@0: !if !exist($(TCLSH))
sl@0: 	@echo Build tclsh first!
sl@0: !else
sl@0: 	$(TCLSH) $(TOOLSDIR:\=/)\genStubs.tcl $(GENERICDIR:\=/) \
sl@0: 		$(GENERICDIR:\=/)/tcl.decls $(GENERICDIR:\=/)/tclInt.decls
sl@0: !endif
sl@0: 
sl@0: 
sl@0: #---------------------------------------------------------------------
sl@0: # Generate the makefile depedancies.
sl@0: #---------------------------------------------------------------------
sl@0: 
sl@0: depend:
sl@0: !if !exist($(TCLSH))
sl@0: 	@echo Build tclsh first!
sl@0: !else
sl@0: 	$(TCLSH) $(TOOLSDIR:\=/)/mkdepend.tcl -vc32 -out:"$(OUT_DIR)\depend.mk" \
sl@0: 		-passthru:"-DBUILD_tcl $(TCL_INCLUDES:"="")" $(GENERICDIR) \
sl@0: 		$(COMPATDIR) $(WINDIR) @<<
sl@0: $(TCLOBJS)
sl@0: <<
sl@0: !endif
sl@0: 
sl@0: 
sl@0: #---------------------------------------------------------------------
sl@0: # Build the windows help file.
sl@0: #---------------------------------------------------------------------
sl@0: 
sl@0: TCLHLPBASE	= $(PROJECT)$(VERSION)
sl@0: HELPFILE	= $(OUT_DIR)\$(TCLHLPBASE).hlp
sl@0: HELPCNT		= $(OUT_DIR)\$(TCLHLPBASE).cnt
sl@0: DOCTMP_DIR	= $(OUT_DIR)\$(PROJECT)_docs
sl@0: HELPRTF		= $(DOCTMP_DIR)\$(PROJECT).rtf
sl@0: MAN2HELP	= $(DOCTMP_DIR)\man2help.tcl
sl@0: MAN2HELP2	= $(DOCTMP_DIR)\man2help2.tcl
sl@0: INDEX		= $(DOCTMP_DIR)\index.tcl
sl@0: BMP		= $(DOCTMP_DIR)\feather.bmp
sl@0: BMP_NOPATH	= feather.bmp
sl@0: MAN2TCL		= $(DOCTMP_DIR)\man2tcl.exe
sl@0: 
sl@0: winhelp: docsetup $(HELPFILE)
sl@0: 
sl@0: docsetup:
sl@0: 	@if not exist $(DOCTMP_DIR)\nul mkdir $(DOCTMP_DIR)
sl@0: 
sl@0: $(MAN2HELP) $(MAN2HELP2) $(INDEX) $(BMP): $(TOOLSDIR)\$$(@F)
sl@0: 	@$(CPY) $(TOOLSDIR)\$(@F) $(@D)
sl@0: 
sl@0: $(HELPFILE): $(HELPRTF) $(BMP)
sl@0: 	cd $(DOCTMP_DIR)
sl@0: 	start /wait hcrtf.exe -x <<$(PROJECT).hpj
sl@0: [OPTIONS]
sl@0: COMPRESS=12 Hall Zeck
sl@0: LCID=0x409 0x0 0x0 ; English (United States)
sl@0: TITLE=Tcl/Tk Reference Manual
sl@0: BMROOT=.
sl@0: CNT=$(@B).cnt
sl@0: HLP=$(@B).hlp
sl@0: 
sl@0: [FILES]
sl@0: $(PROJECT).rtf
sl@0: 
sl@0: [WINDOWS]
sl@0: main="Tcl/Tk Reference Manual",,27648,(r15263976),(r65535)
sl@0: 
sl@0: [CONFIG]
sl@0: BrowseButtons()
sl@0: CreateButton(1, "Web", ExecFile("http://www.tcl.tk"))
sl@0: CreateButton(2, "SF", ExecFile("http://sf.net/projects/tcl"))
sl@0: CreateButton(3, "Wiki", ExecFile("http://wiki.tcl.tk"))
sl@0: CreateButton(4, "FAQ", ExecFile("http://www.purl.org/NET/Tcl-FAQ/"))
sl@0: <<
sl@0: 	cd $(MAKEDIR)
sl@0: 	@$(CPY) "$(DOCTMP_DIR)\$(@B).hlp" "$(OUT_DIR)"
sl@0: 	@$(CPY) "$(DOCTMP_DIR)\$(@B).cnt" "$(OUT_DIR)"
sl@0: 
sl@0: $(MAN2TCL): $(TOOLSDIR)\$$(@B).c
sl@0: 	$(cc32) -nologo -G4 -ML -O2 -Fo$(@D)\ $(TOOLSDIR)\$(@B).c -link -out:$@
sl@0: 
sl@0: $(HELPRTF): $(MAN2TCL) $(MAN2HELP) $(MAN2HELP2) $(INDEX) $(DOCDIR)\*
sl@0: 	$(TCLSH) $(MAN2HELP) -bitmap $(BMP_NOPATH) $(PROJECT) $(VERSION) $(DOCDIR:\=/)
sl@0: 
sl@0: install-docs:
sl@0: !if exist($(HELPFILE))
sl@0: 	@$(CPY) "$(HELPFILE)" "$(DOC_INSTALL_DIR)\"
sl@0: 	@$(CPY) "$(HELPCNT)" "$(DOC_INSTALL_DIR)\"
sl@0: !endif
sl@0: 
sl@0: 
sl@0: #---------------------------------------------------------------------
sl@0: # Special case object file targets
sl@0: #---------------------------------------------------------------------
sl@0: 
sl@0: $(TMP_DIR)\testMain.obj: $(WINDIR)\tclAppInit.c
sl@0: !if $(TCL_USE_STATIC_PACKAGES)
sl@0: 	$(cc32) $(TCL_CFLAGS) -DTCL_TEST -DTCL_USE_STATIC_PACKAGES -Fo$@ $?
sl@0: !else
sl@0: 	$(cc32) $(TCL_CFLAGS) -DTCL_TEST -Fo$@ $?
sl@0: !endif
sl@0: 
sl@0: $(TMP_DIR)\tclTest.obj: $(GENERICDIR)\tclTest.c
sl@0: 	$(cc32) $(TCL_CFLAGS) -Fo$@ $?
sl@0: 
sl@0: $(TMP_DIR)\tclTestObj.obj: $(GENERICDIR)\tclTestObj.c
sl@0: 	$(cc32) $(TCL_CFLAGS) -Fo$@ $?
sl@0: 
sl@0: $(TMP_DIR)\tclWinTest.obj: $(WINDIR)\tclWinTest.c
sl@0: 	$(cc32) $(TCL_CFLAGS) -Fo$@ $?
sl@0: 
sl@0: $(TMP_DIR)\tclAppInit.obj: $(WINDIR)\tclAppInit.c
sl@0: !if $(TCL_USE_STATIC_PACKAGES)
sl@0: 	$(cc32) $(TCL_CFLAGS) -DTCL_USE_STATIC_PACKAGES -Fo$@ $?
sl@0: !else
sl@0: 	$(cc32) $(TCL_CFLAGS) -Fo$@ $?
sl@0: !endif
sl@0: 
sl@0: ### The following objects should be built using the stub interfaces
sl@0: ### *ALL* extensions need to built with -DTCL_THREADS=1
sl@0: 
sl@0: $(TMP_DIR)\tclWinReg.obj: $(WINDIR)\tclWinReg.c
sl@0: !if $(STATIC_BUILD)
sl@0: 	$(cc32) $(BASE_CFLAGS) -DTCL_THREADS=1 -DSTATIC_BUILD -Fo$@ $?
sl@0: !else
sl@0: 	$(cc32) $(BASE_CFLAGS) -DTCL_THREADS=1 -DUSE_TCL_STUBS -Fo$@ $?
sl@0: !endif
sl@0: 
sl@0: 
sl@0: $(TMP_DIR)\tclWinDde.obj: $(WINDIR)\tclWinDde.c
sl@0: !if $(STATIC_BUILD)
sl@0: 	$(cc32) $(BASE_CFLAGS) -DTCL_THREADS=1 -DSTATIC_BUILD -Fo$@ $?
sl@0: !else
sl@0: 	$(cc32) $(BASE_CFLAGS) -DTCL_THREADS=1 -DUSE_TCL_STUBS -Fo$@ $?
sl@0: !endif
sl@0: 
sl@0: 
sl@0: ### The following objects are part of the stub library and should not
sl@0: ### be built as DLL objects.  -Zl is used to avoid a dependancy on any
sl@0: ### specific C run-time.
sl@0: 
sl@0: $(TMP_DIR)\tclStubLib.obj: $(GENERICDIR)\tclStubLib.c
sl@0: 	$(cc32) $(cdebug) $(cflags) -Zl -DSTATIC_BUILD $(TCL_INCLUDES) -Fo$@ $?
sl@0: 
sl@0: 
sl@0: #---------------------------------------------------------------------
sl@0: # Dedependency rules
sl@0: #---------------------------------------------------------------------
sl@0: 
sl@0: $(GENERICDIR)\regcomp.c: \
sl@0: 	$(GENERICDIR)\regguts.h \
sl@0: 	$(GENERICDIR)\regc_lex.c \
sl@0: 	$(GENERICDIR)\regc_color.c \
sl@0: 	$(GENERICDIR)\regc_nfa.c \
sl@0: 	$(GENERICDIR)\regc_cvec.c \
sl@0: 	$(GENERICDIR)\regc_locale.c
sl@0: $(GENERICDIR)\regcustom.h: \
sl@0: 	$(GENERICDIR)\tclInt.h \
sl@0: 	$(GENERICDIR)\tclPort.h \
sl@0: 	$(GENERICDIR)\regex.h
sl@0: $(GENERICDIR)\regexec.c: \
sl@0: 	$(GENERICDIR)\rege_dfa.c \
sl@0: 	$(GENERICDIR)\regguts.h
sl@0: $(GENERICDIR)\regerror.c: $(GENERICDIR)\regguts.h
sl@0: $(GENERICDIR)\regfree.c: $(GENERICDIR)\regguts.h
sl@0: $(GENERICDIR)\regfronts.c: $(GENERICDIR)\regguts.h
sl@0: $(GENERICDIR)\regguts.h: $(GENERICDIR)\regcustom.h
sl@0: 
sl@0: !if exist("$(OUT_DIR)\depend.mk")
sl@0: !include "$(OUT_DIR)\depend.mk"
sl@0: !message *** Dependency rules in effect.
sl@0: !else
sl@0: !message *** Dependency rules are not being used.
sl@0: !endif
sl@0: 
sl@0: ### add a spacer in the output
sl@0: !message
sl@0: 
sl@0: 
sl@0: #---------------------------------------------------------------------
sl@0: # Implicit rules
sl@0: #---------------------------------------------------------------------
sl@0: 
sl@0: {$(WINDIR)}.c{$(TMP_DIR)}.obj::
sl@0:     $(cc32) $(TCL_CFLAGS) -DBUILD_tcl -Fo$(TMP_DIR)\ @<<
sl@0: $<
sl@0: <<
sl@0: 
sl@0: {$(GENERICDIR)}.c{$(TMP_DIR)}.obj::
sl@0:     $(cc32) $(TCL_CFLAGS) -DBUILD_tcl -Fo$(TMP_DIR)\ @<<
sl@0: $<
sl@0: <<
sl@0: 
sl@0: {$(COMPATDIR)}.c{$(TMP_DIR)}.obj::
sl@0:     $(cc32) $(TCL_CFLAGS) -DBUILD_tcl -Fo$(TMP_DIR)\ @<<
sl@0: $<
sl@0: <<
sl@0: 
sl@0: {$(WINDIR)}.rc{$(TMP_DIR)}.res:
sl@0: 	$(rc32) -fo $@ -r -i "$(GENERICDIR)" -D__WIN32__ \
sl@0: !if $(DEBUG)
sl@0: 	-d DEBUG \
sl@0: !endif
sl@0: !if $(TCL_THREADS)
sl@0: 	-d TCL_THREADS \
sl@0: !endif
sl@0: !if $(STATIC_BUILD)
sl@0: 	-d STATIC_BUILD \
sl@0: !endif
sl@0: 	$<
sl@0: 
sl@0: .SUFFIXES:
sl@0: .SUFFIXES:.c .rc
sl@0: 
sl@0: 
sl@0: #---------------------------------------------------------------------
sl@0: # Installation.
sl@0: #---------------------------------------------------------------------
sl@0: 
sl@0: install-binaries:
sl@0: 	@echo Installing to '$(_INSTALLDIR)'
sl@0: 	@echo installing $(TCLLIBNAME)
sl@0: !if "$(TCLLIB)" != "$(TCLIMPLIB)"
sl@0: 	@$(CPY) "$(TCLLIB)" "$(BIN_INSTALL_DIR)\"
sl@0: !endif
sl@0: 	@$(CPY) "$(TCLIMPLIB)" "$(LIB_INSTALL_DIR)\"
sl@0: !if exist($(TCLSH))
sl@0: 	@echo installing $(TCLSHNAME)
sl@0: 	@$(CPY) "$(TCLSH)" "$(BIN_INSTALL_DIR)\"
sl@0: !endif
sl@0: !if exist($(TCLPIPEDLL))
sl@0: 	@echo installing $(TCLPIPEDLLNAME)
sl@0: 	@$(CPY) "$(TCLPIPEDLL)" "$(BIN_INSTALL_DIR)\"
sl@0: !endif
sl@0: 	@echo installing $(TCLSTUBLIBNAME)
sl@0: 	@$(CPY) "$(TCLSTUBLIB)" "$(LIB_INSTALL_DIR)\"
sl@0: 
sl@0: install-libraries:
sl@0: 	@echo installing http1.0
sl@0: 	@$(CPY) "$(ROOT)\library\http1.0\*.tcl" \
sl@0: 		"$(SCRIPT_INSTALL_DIR)\http1.0\"
sl@0: 	@echo installing http2.5
sl@0: 	@$(CPY) "$(ROOT)\library\http\*.tcl" \
sl@0: 		"$(SCRIPT_INSTALL_DIR)\http2.5\"
sl@0: 	@echo installing opt0.4
sl@0: 	@$(CPY) "$(ROOT)\library\opt\*.tcl" \
sl@0: 		"$(SCRIPT_INSTALL_DIR)\opt0.4\"
sl@0: 	@echo installing msgcat1.3
sl@0: 	@$(CPY) "$(ROOT)\library\msgcat\*.tcl" \
sl@0: 	    "$(SCRIPT_INSTALL_DIR)\msgcat1.3\"
sl@0: 	@echo installing tcltest2.2 
sl@0: 	@$(CPY) "$(ROOT)\library\tcltest\*.tcl" \
sl@0: 	    "$(SCRIPT_INSTALL_DIR)\tcltest2.2\"
sl@0: 	@echo installing $(TCLDDELIBNAME)
sl@0: !if $(STATIC_BUILD)
sl@0: 	@$(CPY) "$(TCLDDELIB)" "$(LIB_INSTALL_DIR)\"
sl@0: !else
sl@0: 	@$(CPY) "$(TCLDDELIB)" "$(LIB_INSTALL_DIR)\dde$(DDEDOTVERSION)\"
sl@0: 	@$(CPY) "$(ROOT)\library\dde\pkgIndex.tcl" \
sl@0: 	    "$(LIB_INSTALL_DIR)\dde$(DDEDOTVERSION)\"
sl@0: !endif
sl@0: 	@echo installing $(TCLREGLIBNAME)
sl@0: !if $(STATIC_BUILD)
sl@0: 	@$(CPY) "$(TCLREGLIB)" "$(LIB_INSTALL_DIR)\"
sl@0: !else
sl@0: 	@$(CPY) "$(TCLREGLIB)" "$(LIB_INSTALL_DIR)\reg$(REGDOTVERSION)\"
sl@0: 	@$(CPY) "$(ROOT)\library\reg\pkgIndex.tcl" \
sl@0: 	    "$(LIB_INSTALL_DIR)\reg$(REGDOTVERSION)\"
sl@0: !endif
sl@0: 	@echo installing encoding files
sl@0: 	@$(CPY) "$(ROOT)\library\encoding\*.enc" \
sl@0: 		"$(SCRIPT_INSTALL_DIR)\encoding\"
sl@0: 	@echo installing library files
sl@0: 	@$(CPY) "$(GENERICDIR)\tcl.h"          "$(INCLUDE_INSTALL_DIR)\"
sl@0: 	@$(CPY) "$(GENERICDIR)\tclDecls.h"     "$(INCLUDE_INSTALL_DIR)\"
sl@0: 	@$(CPY) "$(GENERICDIR)\tclPlatDecls.h" "$(INCLUDE_INSTALL_DIR)\"
sl@0: 	@$(CPY) "$(ROOT)\library\history.tcl"  "$(SCRIPT_INSTALL_DIR)\"
sl@0: 	@$(CPY) "$(ROOT)\library\init.tcl"     "$(SCRIPT_INSTALL_DIR)\"
sl@0: 	@$(CPY) "$(ROOT)\library\ldAout.tcl"   "$(SCRIPT_INSTALL_DIR)\"
sl@0: 	@$(CPY) "$(ROOT)\library\parray.tcl"   "$(SCRIPT_INSTALL_DIR)\"
sl@0: 	@$(CPY) "$(ROOT)\library\safe.tcl"     "$(SCRIPT_INSTALL_DIR)\"
sl@0: 	@$(CPY) "$(ROOT)\library\tclIndex"     "$(SCRIPT_INSTALL_DIR)\"
sl@0: 	@$(CPY) "$(ROOT)\library\package.tcl"  "$(SCRIPT_INSTALL_DIR)\"
sl@0: 	@$(CPY) "$(ROOT)\library\word.tcl"     "$(SCRIPT_INSTALL_DIR)\"
sl@0: 	@$(CPY) "$(ROOT)\library\auto.tcl"     "$(SCRIPT_INSTALL_DIR)\"
sl@0: 
sl@0: 
sl@0: #---------------------------------------------------------------------
sl@0: # Clean up
sl@0: #---------------------------------------------------------------------
sl@0: 
sl@0: tidy:
sl@0: 	@echo Removing $(TCLLIB) ...
sl@0: 	@if exist $(TCLLIB) del $(TCLLIB)
sl@0: 	@echo Removing $(TCLSH) ...
sl@0: 	@if exist $(TCLSH) del $(TCLSH)
sl@0: 	@echo Removing $(TCLTEST) ...
sl@0: 	@if exist $(TCLTEST) del $(TCLTEST)
sl@0: 	@echo Removing $(TCLDDELIB) ...
sl@0: 	@if exist $(TCLDDELIB) del $(TCLDDELIB)
sl@0: 	@echo Removing $(TCLREGLIB) ...
sl@0: 	@if exist $(TCLREGLIB) del $(TCLREGLIB)
sl@0: 
sl@0: clean:
sl@0: 	@echo Cleaning $(TMP_DIR)\* ...
sl@0: 	@if exist $(TMP_DIR)\nul $(RMDIR) $(TMP_DIR)
sl@0: 
sl@0: hose:
sl@0: 	@echo Hosing $(OUT_DIR)\* ...
sl@0: 	@if exist $(OUT_DIR)\nul $(RMDIR) $(OUT_DIR)
sl@0: