os/persistentdata/persistentstorage/sqlite3api/TEST/TCL/tcldistribution/win/makefile.vc
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
     1 #------------------------------------------------------------------------------
     2 # makefile.vc --
     3 #
     4 #	Microsoft Visual C++ makefile for use with nmake.exe v1.62+ (VC++ 5.0+)
     5 #
     6 # See the file "license.terms" for information on usage and redistribution
     7 # of this file, and for a DISCLAIMER OF ALL WARRANTIES.
     8 # 
     9 # Copyright (c) 1995-1996 Sun Microsystems, Inc.
    10 # Copyright (c) 1998-2000 Ajuba Solutions.
    11 # Copyright (c) 2001-2005 ActiveState Corporation.
    12 # Copyright (c) 2001-2002 David Gravereaux.
    13 #
    14 #------------------------------------------------------------------------------
    15 # RCS: @(#) $Id: makefile.vc,v 1.100.2.9 2006/09/26 21:40:36 patthoyts Exp $
    16 #------------------------------------------------------------------------------
    17 
    18 # Check to see we are configured to build with MSVC (MSDEVDIR or MSVCDIR)
    19 # or with the MS Platform SDK (MSSDK). Visual Studio .NET 2003 and 2005 define
    20 # VCINSTALLDIR instead.
    21 !if !defined(MSDEVDIR) && !defined(MSVCDIR) && !defined(MSSDK) && !defined(VCINSTALLDIR)
    22 MSG = ^
    23 You need to run vcvars32.bat from Developer Studio or setenv.bat from the^
    24 Platform SDK first to setup the environment.  Jump to this line to read^
    25 the build instructions.
    26 !error $(MSG)
    27 !endif
    28 
    29 #------------------------------------------------------------------------------
    30 # HOW TO USE this makefile:
    31 #
    32 # 1)  It is now necessary to have MSVCDir, MSDevDir or MSSDK set in the
    33 #     environment.  This is used as a check to see if vcvars32.bat had been
    34 #     run prior to running nmake or during the installation of Microsoft
    35 #     Visual C++, MSVCDir had been set globally and the PATH adjusted.
    36 #     Either way is valid.
    37 #
    38 #     You'll need to run vcvars32.bat contained in the MsDev's vc(98)/bin
    39 #     directory to setup the proper environment, if needed, for your
    40 #     current setup.  This is a needed bootstrap requirement and allows the
    41 #     swapping of different environments to be easier.
    42 #
    43 # 2)  To use the Platform SDK (not expressly needed), run setenv.bat after
    44 #     vcvars32.bat according to the instructions for it.  This can also
    45 #     turn on the 64-bit compiler, if your SDK has it.
    46 #
    47 # 3)  Targets are:
    48 #	release  -- Builds the core, the shell and the dlls. (default)
    49 #	dlls     -- Just builds the windows extensions and the 16-bit DOS
    50 #		    pipe/thunk helper app.
    51 #	shell    -- Just builds the shell and the core.
    52 #	core     -- Only builds the core [tclXX.(dll|lib)].
    53 #	all      -- Builds everything.
    54 #	test     -- Builds and runs the test suite.
    55 #	tcltest  -- Just builds the test shell.
    56 #	install  -- Installs the built binaries and libraries to $(INSTALLDIR)
    57 #		    as the root of the install tree.
    58 #	tidy/clean/hose -- varying levels of cleaning.
    59 #	genstubs -- Rebuilds the Stubs table and support files (dev only).
    60 #	depend   -- Generates an accurate set of source dependancies for this
    61 #		    makefile.  Helpful to avoid problems when the sources are
    62 #		    refreshed and you rebuild, but can "overbuild" when common
    63 #		    headers like tclInt.h just get small changes.
    64 #	winhelp  -- Builds the windows .hlp file for Tcl from the troff man
    65 #		    files found in $(ROOT)\doc .
    66 #
    67 # 4)  Macros usable on the commandline:
    68 #	INSTALLDIR=<path>
    69 #		Sets where to install Tcl from the built binaries.
    70 #		C:\Progra~1\Tcl is assumed when not specified.
    71 #
    72 #	OPTS=static,msvcrt,staticpkg,threads,symbols,profile,loimpact,none
    73 #		Sets special options for the core.  The default is for none.
    74 #		Any combination of the above may be used (comma separated).
    75 #		'none' will over-ride everything to nothing.
    76 #
    77 #		static  =  Builds a static library of the core instead of a
    78 #			   dll.  The shell will be static (and large), as well.
    79 #		msvcrt  =  Effects the static option only to switch it from
    80 #			   using libcmt(d) as the C runtime [by default] to
    81 #			   msvcrt(d). This is useful for static embedding
    82 #			   support.
    83 #		staticpkg = Effects the static option only to switch
    84 #			   tclshXX.exe to have the dde and reg extension linked
    85 #			   inside it.
    86 #		threads =  Turns on full multithreading support.
    87 #		thrdalloc = Use the thread allocator (shared global free pool).
    88 #		symbols =  Adds symbols for step debugging.
    89 #		profile =  Adds profiling hooks.  Map file is assumed.
    90 #		loimpact =  Adds a flag for how NT treats the heap to keep memory
    91 #			   in use, low.  This is said to impact alloc performance.
    92 #
    93 #	STATS=memdbg,compdbg,none
    94 #		Sets optional memory and bytecode compiler debugging code added
    95 #		to the core.  The default is for none.  Any combination of the
    96 #		above may be used (comma separated).  'none' will over-ride
    97 #		everything to nothing.
    98 #
    99 #		memdbg   = Enables the debugging memory allocator.
   100 #		compdbg  = Enables byte compilation logging.
   101 #
   102 #	MACHINE=(IX86|IA64|ALPHA)
   103 #		Set the machine type used for the compiler, linker, and
   104 #		resource compiler.  This hook is needed to tell the tools
   105 #		when alternate platforms are requested.  IX86 is the default
   106 #		when not specified.
   107 #
   108 #	TMP_DIR=<path>
   109 #	OUT_DIR=<path>
   110 #		Hooks to allow the intermediate and output directories to be
   111 #		changed.  $(OUT_DIR) is assumed to be 
   112 #		$(BINROOT)\(Release|Debug) based on if symbols are requested.
   113 #		$(TMP_DIR) will de $(OUT_DIR)\<buildtype> by default.
   114 #
   115 #	TESTPAT=<file>
   116 #		Reads the tests requested to be run from this file.
   117 #
   118 # 5)  Examples:
   119 #
   120 #	Basic syntax of calling nmake looks like this:
   121 #	nmake [-nologo] -f makefile.vc [target|macrodef [target|macrodef] [...]]
   122 #
   123 #                        Standard (no frills)
   124 #       c:\tcl_src\win\>c:\progra~1\micros~1\vc98\bin\vcvars32.bat
   125 #       Setting environment for using Microsoft Visual C++ tools.
   126 #       c:\tcl_src\win\>nmake -f makefile.vc release
   127 #       c:\tcl_src\win\>nmake -f makefile.vc install INSTALLDIR=c:\progra~1\tcl
   128 #
   129 #                         Building for Win64
   130 #       c:\tcl_src\win\>c:\progra~1\micros~1\vc98\bin\vcvars32.bat
   131 #       Setting environment for using Microsoft Visual C++ tools.
   132 #       c:\tcl_src\win\>c:\progra~1\platfo~1\setenv.bat /pre64 /RETAIL
   133 #       Targeting Windows pre64 RETAIL
   134 #       c:\tcl_src\win\>nmake -f makefile.vc MACHINE=IA64
   135 #
   136 #------------------------------------------------------------------------------
   137 #==============================================================================
   138 ###############################################################################
   139 
   140 
   141 #    //==================================================================\\
   142 #   >>[               -> Do not modify below this line. <-               ]<<
   143 #   >>[  Please, use the commandline macros to modify how Tcl is built.  ]<<
   144 #   >>[  If you need more features, send us a patch for more macros.     ]<<
   145 #    \\==================================================================//
   146 
   147 
   148 ###############################################################################
   149 #==============================================================================
   150 #------------------------------------------------------------------------------
   151 
   152 !if !exist("makefile.vc")
   153 MSG = ^
   154 You must run this makefile only from the directory it is in.^
   155 Please `cd` to its location first.
   156 !error $(MSG)
   157 !endif
   158 
   159 PROJECT	= tcl
   160 !include "rules.vc"
   161 
   162 STUBPREFIX = $(PROJECT)stub
   163 DOTVERSION = 8.4
   164 VERSION = $(DOTVERSION:.=)
   165 
   166 DDEDOTVERSION = 1.2
   167 DDEVERSION = $(DDEDOTVERSION:.=)
   168 
   169 REGDOTVERSION = 1.1
   170 REGVERSION = $(REGDOTVERSION:.=)
   171 
   172 BINROOT		= .
   173 ROOT		= ..
   174 
   175 TCLIMPLIB	= $(OUT_DIR)\$(PROJECT)$(VERSION)$(SUFX).lib
   176 TCLLIBNAME	= $(PROJECT)$(VERSION)$(SUFX).$(EXT)
   177 TCLLIB		= $(OUT_DIR)\$(TCLLIBNAME)
   178 
   179 TCLSTUBLIBNAME	= $(STUBPREFIX)$(VERSION).lib
   180 TCLSTUBLIB	= $(OUT_DIR)\$(TCLSTUBLIBNAME)
   181 
   182 TCLSHNAME	= $(PROJECT)sh$(VERSION)$(SUFX).exe
   183 TCLSH		= $(OUT_DIR)\$(TCLSHNAME)
   184 TCLPIPEDLLNAME	= $(PROJECT)pip$(VERSION)$(SUFX:t=).dll
   185 TCLPIPEDLL	= $(OUT_DIR)\$(TCLPIPEDLLNAME)
   186 
   187 TCLREGLIBNAME	= $(PROJECT)reg$(REGVERSION)$(SUFX:t=).$(EXT)
   188 TCLREGLIB	= $(OUT_DIR)\$(TCLREGLIBNAME)
   189 
   190 TCLDDELIBNAME	= $(PROJECT)dde$(DDEVERSION)$(SUFX:t=).$(EXT)
   191 TCLDDELIB	= $(OUT_DIR)\$(TCLDDELIBNAME)
   192 
   193 TCLTEST		= $(OUT_DIR)\$(PROJECT)test.exe
   194 CAT32		= $(OUT_DIR)\cat32.exe
   195 
   196 ### Make sure we use backslash only.
   197 LIB_INSTALL_DIR		= $(_INSTALLDIR)\lib
   198 BIN_INSTALL_DIR		= $(_INSTALLDIR)\bin
   199 DOC_INSTALL_DIR		= $(_INSTALLDIR)\doc
   200 SCRIPT_INSTALL_DIR	= $(_INSTALLDIR)\lib\tcl$(DOTVERSION)
   201 INCLUDE_INSTALL_DIR	= $(_INSTALLDIR)\include
   202 
   203 TCLSHOBJS = \
   204 	$(TMP_DIR)\tclAppInit.obj \
   205 !if $(TCL_USE_STATIC_PACKAGES)
   206 	$(TMP_DIR)\tclWinReg.obj \
   207 	$(TMP_DIR)\tclWinDde.obj \
   208 !endif
   209 	$(TMP_DIR)\tclsh.res
   210 
   211 TCLTESTOBJS = \
   212 	$(TMP_DIR)\tclTest.obj \
   213 	$(TMP_DIR)\tclTestObj.obj \
   214 	$(TMP_DIR)\tclTestProcBodyObj.obj \
   215 	$(TMP_DIR)\tclThreadTest.obj \
   216 	$(TMP_DIR)\tclWinTest.obj \
   217 !if $(TCL_USE_STATIC_PACKAGES)
   218 	$(TMP_DIR)\tclWinReg.obj \
   219 	$(TMP_DIR)\tclWinDde.obj \
   220 !endif
   221 	$(TMP_DIR)\testMain.obj
   222 
   223 TCLOBJS = \
   224 	$(TMP_DIR)\regcomp.obj \
   225 	$(TMP_DIR)\regerror.obj \
   226 	$(TMP_DIR)\regexec.obj \
   227 	$(TMP_DIR)\regfree.obj \
   228 	$(TMP_DIR)\strftime.obj \
   229 	$(TMP_DIR)\strtoll.obj \
   230 	$(TMP_DIR)\strtoull.obj \
   231 	$(TMP_DIR)\tclAlloc.obj \
   232 	$(TMP_DIR)\tclAsync.obj \
   233 	$(TMP_DIR)\tclBasic.obj \
   234 	$(TMP_DIR)\tclBinary.obj \
   235 	$(TMP_DIR)\tclCkalloc.obj \
   236 	$(TMP_DIR)\tclClock.obj \
   237 	$(TMP_DIR)\tclCmdAH.obj \
   238 	$(TMP_DIR)\tclCmdIL.obj \
   239 	$(TMP_DIR)\tclCmdMZ.obj \
   240 	$(TMP_DIR)\tclCompCmds.obj \
   241 	$(TMP_DIR)\tclCompExpr.obj \
   242 	$(TMP_DIR)\tclCompile.obj \
   243 	$(TMP_DIR)\tclDate.obj \
   244 	$(TMP_DIR)\tclEncoding.obj \
   245 	$(TMP_DIR)\tclEnv.obj \
   246 	$(TMP_DIR)\tclEvent.obj \
   247 	$(TMP_DIR)\tclExecute.obj \
   248 	$(TMP_DIR)\tclFCmd.obj \
   249 	$(TMP_DIR)\tclFileName.obj \
   250 	$(TMP_DIR)\tclGet.obj \
   251 	$(TMP_DIR)\tclHash.obj \
   252 	$(TMP_DIR)\tclHistory.obj \
   253 	$(TMP_DIR)\tclIndexObj.obj \
   254 	$(TMP_DIR)\tclInterp.obj \
   255 	$(TMP_DIR)\tclIO.obj \
   256 	$(TMP_DIR)\tclIOCmd.obj \
   257 	$(TMP_DIR)\tclIOGT.obj \
   258 	$(TMP_DIR)\tclIOSock.obj \
   259 	$(TMP_DIR)\tclIOUtil.obj \
   260 	$(TMP_DIR)\tclLink.obj \
   261 	$(TMP_DIR)\tclListObj.obj \
   262 	$(TMP_DIR)\tclLiteral.obj \
   263 	$(TMP_DIR)\tclLoad.obj \
   264 	$(TMP_DIR)\tclMain.obj \
   265 	$(TMP_DIR)\tclNamesp.obj \
   266 	$(TMP_DIR)\tclNotify.obj \
   267 	$(TMP_DIR)\tclObj.obj \
   268 	$(TMP_DIR)\tclPanic.obj \
   269 	$(TMP_DIR)\tclParse.obj \
   270 	$(TMP_DIR)\tclParseExpr.obj \
   271 	$(TMP_DIR)\tclPipe.obj \
   272 	$(TMP_DIR)\tclPkg.obj \
   273 	$(TMP_DIR)\tclPosixStr.obj \
   274 	$(TMP_DIR)\tclPreserve.obj \
   275 	$(TMP_DIR)\tclProc.obj \
   276 	$(TMP_DIR)\tclRegexp.obj \
   277 	$(TMP_DIR)\tclResolve.obj \
   278 	$(TMP_DIR)\tclResult.obj \
   279 	$(TMP_DIR)\tclScan.obj \
   280 	$(TMP_DIR)\tclStringObj.obj \
   281 	$(TMP_DIR)\tclStubInit.obj \
   282 	$(TMP_DIR)\tclStubLib.obj \
   283 	$(TMP_DIR)\tclThread.obj \
   284 	$(TMP_DIR)\tclThreadAlloc.obj \
   285 	$(TMP_DIR)\tclThreadJoin.obj \
   286 	$(TMP_DIR)\tclTimer.obj \
   287 	$(TMP_DIR)\tclUtf.obj \
   288 	$(TMP_DIR)\tclUtil.obj \
   289 	$(TMP_DIR)\tclVar.obj \
   290 	$(TMP_DIR)\tclWin32Dll.obj \
   291 	$(TMP_DIR)\tclWinChan.obj \
   292 	$(TMP_DIR)\tclWinConsole.obj \
   293 	$(TMP_DIR)\tclWinSerial.obj \
   294 	$(TMP_DIR)\tclWinError.obj \
   295 	$(TMP_DIR)\tclWinFCmd.obj \
   296 	$(TMP_DIR)\tclWinFile.obj \
   297 	$(TMP_DIR)\tclWinInit.obj \
   298 	$(TMP_DIR)\tclWinLoad.obj \
   299 	$(TMP_DIR)\tclWinMtherr.obj \
   300 	$(TMP_DIR)\tclWinNotify.obj \
   301 	$(TMP_DIR)\tclWinPipe.obj \
   302 	$(TMP_DIR)\tclWinSock.obj \
   303 	$(TMP_DIR)\tclWinThrd.obj \
   304 	$(TMP_DIR)\tclWinTime.obj \
   305 !if !$(STATIC_BUILD)
   306 	$(TMP_DIR)\tcl.res
   307 !endif
   308 
   309 TCLSTUBOBJS = $(TMP_DIR)\tclStubLib.obj
   310 
   311 ### The following paths CANNOT have spaces in them.
   312 COMPATDIR	= $(ROOT)\compat
   313 DOCDIR		= $(ROOT)\doc
   314 GENERICDIR	= $(ROOT)\generic
   315 TOOLSDIR	= $(ROOT)\tools
   316 WINDIR		= $(ROOT)\win
   317 
   318 
   319 #---------------------------------------------------------------------
   320 # Compile flags
   321 #---------------------------------------------------------------------
   322 
   323 !if !$(DEBUG)
   324 !if $(OPTIMIZING)
   325 ### This cranks the optimization level to maximize speed
   326 cdebug	= -O2 $(OPTIMIZATIONS)
   327 !else
   328 cdebug	=
   329 !endif
   330 !else if "$(MACHINE)" == "IA64"
   331 ### Warnings are too many, can't support warnings into errors.
   332 cdebug	= -Z7 -Od $(DEBUGFLAGS)
   333 !else
   334 cdebug	= -Z7 -WX $(DEBUGFLAGS)
   335 !endif
   336 
   337 ### Declarations common to all compiler options
   338 cwarn = -D _CRT_SECURE_NO_DEPRECATE -D _CRT_NONSTDC_NO_DEPRECATE
   339 cflags = -nologo -c $(COMPILERFLAGS) $(cwarn) -Fp$(TMP_DIR)^\
   340 
   341 !if $(FULLWARNINGS)
   342 cflags = $(cflags) -W4
   343 !else
   344 cflags = $(cflags) -W3
   345 !endif
   346 
   347 !if $(MSVCRT)
   348 !if "$(DBGX)" == ""
   349 crt = -MD
   350 !else
   351 crt = -MDd
   352 !endif
   353 !else
   354 !if "$(DBGX)" == ""
   355 crt = -MT
   356 !else
   357 crt = -MTd
   358 !endif
   359 !endif
   360 
   361 TCL_INCLUDES	= -I"$(WINDIR)" -I"$(GENERICDIR)"
   362 BASE_CFLAGS	= $(cflags) $(cdebug) $(crt) $(TCL_INCLUDES) \
   363 			-DTCL_PIPE_DLL=\"$(TCLPIPEDLLNAME)\"
   364 CON_CFLAGS	= $(cflags) $(cdebug) $(crt) -DCONSOLE
   365 TCL_CFLAGS	= $(BASE_CFLAGS) $(OPTDEFINES)
   366 
   367 
   368 #---------------------------------------------------------------------
   369 # Link flags
   370 #---------------------------------------------------------------------
   371 
   372 !if $(DEBUG)
   373 ldebug	= -debug:full -debugtype:cv
   374 !else
   375 ldebug	= -release -opt:ref -opt:icf,3
   376 !endif
   377 
   378 ### Declarations common to all linker options
   379 lflags	= -nologo -machine:$(MACHINE) $(LINKERFLAGS) $(ldebug)
   380 
   381 !if $(FULLWARNINGS)
   382 lflags = $(lflags) -warn:3
   383 !endif
   384 
   385 !if $(PROFILE)
   386 lflags	= $(lflags) -profile
   387 !endif
   388 
   389 !if $(ALIGN98_HACK) && !$(STATIC_BUILD)
   390 ### Align sections for PE size savings.
   391 lflags	= $(lflags) -opt:nowin98
   392 !else if !$(ALIGN98_HACK) && $(STATIC_BUILD)
   393 ### Align sections for speed in loading by choosing the virtual page size.
   394 lflags	= $(lflags) -align:4096
   395 !endif
   396 
   397 !if $(LOIMPACT)
   398 lflags	= $(lflags) -ws:aggressive
   399 !endif
   400 
   401 dlllflags = $(lflags) -dll
   402 conlflags = $(lflags) -subsystem:console
   403 guilflags = $(lflags) -subsystem:windows
   404 
   405 baselibs  = kernel32.lib advapi32.lib user32.lib
   406 # Avoid 'unresolved external symbol __security_cookie' errors.
   407 # c.f. http://support.microsoft.com/?id=894573
   408 !if "$(MACHINE)" == "IA64" || "$(MACHINE)" == "AMD64"
   409 baselibs   = $(baselibs) bufferoverflowU.lib
   410 !endif
   411 
   412 #---------------------------------------------------------------------
   413 # TclTest flags
   414 #---------------------------------------------------------------------
   415 
   416 !IF "$(TESTPAT)" != ""
   417 TESTFLAGS = -file $(TESTPAT)
   418 !ENDIF
   419 
   420 
   421 #---------------------------------------------------------------------
   422 # Project specific targets
   423 #---------------------------------------------------------------------
   424 
   425 release:    setup $(TCLSH) $(TCLSTUBLIB) dlls
   426 core:	    setup $(TCLLIB) $(TCLSTUBLIB)
   427 shell:	    setup $(TCLSH)
   428 dlls:	    setup $(TCLPIPEDLL) $(TCLREGLIB) $(TCLDDELIB)
   429 all:	    setup $(TCLSH) $(TCLSTUBLIB) dlls $(CAT32) 
   430 tcltest:    setup $(TCLTEST) dlls $(CAT32)
   431 install:    install-binaries install-libraries install-docs
   432 
   433 
   434 test: setup $(TCLTEST) dlls $(CAT32)
   435 	set TCL_LIBRARY=$(ROOT)/library
   436 !if "$(OS)" == "Windows_NT"  || "$(MSVCDIR)" == "IDE"
   437 	$(TCLTEST) "$(ROOT)/tests/all.tcl" $(TESTFLAGS)
   438 !else
   439 	$(TCLTEST) "$(ROOT)/tests/all.tcl" $(TESTFLAGS) > tests.log
   440 	type tests.log | more
   441 !endif
   442 
   443 runtest: setup $(TCLTEST) dlls $(CAT32)
   444        set TCL_LIBRARY=$(ROOT)/library
   445        $(TCLTEST)
   446 
   447 setup:
   448 	@if not exist $(OUT_DIR)\nul mkdir $(OUT_DIR)
   449 	@if not exist $(TMP_DIR)\nul mkdir $(TMP_DIR)
   450 
   451 !if !$(STATIC_BUILD)
   452 $(TCLIMPLIB): $(TCLLIB)
   453 !endif
   454 
   455 $(TCLLIB): $(TCLOBJS)
   456 !if $(STATIC_BUILD)
   457 	$(lib32) -nologo -out:$@ @<<
   458 $**
   459 <<
   460 !else
   461 	$(link32) $(dlllflags) -base:@$(WINDIR)\coffbase.txt,tcl -out:$@ \
   462 		$(baselibs) @<<
   463 $**
   464 <<
   465 	$(_VC_MANIFEST_EMBED_DLL)
   466 	-@del $*.exp
   467 !endif
   468 
   469 $(TCLSTUBLIB): $(TCLSTUBOBJS)
   470 	$(lib32) -nologo -out:$@ $(TCLSTUBOBJS)
   471 
   472 $(TCLSH): $(TCLSHOBJS) $(TCLIMPLIB)
   473 	$(link32) $(conlflags) -stack:2300000 -out:$@ $(baselibs) $**
   474 	$(_VC_MANIFEST_EMBED_EXE)
   475 
   476 $(TCLTEST): $(TCLTESTOBJS) $(TCLIMPLIB)
   477 	$(link32) $(conlflags) -stack:2300000 -out:$@ $(baselibs) $**
   478 	$(_VC_MANIFEST_EMBED_EXE)
   479 
   480 $(TCLPIPEDLL): $(WINDIR)\stub16.c
   481 	$(cc32) $(CON_CFLAGS) -Fo$(TMP_DIR)\ $(WINDIR)\stub16.c
   482 	$(link32) $(conlflags) -out:$@ $(TMP_DIR)\stub16.obj $(baselibs)
   483 	$(_VC_MANIFEST_EMBED_DLL)
   484 
   485 !if $(STATIC_BUILD)
   486 $(TCLDDELIB): $(TMP_DIR)\tclWinDde.obj
   487 	$(lib32) -nologo -out:$@ $(TMP_DIR)\tclWinDde.obj
   488 !else
   489 $(TCLDDELIB): $(TMP_DIR)\tclWinDde.obj $(TCLSTUBLIB)
   490 	$(link32) $(dlllflags) -base:@$(WINDIR)\coffbase.txt,tcldde -out:$@ \
   491 		$** $(baselibs)
   492 	$(_VC_MANIFEST_EMBED_DLL)
   493 	-@del $*.exp
   494 	-@del $*.lib
   495 !endif
   496 
   497 !if $(STATIC_BUILD)
   498 $(TCLREGLIB): $(TMP_DIR)\tclWinReg.obj
   499 	$(lib32) -nologo -out:$@ $(TMP_DIR)\tclWinReg.obj
   500 !else
   501 $(TCLREGLIB): $(TMP_DIR)\tclWinReg.obj $(TCLSTUBLIB)
   502 	$(link32) $(dlllflags) -base:@$(WINDIR)\coffbase.txt,tclreg -out:$@ \
   503 		$** $(baselibs)
   504 	$(_VC_MANIFEST_EMBED_DLL)
   505 	-@del $*.exp
   506 	-@del $*.lib
   507 !endif
   508 
   509 $(CAT32): $(WINDIR)\cat.c
   510 	$(cc32) $(CON_CFLAGS) -Fo$(TMP_DIR)\ $?
   511 	$(link32) $(conlflags) -out:$@ -stack:16384 $(TMP_DIR)\cat.obj \
   512 		$(baselibs)
   513         $(_VC_MANIFEST_EMBED_EXE)
   514 
   515 #---------------------------------------------------------------------
   516 # Regenerate the stubs files.  [Development use only]
   517 #---------------------------------------------------------------------
   518 
   519 genstubs:
   520 !if !exist($(TCLSH))
   521 	@echo Build tclsh first!
   522 !else
   523 	$(TCLSH) $(TOOLSDIR:\=/)\genStubs.tcl $(GENERICDIR:\=/) \
   524 		$(GENERICDIR:\=/)/tcl.decls $(GENERICDIR:\=/)/tclInt.decls
   525 !endif
   526 
   527 
   528 #---------------------------------------------------------------------
   529 # Generate the makefile depedancies.
   530 #---------------------------------------------------------------------
   531 
   532 depend:
   533 !if !exist($(TCLSH))
   534 	@echo Build tclsh first!
   535 !else
   536 	$(TCLSH) $(TOOLSDIR:\=/)/mkdepend.tcl -vc32 -out:"$(OUT_DIR)\depend.mk" \
   537 		-passthru:"-DBUILD_tcl $(TCL_INCLUDES:"="")" $(GENERICDIR) \
   538 		$(COMPATDIR) $(WINDIR) @<<
   539 $(TCLOBJS)
   540 <<
   541 !endif
   542 
   543 
   544 #---------------------------------------------------------------------
   545 # Build the windows help file.
   546 #---------------------------------------------------------------------
   547 
   548 TCLHLPBASE	= $(PROJECT)$(VERSION)
   549 HELPFILE	= $(OUT_DIR)\$(TCLHLPBASE).hlp
   550 HELPCNT		= $(OUT_DIR)\$(TCLHLPBASE).cnt
   551 DOCTMP_DIR	= $(OUT_DIR)\$(PROJECT)_docs
   552 HELPRTF		= $(DOCTMP_DIR)\$(PROJECT).rtf
   553 MAN2HELP	= $(DOCTMP_DIR)\man2help.tcl
   554 MAN2HELP2	= $(DOCTMP_DIR)\man2help2.tcl
   555 INDEX		= $(DOCTMP_DIR)\index.tcl
   556 BMP		= $(DOCTMP_DIR)\feather.bmp
   557 BMP_NOPATH	= feather.bmp
   558 MAN2TCL		= $(DOCTMP_DIR)\man2tcl.exe
   559 
   560 winhelp: docsetup $(HELPFILE)
   561 
   562 docsetup:
   563 	@if not exist $(DOCTMP_DIR)\nul mkdir $(DOCTMP_DIR)
   564 
   565 $(MAN2HELP) $(MAN2HELP2) $(INDEX) $(BMP): $(TOOLSDIR)\$$(@F)
   566 	@$(CPY) $(TOOLSDIR)\$(@F) $(@D)
   567 
   568 $(HELPFILE): $(HELPRTF) $(BMP)
   569 	cd $(DOCTMP_DIR)
   570 	start /wait hcrtf.exe -x <<$(PROJECT).hpj
   571 [OPTIONS]
   572 COMPRESS=12 Hall Zeck
   573 LCID=0x409 0x0 0x0 ; English (United States)
   574 TITLE=Tcl/Tk Reference Manual
   575 BMROOT=.
   576 CNT=$(@B).cnt
   577 HLP=$(@B).hlp
   578 
   579 [FILES]
   580 $(PROJECT).rtf
   581 
   582 [WINDOWS]
   583 main="Tcl/Tk Reference Manual",,27648,(r15263976),(r65535)
   584 
   585 [CONFIG]
   586 BrowseButtons()
   587 CreateButton(1, "Web", ExecFile("http://www.tcl.tk"))
   588 CreateButton(2, "SF", ExecFile("http://sf.net/projects/tcl"))
   589 CreateButton(3, "Wiki", ExecFile("http://wiki.tcl.tk"))
   590 CreateButton(4, "FAQ", ExecFile("http://www.purl.org/NET/Tcl-FAQ/"))
   591 <<
   592 	cd $(MAKEDIR)
   593 	@$(CPY) "$(DOCTMP_DIR)\$(@B).hlp" "$(OUT_DIR)"
   594 	@$(CPY) "$(DOCTMP_DIR)\$(@B).cnt" "$(OUT_DIR)"
   595 
   596 $(MAN2TCL): $(TOOLSDIR)\$$(@B).c
   597 	$(cc32) -nologo -G4 -ML -O2 -Fo$(@D)\ $(TOOLSDIR)\$(@B).c -link -out:$@
   598 
   599 $(HELPRTF): $(MAN2TCL) $(MAN2HELP) $(MAN2HELP2) $(INDEX) $(DOCDIR)\*
   600 	$(TCLSH) $(MAN2HELP) -bitmap $(BMP_NOPATH) $(PROJECT) $(VERSION) $(DOCDIR:\=/)
   601 
   602 install-docs:
   603 !if exist($(HELPFILE))
   604 	@$(CPY) "$(HELPFILE)" "$(DOC_INSTALL_DIR)\"
   605 	@$(CPY) "$(HELPCNT)" "$(DOC_INSTALL_DIR)\"
   606 !endif
   607 
   608 
   609 #---------------------------------------------------------------------
   610 # Special case object file targets
   611 #---------------------------------------------------------------------
   612 
   613 $(TMP_DIR)\testMain.obj: $(WINDIR)\tclAppInit.c
   614 !if $(TCL_USE_STATIC_PACKAGES)
   615 	$(cc32) $(TCL_CFLAGS) -DTCL_TEST -DTCL_USE_STATIC_PACKAGES -Fo$@ $?
   616 !else
   617 	$(cc32) $(TCL_CFLAGS) -DTCL_TEST -Fo$@ $?
   618 !endif
   619 
   620 $(TMP_DIR)\tclTest.obj: $(GENERICDIR)\tclTest.c
   621 	$(cc32) $(TCL_CFLAGS) -Fo$@ $?
   622 
   623 $(TMP_DIR)\tclTestObj.obj: $(GENERICDIR)\tclTestObj.c
   624 	$(cc32) $(TCL_CFLAGS) -Fo$@ $?
   625 
   626 $(TMP_DIR)\tclWinTest.obj: $(WINDIR)\tclWinTest.c
   627 	$(cc32) $(TCL_CFLAGS) -Fo$@ $?
   628 
   629 $(TMP_DIR)\tclAppInit.obj: $(WINDIR)\tclAppInit.c
   630 !if $(TCL_USE_STATIC_PACKAGES)
   631 	$(cc32) $(TCL_CFLAGS) -DTCL_USE_STATIC_PACKAGES -Fo$@ $?
   632 !else
   633 	$(cc32) $(TCL_CFLAGS) -Fo$@ $?
   634 !endif
   635 
   636 ### The following objects should be built using the stub interfaces
   637 ### *ALL* extensions need to built with -DTCL_THREADS=1
   638 
   639 $(TMP_DIR)\tclWinReg.obj: $(WINDIR)\tclWinReg.c
   640 !if $(STATIC_BUILD)
   641 	$(cc32) $(BASE_CFLAGS) -DTCL_THREADS=1 -DSTATIC_BUILD -Fo$@ $?
   642 !else
   643 	$(cc32) $(BASE_CFLAGS) -DTCL_THREADS=1 -DUSE_TCL_STUBS -Fo$@ $?
   644 !endif
   645 
   646 
   647 $(TMP_DIR)\tclWinDde.obj: $(WINDIR)\tclWinDde.c
   648 !if $(STATIC_BUILD)
   649 	$(cc32) $(BASE_CFLAGS) -DTCL_THREADS=1 -DSTATIC_BUILD -Fo$@ $?
   650 !else
   651 	$(cc32) $(BASE_CFLAGS) -DTCL_THREADS=1 -DUSE_TCL_STUBS -Fo$@ $?
   652 !endif
   653 
   654 
   655 ### The following objects are part of the stub library and should not
   656 ### be built as DLL objects.  -Zl is used to avoid a dependancy on any
   657 ### specific C run-time.
   658 
   659 $(TMP_DIR)\tclStubLib.obj: $(GENERICDIR)\tclStubLib.c
   660 	$(cc32) $(cdebug) $(cflags) -Zl -DSTATIC_BUILD $(TCL_INCLUDES) -Fo$@ $?
   661 
   662 
   663 #---------------------------------------------------------------------
   664 # Dedependency rules
   665 #---------------------------------------------------------------------
   666 
   667 $(GENERICDIR)\regcomp.c: \
   668 	$(GENERICDIR)\regguts.h \
   669 	$(GENERICDIR)\regc_lex.c \
   670 	$(GENERICDIR)\regc_color.c \
   671 	$(GENERICDIR)\regc_nfa.c \
   672 	$(GENERICDIR)\regc_cvec.c \
   673 	$(GENERICDIR)\regc_locale.c
   674 $(GENERICDIR)\regcustom.h: \
   675 	$(GENERICDIR)\tclInt.h \
   676 	$(GENERICDIR)\tclPort.h \
   677 	$(GENERICDIR)\regex.h
   678 $(GENERICDIR)\regexec.c: \
   679 	$(GENERICDIR)\rege_dfa.c \
   680 	$(GENERICDIR)\regguts.h
   681 $(GENERICDIR)\regerror.c: $(GENERICDIR)\regguts.h
   682 $(GENERICDIR)\regfree.c: $(GENERICDIR)\regguts.h
   683 $(GENERICDIR)\regfronts.c: $(GENERICDIR)\regguts.h
   684 $(GENERICDIR)\regguts.h: $(GENERICDIR)\regcustom.h
   685 
   686 !if exist("$(OUT_DIR)\depend.mk")
   687 !include "$(OUT_DIR)\depend.mk"
   688 !message *** Dependency rules in effect.
   689 !else
   690 !message *** Dependency rules are not being used.
   691 !endif
   692 
   693 ### add a spacer in the output
   694 !message
   695 
   696 
   697 #---------------------------------------------------------------------
   698 # Implicit rules
   699 #---------------------------------------------------------------------
   700 
   701 {$(WINDIR)}.c{$(TMP_DIR)}.obj::
   702     $(cc32) $(TCL_CFLAGS) -DBUILD_tcl -Fo$(TMP_DIR)\ @<<
   703 $<
   704 <<
   705 
   706 {$(GENERICDIR)}.c{$(TMP_DIR)}.obj::
   707     $(cc32) $(TCL_CFLAGS) -DBUILD_tcl -Fo$(TMP_DIR)\ @<<
   708 $<
   709 <<
   710 
   711 {$(COMPATDIR)}.c{$(TMP_DIR)}.obj::
   712     $(cc32) $(TCL_CFLAGS) -DBUILD_tcl -Fo$(TMP_DIR)\ @<<
   713 $<
   714 <<
   715 
   716 {$(WINDIR)}.rc{$(TMP_DIR)}.res:
   717 	$(rc32) -fo $@ -r -i "$(GENERICDIR)" -D__WIN32__ \
   718 !if $(DEBUG)
   719 	-d DEBUG \
   720 !endif
   721 !if $(TCL_THREADS)
   722 	-d TCL_THREADS \
   723 !endif
   724 !if $(STATIC_BUILD)
   725 	-d STATIC_BUILD \
   726 !endif
   727 	$<
   728 
   729 .SUFFIXES:
   730 .SUFFIXES:.c .rc
   731 
   732 
   733 #---------------------------------------------------------------------
   734 # Installation.
   735 #---------------------------------------------------------------------
   736 
   737 install-binaries:
   738 	@echo Installing to '$(_INSTALLDIR)'
   739 	@echo installing $(TCLLIBNAME)
   740 !if "$(TCLLIB)" != "$(TCLIMPLIB)"
   741 	@$(CPY) "$(TCLLIB)" "$(BIN_INSTALL_DIR)\"
   742 !endif
   743 	@$(CPY) "$(TCLIMPLIB)" "$(LIB_INSTALL_DIR)\"
   744 !if exist($(TCLSH))
   745 	@echo installing $(TCLSHNAME)
   746 	@$(CPY) "$(TCLSH)" "$(BIN_INSTALL_DIR)\"
   747 !endif
   748 !if exist($(TCLPIPEDLL))
   749 	@echo installing $(TCLPIPEDLLNAME)
   750 	@$(CPY) "$(TCLPIPEDLL)" "$(BIN_INSTALL_DIR)\"
   751 !endif
   752 	@echo installing $(TCLSTUBLIBNAME)
   753 	@$(CPY) "$(TCLSTUBLIB)" "$(LIB_INSTALL_DIR)\"
   754 
   755 install-libraries:
   756 	@echo installing http1.0
   757 	@$(CPY) "$(ROOT)\library\http1.0\*.tcl" \
   758 		"$(SCRIPT_INSTALL_DIR)\http1.0\"
   759 	@echo installing http2.5
   760 	@$(CPY) "$(ROOT)\library\http\*.tcl" \
   761 		"$(SCRIPT_INSTALL_DIR)\http2.5\"
   762 	@echo installing opt0.4
   763 	@$(CPY) "$(ROOT)\library\opt\*.tcl" \
   764 		"$(SCRIPT_INSTALL_DIR)\opt0.4\"
   765 	@echo installing msgcat1.3
   766 	@$(CPY) "$(ROOT)\library\msgcat\*.tcl" \
   767 	    "$(SCRIPT_INSTALL_DIR)\msgcat1.3\"
   768 	@echo installing tcltest2.2 
   769 	@$(CPY) "$(ROOT)\library\tcltest\*.tcl" \
   770 	    "$(SCRIPT_INSTALL_DIR)\tcltest2.2\"
   771 	@echo installing $(TCLDDELIBNAME)
   772 !if $(STATIC_BUILD)
   773 	@$(CPY) "$(TCLDDELIB)" "$(LIB_INSTALL_DIR)\"
   774 !else
   775 	@$(CPY) "$(TCLDDELIB)" "$(LIB_INSTALL_DIR)\dde$(DDEDOTVERSION)\"
   776 	@$(CPY) "$(ROOT)\library\dde\pkgIndex.tcl" \
   777 	    "$(LIB_INSTALL_DIR)\dde$(DDEDOTVERSION)\"
   778 !endif
   779 	@echo installing $(TCLREGLIBNAME)
   780 !if $(STATIC_BUILD)
   781 	@$(CPY) "$(TCLREGLIB)" "$(LIB_INSTALL_DIR)\"
   782 !else
   783 	@$(CPY) "$(TCLREGLIB)" "$(LIB_INSTALL_DIR)\reg$(REGDOTVERSION)\"
   784 	@$(CPY) "$(ROOT)\library\reg\pkgIndex.tcl" \
   785 	    "$(LIB_INSTALL_DIR)\reg$(REGDOTVERSION)\"
   786 !endif
   787 	@echo installing encoding files
   788 	@$(CPY) "$(ROOT)\library\encoding\*.enc" \
   789 		"$(SCRIPT_INSTALL_DIR)\encoding\"
   790 	@echo installing library files
   791 	@$(CPY) "$(GENERICDIR)\tcl.h"          "$(INCLUDE_INSTALL_DIR)\"
   792 	@$(CPY) "$(GENERICDIR)\tclDecls.h"     "$(INCLUDE_INSTALL_DIR)\"
   793 	@$(CPY) "$(GENERICDIR)\tclPlatDecls.h" "$(INCLUDE_INSTALL_DIR)\"
   794 	@$(CPY) "$(ROOT)\library\history.tcl"  "$(SCRIPT_INSTALL_DIR)\"
   795 	@$(CPY) "$(ROOT)\library\init.tcl"     "$(SCRIPT_INSTALL_DIR)\"
   796 	@$(CPY) "$(ROOT)\library\ldAout.tcl"   "$(SCRIPT_INSTALL_DIR)\"
   797 	@$(CPY) "$(ROOT)\library\parray.tcl"   "$(SCRIPT_INSTALL_DIR)\"
   798 	@$(CPY) "$(ROOT)\library\safe.tcl"     "$(SCRIPT_INSTALL_DIR)\"
   799 	@$(CPY) "$(ROOT)\library\tclIndex"     "$(SCRIPT_INSTALL_DIR)\"
   800 	@$(CPY) "$(ROOT)\library\package.tcl"  "$(SCRIPT_INSTALL_DIR)\"
   801 	@$(CPY) "$(ROOT)\library\word.tcl"     "$(SCRIPT_INSTALL_DIR)\"
   802 	@$(CPY) "$(ROOT)\library\auto.tcl"     "$(SCRIPT_INSTALL_DIR)\"
   803 
   804 
   805 #---------------------------------------------------------------------
   806 # Clean up
   807 #---------------------------------------------------------------------
   808 
   809 tidy:
   810 	@echo Removing $(TCLLIB) ...
   811 	@if exist $(TCLLIB) del $(TCLLIB)
   812 	@echo Removing $(TCLSH) ...
   813 	@if exist $(TCLSH) del $(TCLSH)
   814 	@echo Removing $(TCLTEST) ...
   815 	@if exist $(TCLTEST) del $(TCLTEST)
   816 	@echo Removing $(TCLDDELIB) ...
   817 	@if exist $(TCLDDELIB) del $(TCLDDELIB)
   818 	@echo Removing $(TCLREGLIB) ...
   819 	@if exist $(TCLREGLIB) del $(TCLREGLIB)
   820 
   821 clean:
   822 	@echo Cleaning $(TMP_DIR)\* ...
   823 	@if exist $(TMP_DIR)\nul $(RMDIR) $(TMP_DIR)
   824 
   825 hose:
   826 	@echo Hosing $(OUT_DIR)\* ...
   827 	@if exist $(OUT_DIR)\nul $(RMDIR) $(OUT_DIR)
   828