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