| 1 |
#------------------------------------------------------------------------------ |
| 2 |
# rules.vc -- |
| 3 |
# |
| 4 |
# Microsoft Visual C++ makefile include for decoding the commandline |
| 5 |
# macros. This file does not need editing to build Tcl. |
| 6 |
# |
| 7 |
# See the file "license.terms" for information on usage and redistribution |
| 8 |
# of this file, and for a DISCLAIMER OF ALL WARRANTIES. |
| 9 |
# |
| 10 |
# Copyright (c) 2001-2003 David Gravereaux. |
| 11 |
# Copyright (c) 2003-2008 Patrick Thoyts |
| 12 |
#------------------------------------------------------------------------------ |
| 13 |
|
| 14 |
!ifndef _RULES_VC |
| 15 |
_RULES_VC = 1 |
| 16 |
|
| 17 |
cc32 = $(CC) # built-in default. |
| 18 |
link32 = link |
| 19 |
lib32 = lib |
| 20 |
rc32 = $(RC) # built-in default. |
| 21 |
|
| 22 |
!ifndef INSTALLDIR |
| 23 |
### Assume the normal default. |
| 24 |
_INSTALLDIR = C:\Program Files\Tcl |
| 25 |
!else |
| 26 |
### Fix the path separators. |
| 27 |
_INSTALLDIR = $(INSTALLDIR:/=\) |
| 28 |
!endif |
| 29 |
|
| 30 |
#---------------------------------------------------------- |
| 31 |
# Set the proper copy method to avoid overwrite questions |
| 32 |
# to the user when copying files and selecting the right |
| 33 |
# "delete all" method. |
| 34 |
#---------------------------------------------------------- |
| 35 |
|
| 36 |
!if "$(OS)" == "Windows_NT" |
| 37 |
RMDIR = rmdir /S /Q |
| 38 |
ERRNULL = 2>NUL |
| 39 |
!if ![ver | find "4.0" > nul] |
| 40 |
CPY = echo y | xcopy /i >NUL |
| 41 |
COPY = copy >NUL |
| 42 |
!else |
| 43 |
CPY = xcopy /i /y >NUL |
| 44 |
COPY = copy /y >NUL |
| 45 |
!endif |
| 46 |
!else # "$(OS)" != "Windows_NT" |
| 47 |
CPY = xcopy /i >_JUNK.OUT # On Win98 NUL does not work here. |
| 48 |
COPY = copy >_JUNK.OUT # On Win98 NUL does not work here. |
| 49 |
RMDIR = deltree /Y |
| 50 |
NULL = \NUL # Used in testing directory existence |
| 51 |
ERRNULL = >NUL # Win9x shell cannot redirect stderr |
| 52 |
!endif |
| 53 |
MKDIR = mkdir |
| 54 |
|
| 55 |
#------------------------------------------------------------------------------ |
| 56 |
# Determine the host and target architectures and compiler version. |
| 57 |
#------------------------------------------------------------------------------ |
| 58 |
|
| 59 |
_HASH=^# |
| 60 |
_VC_MANIFEST_EMBED_EXE= |
| 61 |
_VC_MANIFEST_EMBED_DLL= |
| 62 |
VCVER=0 |
| 63 |
!if ![echo VCVERSION=_MSC_VER > vercl.x] \ |
| 64 |
&& ![echo $(_HASH)if defined(_M_IX86) >> vercl.x] \ |
| 65 |
&& ![echo ARCH=IX86 >> vercl.x] \ |
| 66 |
&& ![echo $(_HASH)elif defined(_M_AMD64) >> vercl.x] \ |
| 67 |
&& ![echo ARCH=AMD64 >> vercl.x] \ |
| 68 |
&& ![echo $(_HASH)endif >> vercl.x] \ |
| 69 |
&& ![cl -nologo -TC -P vercl.x $(ERRNULL)] |
| 70 |
!include vercl.i |
| 71 |
!if ![echo VCVER= ^\> vercl.vc] \ |
| 72 |
&& ![set /a $(VCVERSION) / 100 - 6 >> vercl.vc] |
| 73 |
!include vercl.vc |
| 74 |
!endif |
| 75 |
!endif |
| 76 |
!if ![del $(ERRNUL) /q/f vercl.x vercl.i vercl.vc] |
| 77 |
!endif |
| 78 |
|
| 79 |
!if ![reg query HKLM\Hardware\Description\System\CentralProcessor\0 /v Identifier | findstr /i x86] |
| 80 |
NATIVE_ARCH=IX86 |
| 81 |
!else |
| 82 |
NATIVE_ARCH=AMD64 |
| 83 |
!endif |
| 84 |
|
| 85 |
# Since MSVC8 we must deal with manifest resources. |
| 86 |
!if $(VCVERSION) >= 1400 |
| 87 |
_VC_MANIFEST_EMBED_EXE=if exist [email protected] mt -nologo -manifest [email protected] -outputresource:$@;1 |
| 88 |
_VC_MANIFEST_EMBED_DLL=if exist [email protected] mt -nologo -manifest [email protected] -outputresource:$@;2 |
| 89 |
!endif |
| 90 |
|
| 91 |
!ifndef MACHINE |
| 92 |
MACHINE=$(ARCH) |
| 93 |
!endif |
| 94 |
|
| 95 |
!ifndef CFG_ENCODING |
| 96 |
CFG_ENCODING = \"cp1252\" |
| 97 |
!endif |
| 98 |
|
| 99 |
!message =============================================================================== |
| 100 |
|
| 101 |
#---------------------------------------------------------- |
| 102 |
# build the helper app we need to overcome nmake's limiting |
| 103 |
# environment. |
| 104 |
#---------------------------------------------------------- |
| 105 |
|
| 106 |
!if !exist(nmakehlp.exe) |
| 107 |
!if [$(cc32) -nologo nmakehlp.c -link -subsystem:console > nul] |
| 108 |
!endif |
| 109 |
!endif |
| 110 |
|
| 111 |
#---------------------------------------------------------- |
| 112 |
# Test for compiler features |
| 113 |
#---------------------------------------------------------- |
| 114 |
|
| 115 |
### test for optimizations |
| 116 |
!if [nmakehlp -c -Ot] |
| 117 |
!message *** Compiler has 'Optimizations' |
| 118 |
OPTIMIZING = 1 |
| 119 |
!else |
| 120 |
!message *** Compiler does not have 'Optimizations' |
| 121 |
OPTIMIZING = 0 |
| 122 |
!endif |
| 123 |
|
| 124 |
OPTIMIZATIONS = |
| 125 |
|
| 126 |
!if [nmakehlp -c -Ot] |
| 127 |
OPTIMIZATIONS = $(OPTIMIZATIONS) -Ot |
| 128 |
!endif |
| 129 |
|
| 130 |
!if [nmakehlp -c -Oi] |
| 131 |
OPTIMIZATIONS = $(OPTIMIZATIONS) -Oi |
| 132 |
!endif |
| 133 |
|
| 134 |
!if [nmakehlp -c -Op] |
| 135 |
OPTIMIZATIONS = $(OPTIMIZATIONS) -Op |
| 136 |
!endif |
| 137 |
|
| 138 |
!if [nmakehlp -c -fp:strict] |
| 139 |
OPTIMIZATIONS = $(OPTIMIZATIONS) -fp:strict |
| 140 |
!endif |
| 141 |
|
| 142 |
!if [nmakehlp -c -Gs] |
| 143 |
OPTIMIZATIONS = $(OPTIMIZATIONS) -Gs |
| 144 |
!endif |
| 145 |
|
| 146 |
!if [nmakehlp -c -GS] |
| 147 |
OPTIMIZATIONS = $(OPTIMIZATIONS) -GS |
| 148 |
!endif |
| 149 |
|
| 150 |
!if [nmakehlp -c -GL] |
| 151 |
OPTIMIZATIONS = $(OPTIMIZATIONS) -GL |
| 152 |
!endif |
| 153 |
|
| 154 |
DEBUGFLAGS = |
| 155 |
|
| 156 |
!if [nmakehlp -c -RTC1] |
| 157 |
DEBUGFLAGS = $(DEBUGFLAGS) -RTC1 |
| 158 |
!elseif [nmakehlp -c -GZ] |
| 159 |
DEBUGFLAGS = $(DEBUGFLAGS) -GZ |
| 160 |
!endif |
| 161 |
|
| 162 |
COMPILERFLAGS =-W3 -DUNICODE -D_UNICODE |
| 163 |
|
| 164 |
# In v13 -GL and -YX are incompatible. |
| 165 |
!if [nmakehlp -c -YX] |
| 166 |
!if ![nmakehlp -c -GL] |
| 167 |
OPTIMIZATIONS = $(OPTIMIZATIONS) -YX |
| 168 |
!endif |
| 169 |
!endif |
| 170 |
|
| 171 |
!if "$(MACHINE)" == "IX86" |
| 172 |
### test for pentium errata |
| 173 |
!if [nmakehlp -c -QI0f] |
| 174 |
!message *** Compiler has 'Pentium 0x0f fix' |
| 175 |
COMPILERFLAGS = $(COMPILERFLAGS) -QI0f |
| 176 |
!else |
| 177 |
!message *** Compiler does not have 'Pentium 0x0f fix' |
| 178 |
!endif |
| 179 |
!endif |
| 180 |
|
| 181 |
!if "$(MACHINE)" == "IA64" |
| 182 |
### test for Itanium errata |
| 183 |
!if [nmakehlp -c -QIA64_Bx] |
| 184 |
!message *** Compiler has 'B-stepping errata workarounds' |
| 185 |
COMPILERFLAGS = $(COMPILERFLAGS) -QIA64_Bx |
| 186 |
!else |
| 187 |
!message *** Compiler does not have 'B-stepping errata workarounds' |
| 188 |
!endif |
| 189 |
!endif |
| 190 |
|
| 191 |
!if "$(MACHINE)" == "IX86" |
| 192 |
### test for -align:4096, when align:512 will do. |
| 193 |
!if [nmakehlp -l -opt:nowin98] |
| 194 |
!message *** Linker has 'Win98 alignment problem' |
| 195 |
ALIGN98_HACK = 1 |
| 196 |
!else |
| 197 |
!message *** Linker does not have 'Win98 alignment problem' |
| 198 |
ALIGN98_HACK = 0 |
| 199 |
!endif |
| 200 |
!else |
| 201 |
ALIGN98_HACK = 0 |
| 202 |
!endif |
| 203 |
|
| 204 |
LINKERFLAGS = |
| 205 |
|
| 206 |
!if [nmakehlp -l -ltcg] |
| 207 |
LINKERFLAGS =-ltcg |
| 208 |
!endif |
| 209 |
|
| 210 |
#---------------------------------------------------------- |
| 211 |
# Decode the options requested. |
| 212 |
#---------------------------------------------------------- |
| 213 |
|
| 214 |
!if "$(OPTS)" == "" || [nmakehlp -f "$(OPTS)" "none"] |
| 215 |
STATIC_BUILD = 0 |
| 216 |
TCL_THREADS = 1 |
| 217 |
DEBUG = 0 |
| 218 |
SYMBOLS = 0 |
| 219 |
PROFILE = 0 |
| 220 |
PGO = 0 |
| 221 |
MSVCRT = 0 |
| 222 |
LOIMPACT = 0 |
| 223 |
TCL_USE_STATIC_PACKAGES = 0 |
| 224 |
USE_THREAD_ALLOC = 1 |
| 225 |
UNCHECKED = 0 |
| 226 |
!else |
| 227 |
!if [nmakehlp -f $(OPTS) "static"] |
| 228 |
!message *** Doing static |
| 229 |
STATIC_BUILD = 1 |
| 230 |
!else |
| 231 |
STATIC_BUILD = 0 |
| 232 |
!endif |
| 233 |
!if [nmakehlp -f $(OPTS) "msvcrt"] |
| 234 |
!message *** Doing msvcrt |
| 235 |
MSVCRT = 1 |
| 236 |
!else |
| 237 |
MSVCRT = 0 |
| 238 |
!endif |
| 239 |
!if [nmakehlp -f $(OPTS) "staticpkg"] |
| 240 |
!message *** Doing staticpkg |
| 241 |
TCL_USE_STATIC_PACKAGES = 1 |
| 242 |
!else |
| 243 |
TCL_USE_STATIC_PACKAGES = 0 |
| 244 |
!endif |
| 245 |
!if [nmakehlp -f $(OPTS) "nothreads"] |
| 246 |
!message *** Compile explicitly for non-threaded tcl |
| 247 |
TCL_THREADS = 0 |
| 248 |
!else |
| 249 |
TCL_THREADS = 1 |
| 250 |
USE_THREAD_ALLOC= 1 |
| 251 |
!endif |
| 252 |
!if [nmakehlp -f $(OPTS) "symbols"] |
| 253 |
!message *** Doing symbols |
| 254 |
DEBUG = 1 |
| 255 |
!else |
| 256 |
DEBUG = 0 |
| 257 |
!endif |
| 258 |
!if [nmakehlp -f $(OPTS) "pdbs"] |
| 259 |
!message *** Doing pdbs |
| 260 |
SYMBOLS = 1 |
| 261 |
!else |
| 262 |
SYMBOLS = 0 |
| 263 |
!endif |
| 264 |
!if [nmakehlp -f $(OPTS) "profile"] |
| 265 |
!message *** Doing profile |
| 266 |
PROFILE = 1 |
| 267 |
!else |
| 268 |
PROFILE = 0 |
| 269 |
!endif |
| 270 |
!if [nmakehlp -f $(OPTS) "pgi"] |
| 271 |
!message *** Doing profile guided optimization instrumentation |
| 272 |
PGO = 1 |
| 273 |
!elseif [nmakehlp -f $(OPTS) "pgo"] |
| 274 |
!message *** Doing profile guided optimization |
| 275 |
PGO = 2 |
| 276 |
!else |
| 277 |
PGO = 0 |
| 278 |
!endif |
| 279 |
!if [nmakehlp -f $(OPTS) "loimpact"] |
| 280 |
!message *** Doing loimpact |
| 281 |
LOIMPACT = 1 |
| 282 |
!else |
| 283 |
LOIMPACT = 0 |
| 284 |
!endif |
| 285 |
!if [nmakehlp -f $(OPTS) "thrdalloc"] |
| 286 |
!message *** Doing thrdalloc |
| 287 |
USE_THREAD_ALLOC = 1 |
| 288 |
!endif |
| 289 |
!if [nmakehlp -f $(OPTS) "tclalloc"] |
| 290 |
!message *** Doing tclalloc |
| 291 |
USE_THREAD_ALLOC = 0 |
| 292 |
!endif |
| 293 |
!if [nmakehlp -f $(OPTS) "unchecked"] |
| 294 |
!message *** Doing unchecked |
| 295 |
UNCHECKED = 1 |
| 296 |
!else |
| 297 |
UNCHECKED = 0 |
| 298 |
!endif |
| 299 |
!endif |
| 300 |
|
| 301 |
|
| 302 |
!if !$(STATIC_BUILD) |
| 303 |
# Make sure we don't build overly fat DLLs. |
| 304 |
MSVCRT = 1 |
| 305 |
# We shouldn't statically put the extensions inside the shell when dynamic. |
| 306 |
TCL_USE_STATIC_PACKAGES = 0 |
| 307 |
!endif |
| 308 |
|
| 309 |
|
| 310 |
#---------------------------------------------------------- |
| 311 |
# Figure-out how to name our intermediate and output directories. |
| 312 |
# We wouldn't want different builds to use the same .obj files |
| 313 |
# by accident. |
| 314 |
#---------------------------------------------------------- |
| 315 |
|
| 316 |
#---------------------------------------- |
| 317 |
# Naming convention: |
| 318 |
# t = full thread support. |
| 319 |
# s = static library (as opposed to an |
| 320 |
# import library) |
| 321 |
# g = linked to the debug enabled C |
| 322 |
# run-time. |
| 323 |
# x = special static build when it |
| 324 |
# links to the dynamic C run-time. |
| 325 |
#---------------------------------------- |
| 326 |
SUFX = tsgx |
| 327 |
|
| 328 |
!if $(DEBUG) |
| 329 |
BUILDDIRTOP = Debug |
| 330 |
!else |
| 331 |
BUILDDIRTOP = Release |
| 332 |
!endif |
| 333 |
|
| 334 |
!if "$(MACHINE)" != "IX86" |
| 335 |
BUILDDIRTOP =$(BUILDDIRTOP)_$(MACHINE) |
| 336 |
!endif |
| 337 |
!if $(VCVER) > 6 |
| 338 |
BUILDDIRTOP =$(BUILDDIRTOP)_VC$(VCVER) |
| 339 |
!endif |
| 340 |
|
| 341 |
!if !$(DEBUG) || $(DEBUG) && $(UNCHECKED) |
| 342 |
SUFX = $(SUFX:g=) |
| 343 |
!endif |
| 344 |
|
| 345 |
TMP_DIRFULL = .\$(BUILDDIRTOP)\$(PROJECT)_ThreadedDynamicStaticX |
| 346 |
|
| 347 |
!if !$(STATIC_BUILD) |
| 348 |
TMP_DIRFULL = $(TMP_DIRFULL:Static=) |
| 349 |
SUFX = $(SUFX:s=) |
| 350 |
EXT = dll |
| 351 |
!if $(MSVCRT) |
| 352 |
TMP_DIRFULL = $(TMP_DIRFULL:X=) |
| 353 |
SUFX = $(SUFX:x=) |
| 354 |
!endif |
| 355 |
!else |
| 356 |
TMP_DIRFULL = $(TMP_DIRFULL:Dynamic=) |
| 357 |
EXT = lib |
| 358 |
!if !$(MSVCRT) |
| 359 |
TMP_DIRFULL = $(TMP_DIRFULL:X=) |
| 360 |
SUFX = $(SUFX:x=) |
| 361 |
!endif |
| 362 |
!endif |
| 363 |
|
| 364 |
!if !$(TCL_THREADS) |
| 365 |
TMP_DIRFULL = $(TMP_DIRFULL:Threaded=) |
| 366 |
SUFX = $(SUFX:t=) |
| 367 |
!endif |
| 368 |
|
| 369 |
!ifndef TMP_DIR |
| 370 |
TMP_DIR = $(TMP_DIRFULL) |
| 371 |
!ifndef OUT_DIR |
| 372 |
OUT_DIR = .\$(BUILDDIRTOP) |
| 373 |
!endif |
| 374 |
!else |
| 375 |
!ifndef OUT_DIR |
| 376 |
OUT_DIR = $(TMP_DIR) |
| 377 |
!endif |
| 378 |
!endif |
| 379 |
|
| 380 |
|
| 381 |
#---------------------------------------------------------- |
| 382 |
# Decode the statistics requested. |
| 383 |
#---------------------------------------------------------- |
| 384 |
|
| 385 |
!if "$(STATS)" == "" || [nmakehlp -f "$(STATS)" "none"] |
| 386 |
TCL_MEM_DEBUG = 0 |
| 387 |
TCL_COMPILE_DEBUG = 0 |
| 388 |
!else |
| 389 |
!if [nmakehlp -f $(STATS) "memdbg"] |
| 390 |
!message *** Doing memdbg |
| 391 |
TCL_MEM_DEBUG = 1 |
| 392 |
!else |
| 393 |
TCL_MEM_DEBUG = 0 |
| 394 |
!endif |
| 395 |
!if [nmakehlp -f $(STATS) "compdbg"] |
| 396 |
!message *** Doing compdbg |
| 397 |
TCL_COMPILE_DEBUG = 1 |
| 398 |
!else |
| 399 |
TCL_COMPILE_DEBUG = 0 |
| 400 |
!endif |
| 401 |
!endif |
| 402 |
|
| 403 |
|
| 404 |
#---------------------------------------------------------- |
| 405 |
# Decode the checks requested. |
| 406 |
#---------------------------------------------------------- |
| 407 |
|
| 408 |
!if "$(CHECKS)" == "" || [nmakehlp -f "$(CHECKS)" "none"] |
| 409 |
TCL_NO_DEPRECATED = 0 |
| 410 |
WARNINGS = -W3 |
| 411 |
!else |
| 412 |
!if [nmakehlp -f $(CHECKS) "nodep"] |
| 413 |
!message *** Doing nodep check |
| 414 |
TCL_NO_DEPRECATED = 1 |
| 415 |
!else |
| 416 |
TCL_NO_DEPRECATED = 0 |
| 417 |
!endif |
| 418 |
!if [nmakehlp -f $(CHECKS) "fullwarn"] |
| 419 |
!message *** Doing full warnings check |
| 420 |
WARNINGS = -W4 |
| 421 |
!if [nmakehlp -l -warn:3] |
| 422 |
LINKERFLAGS = $(LINKERFLAGS) -warn:3 |
| 423 |
!endif |
| 424 |
!else |
| 425 |
WARNINGS = -W3 |
| 426 |
!endif |
| 427 |
!if [nmakehlp -f $(CHECKS) "64bit"] && [nmakehlp -c -Wp64] |
| 428 |
!message *** Doing 64bit portability warnings |
| 429 |
WARNINGS = $(WARNINGS) -Wp64 |
| 430 |
!endif |
| 431 |
!endif |
| 432 |
|
| 433 |
!if $(PGO) > 1 |
| 434 |
!if [nmakehlp -l -ltcg:pgoptimize] |
| 435 |
LINKERFLAGS = $(LINKERFLAGS:-ltcg=) -ltcg:pgoptimize |
| 436 |
!else |
| 437 |
MSG=^ |
| 438 |
This compiler does not support profile guided optimization. |
| 439 |
!error $(MSG) |
| 440 |
!endif |
| 441 |
!elseif $(PGO) > 0 |
| 442 |
!if [nmakehlp -l -ltcg:pginstrument] |
| 443 |
LINKERFLAGS = $(LINKERFLAGS:-ltcg=) -ltcg:pginstrument |
| 444 |
!else |
| 445 |
MSG=^ |
| 446 |
This compiler does not support profile guided optimization. |
| 447 |
!error $(MSG) |
| 448 |
!endif |
| 449 |
!endif |
| 450 |
|
| 451 |
#---------------------------------------------------------- |
| 452 |
# Set our defines now armed with our options. |
| 453 |
#---------------------------------------------------------- |
| 454 |
|
| 455 |
OPTDEFINES = -DTCL_CFGVAL_ENCODING=$(CFG_ENCODING) -DSTDC_HEADERS |
| 456 |
|
| 457 |
!if $(TCL_MEM_DEBUG) |
| 458 |
OPTDEFINES = $(OPTDEFINES) -DTCL_MEM_DEBUG |
| 459 |
!endif |
| 460 |
!if $(TCL_COMPILE_DEBUG) |
| 461 |
OPTDEFINES = $(OPTDEFINES) -DTCL_COMPILE_DEBUG -DTCL_COMPILE_STATS |
| 462 |
!endif |
| 463 |
!if $(TCL_THREADS) |
| 464 |
OPTDEFINES = $(OPTDEFINES) -DTCL_THREADS=1 |
| 465 |
!if $(USE_THREAD_ALLOC) |
| 466 |
OPTDEFINES = $(OPTDEFINES) -DUSE_THREAD_ALLOC=1 |
| 467 |
!endif |
| 468 |
!endif |
| 469 |
!if $(STATIC_BUILD) |
| 470 |
OPTDEFINES = $(OPTDEFINES) -DSTATIC_BUILD |
| 471 |
!endif |
| 472 |
!if $(TCL_NO_DEPRECATED) |
| 473 |
OPTDEFINES = $(OPTDEFINES) -DTCL_NO_DEPRECATED |
| 474 |
!endif |
| 475 |
|
| 476 |
!if !$(DEBUG) |
| 477 |
OPTDEFINES = $(OPTDEFINES) -DNDEBUG |
| 478 |
!if $(OPTIMIZING) |
| 479 |
OPTDEFINES = $(OPTDEFINES) -DTCL_CFG_OPTIMIZED |
| 480 |
!endif |
| 481 |
!endif |
| 482 |
!if $(PROFILE) |
| 483 |
OPTDEFINES = $(OPTDEFINES) -DTCL_CFG_PROFILED |
| 484 |
!endif |
| 485 |
!if "$(MACHINE)" == "IA64" || "$(MACHINE)" == "AMD64" |
| 486 |
OPTDEFINES = $(OPTDEFINES) -DTCL_CFG_DO64BIT |
| 487 |
!endif |
| 488 |
!if $(VCVERSION) < 1300 |
| 489 |
OPTDEFINES = $(OPTDEFINES) -DNO_STRTOI64 |
| 490 |
!endif |
| 491 |
|
| 492 |
#---------------------------------------------------------- |
| 493 |
# Locate the Tcl headers to build against |
| 494 |
#---------------------------------------------------------- |
| 495 |
|
| 496 |
!if "$(PROJECT)" == "tcl" |
| 497 |
|
| 498 |
_TCL_H = ..\generic\tcl.h |
| 499 |
|
| 500 |
!else |
| 501 |
|
| 502 |
# If INSTALLDIR set to tcl root dir then reset to the lib dir. |
| 503 |
!if exist("$(_INSTALLDIR)\include\tcl.h") |
| 504 |
_INSTALLDIR=$(_INSTALLDIR)\lib |
| 505 |
!endif |
| 506 |
|
| 507 |
!if !defined(TCLDIR) |
| 508 |
!if exist("$(_INSTALLDIR)\..\include\tcl.h") |
| 509 |
TCLINSTALL = 1 |
| 510 |
_TCLDIR = $(_INSTALLDIR)\.. |
| 511 |
_TCL_H = $(_INSTALLDIR)\..\include\tcl.h |
| 512 |
TCLDIR = $(_INSTALLDIR)\.. |
| 513 |
!else |
| 514 |
MSG=^ |
| 515 |
Failed to find tcl.h. Set the TCLDIR macro. |
| 516 |
!error $(MSG) |
| 517 |
!endif |
| 518 |
!else |
| 519 |
_TCLDIR = $(TCLDIR:/=\) |
| 520 |
!if exist("$(_TCLDIR)\include\tcl.h") |
| 521 |
TCLINSTALL = 1 |
| 522 |
_TCL_H = $(_TCLDIR)\include\tcl.h |
| 523 |
!elseif exist("$(_TCLDIR)\generic\tcl.h") |
| 524 |
TCLINSTALL = 0 |
| 525 |
_TCL_H = $(_TCLDIR)\generic\tcl.h |
| 526 |
!else |
| 527 |
MSG =^ |
| 528 |
Failed to find tcl.h. The TCLDIR macro does not appear correct. |
| 529 |
!error $(MSG) |
| 530 |
!endif |
| 531 |
!endif |
| 532 |
!endif |
| 533 |
|
| 534 |
#-------------------------------------------------------------- |
| 535 |
# Extract various version numbers from tcl headers |
| 536 |
# The generated file is then included in the makefile. |
| 537 |
#-------------------------------------------------------------- |
| 538 |
|
| 539 |
!if [echo REM = This file is generated from rules.vc > versions.vc] |
| 540 |
!endif |
| 541 |
!if [echo TCL_MAJOR_VERSION = \>> versions.vc] \ |
| 542 |
&& [nmakehlp -V "$(_TCL_H)" TCL_MAJOR_VERSION >> versions.vc] |
| 543 |
!endif |
| 544 |
!if [echo TCL_MINOR_VERSION = \>> versions.vc] \ |
| 545 |
&& [nmakehlp -V "$(_TCL_H)" TCL_MINOR_VERSION >> versions.vc] |
| 546 |
!endif |
| 547 |
!if [echo TCL_PATCH_LEVEL = \>> versions.vc] \ |
| 548 |
&& [nmakehlp -V "$(_TCL_H)" TCL_PATCH_LEVEL >> versions.vc] |
| 549 |
!endif |
| 550 |
|
| 551 |
# If building the tcl core then we need additional package versions |
| 552 |
!if "$(PROJECT)" == "tcl" |
| 553 |
!if [echo PKG_HTTP_VER = \>> versions.vc] \ |
| 554 |
&& [nmakehlp -V ..\library\http\pkgIndex.tcl http >> versions.vc] |
| 555 |
!endif |
| 556 |
!if [echo PKG_TCLTEST_VER = \>> versions.vc] \ |
| 557 |
&& [nmakehlp -V ..\library\tcltest\pkgIndex.tcl tcltest >> versions.vc] |
| 558 |
!endif |
| 559 |
!if [echo PKG_MSGCAT_VER = \>> versions.vc] \ |
| 560 |
&& [nmakehlp -V ..\library\msgcat\pkgIndex.tcl msgcat >> versions.vc] |
| 561 |
!endif |
| 562 |
!if [echo PKG_PLATFORM_VER = \>> versions.vc] \ |
| 563 |
&& [nmakehlp -V ..\library\platform\pkgIndex.tcl "platform " >> versions.vc] |
| 564 |
!endif |
| 565 |
!if [echo PKG_SHELL_VER = \>> versions.vc] \ |
| 566 |
&& [nmakehlp -V ..\library\platform\pkgIndex.tcl "platform::shell" >> versions.vc] |
| 567 |
!endif |
| 568 |
!if [echo PKG_DDE_VER = \>> versions.vc] \ |
| 569 |
&& [nmakehlp -V ..\library\dde\pkgIndex.tcl "dde " >> versions.vc] |
| 570 |
!endif |
| 571 |
!if [echo PKG_REG_VER =\>> versions.vc] \ |
| 572 |
&& [nmakehlp -V ..\library\reg\pkgIndex.tcl registry >> versions.vc] |
| 573 |
!endif |
| 574 |
!endif |
| 575 |
|
| 576 |
!include versions.vc |
| 577 |
|
| 578 |
#-------------------------------------------------------------- |
| 579 |
# Setup tcl version dependent stuff headers |
| 580 |
#-------------------------------------------------------------- |
| 581 |
|
| 582 |
!if "$(PROJECT)" != "tcl" |
| 583 |
|
| 584 |
TCL_VERSION = $(TCL_MAJOR_VERSION)$(TCL_MINOR_VERSION) |
| 585 |
|
| 586 |
!if $(TCL_VERSION) < 81 |
| 587 |
TCL_DOES_STUBS = 0 |
| 588 |
!else |
| 589 |
TCL_DOES_STUBS = 1 |
| 590 |
!endif |
| 591 |
|
| 592 |
!if $(TCLINSTALL) |
| 593 |
TCLSH = "$(_TCLDIR)\bin\tclsh$(TCL_VERSION)$(SUFX).exe" |
| 594 |
!if !exist($(TCLSH)) && $(TCL_THREADS) |
| 595 |
TCLSH = "$(_TCLDIR)\bin\tclsh$(TCL_VERSION)t$(SUFX).exe" |
| 596 |
!endif |
| 597 |
TCLSTUBLIB = "$(_TCLDIR)\lib\tclstub$(TCL_VERSION).lib" |
| 598 |
TCLIMPLIB = "$(_TCLDIR)\lib\tcl$(TCL_VERSION)$(SUFX).lib" |
| 599 |
TCL_LIBRARY = $(_TCLDIR)\lib |
| 600 |
TCLREGLIB = "$(_TCLDIR)\lib\tclreg13$(SUFX:t=).lib" |
| 601 |
TCLDDELIB = "$(_TCLDIR)\lib\tcldde14$(SUFX:t=).lib" |
| 602 |
COFFBASE = \must\have\tcl\sources\to\build\this\target |
| 603 |
TCLTOOLSDIR = \must\have\tcl\sources\to\build\this\target |
| 604 |
TCL_INCLUDES = -I"$(_TCLDIR)\include" |
| 605 |
!else |
| 606 |
TCLSH = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tclsh$(TCL_VERSION)$(SUFX).exe" |
| 607 |
!if !exist($(TCLSH)) && $(TCL_THREADS) |
| 608 |
TCLSH = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tclsh$(TCL_VERSION)t$(SUFX).exe" |
| 609 |
!endif |
| 610 |
TCLSTUBLIB = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tclstub$(TCL_VERSION).lib" |
| 611 |
TCLIMPLIB = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tcl$(TCL_VERSION)$(SUFX).lib" |
| 612 |
TCL_LIBRARY = $(_TCLDIR)\library |
| 613 |
TCLREGLIB = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tclreg13$(SUFX:t=).lib" |
| 614 |
TCLDDELIB = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tcldde14$(SUFX:t=).lib" |
| 615 |
COFFBASE = "$(_TCLDIR)\win\coffbase.txt" |
| 616 |
TCLTOOLSDIR = $(_TCLDIR)\tools |
| 617 |
TCL_INCLUDES = -I"$(_TCLDIR)\generic" -I"$(_TCLDIR)\win" |
| 618 |
!endif |
| 619 |
|
| 620 |
!endif |
| 621 |
|
| 622 |
#------------------------------------------------------------------------- |
| 623 |
# Locate the Tk headers to build against |
| 624 |
#------------------------------------------------------------------------- |
| 625 |
|
| 626 |
!if "$(PROJECT)" == "tk" |
| 627 |
_TK_H = ..\generic\tk.h |
| 628 |
_INSTALLDIR = $(_INSTALLDIR)\.. |
| 629 |
!endif |
| 630 |
|
| 631 |
!ifdef PROJECT_REQUIRES_TK |
| 632 |
!if !defined(TKDIR) |
| 633 |
!if exist("$(_INSTALLDIR)\..\include\tk.h") |
| 634 |
TKINSTALL = 1 |
| 635 |
_TKDIR = $(_INSTALLDIR)\.. |
| 636 |
_TK_H = $(_TKDIR)\include\tk.h |
| 637 |
TKDIR = $(_TKDIR) |
| 638 |
!elseif exist("$(_TCLDIR)\include\tk.h") |
| 639 |
TKINSTALL = 1 |
| 640 |
_TKDIR = $(_TCLDIR) |
| 641 |
_TK_H = $(_TKDIR)\include\tk.h |
| 642 |
TKDIR = $(_TKDIR) |
| 643 |
!endif |
| 644 |
!else |
| 645 |
_TKDIR = $(TKDIR:/=\) |
| 646 |
!if exist("$(_TKDIR)\include\tk.h") |
| 647 |
TKINSTALL = 1 |
| 648 |
_TK_H = $(_TKDIR)\include\tk.h |
| 649 |
!elseif exist("$(_TKDIR)\generic\tk.h") |
| 650 |
TKINSTALL = 0 |
| 651 |
_TK_H = $(_TKDIR)\generic\tk.h |
| 652 |
!else |
| 653 |
MSG =^ |
| 654 |
Failed to find tk.h. The TKDIR macro does not appear correct. |
| 655 |
!error $(MSG) |
| 656 |
!endif |
| 657 |
!endif |
| 658 |
!endif |
| 659 |
|
| 660 |
#------------------------------------------------------------------------- |
| 661 |
# Extract Tk version numbers |
| 662 |
#------------------------------------------------------------------------- |
| 663 |
|
| 664 |
!if defined(PROJECT_REQUIRES_TK) || "$(PROJECT)" == "tk" |
| 665 |
|
| 666 |
!if [echo TK_MAJOR_VERSION = \>> versions.vc] \ |
| 667 |
&& [nmakehlp -V $(_TK_H) TK_MAJOR_VERSION >> versions.vc] |
| 668 |
!endif |
| 669 |
!if [echo TK_MINOR_VERSION = \>> versions.vc] \ |
| 670 |
&& [nmakehlp -V $(_TK_H) TK_MINOR_VERSION >> versions.vc] |
| 671 |
!endif |
| 672 |
!if [echo TK_PATCH_LEVEL = \>> versions.vc] \ |
| 673 |
&& [nmakehlp -V $(_TK_H) TK_PATCH_LEVEL >> versions.vc] |
| 674 |
!endif |
| 675 |
|
| 676 |
!include versions.vc |
| 677 |
|
| 678 |
TK_DOTVERSION = $(TK_MAJOR_VERSION).$(TK_MINOR_VERSION) |
| 679 |
TK_VERSION = $(TK_MAJOR_VERSION)$(TK_MINOR_VERSION) |
| 680 |
|
| 681 |
!if "$(PROJECT)" != "tk" |
| 682 |
!if $(TKINSTALL) |
| 683 |
WISH = "$(_TKDIR)\bin\wish$(TK_VERSION)$(SUFX).exe" |
| 684 |
TKSTUBLIB = "$(_TKDIR)\lib\tkstub$(TK_VERSION).lib" |
| 685 |
TKIMPLIB = "$(_TKDIR)\lib\tk$(TK_VERSION)$(SUFX).lib" |
| 686 |
TK_INCLUDES = -I"$(_TKDIR)\include" |
| 687 |
!else |
| 688 |
WISH = "$(_TKDIR)\win\$(BUILDDIRTOP)\wish$(TCL_VERSION)$(SUFX).exe" |
| 689 |
TKSTUBLIB = "$(_TKDIR)\win\$(BUILDDIRTOP)\tkstub$(TCL_VERSION).lib" |
| 690 |
TKIMPLIB = "$(_TKDIR)\win\$(BUILDDIRTOP)\tk$(TCL_VERSION)$(SUFX).lib" |
| 691 |
TK_INCLUDES = -I"$(_TKDIR)\generic" -I"$(_TKDIR)\win" -I"$(_TKDIR)\xlib" |
| 692 |
!endif |
| 693 |
!endif |
| 694 |
|
| 695 |
!endif |
| 696 |
|
| 697 |
#---------------------------------------------------------- |
| 698 |
# Display stats being used. |
| 699 |
#---------------------------------------------------------- |
| 700 |
|
| 701 |
!message *** Intermediate directory will be '$(TMP_DIR)' |
| 702 |
!message *** Output directory will be '$(OUT_DIR)' |
| 703 |
!message *** Suffix for binaries will be '$(SUFX)' |
| 704 |
!message *** Optional defines are '$(OPTDEFINES)' |
| 705 |
!message *** Compiler version $(VCVER). Target machine is $(MACHINE) |
| 706 |
!message *** Host architecture is $(NATIVE_ARCH) |
| 707 |
!message *** Compiler options '$(COMPILERFLAGS) $(OPTIMIZATIONS) $(DEBUGFLAGS) $(WARNINGS)' |
| 708 |
!message *** Link options '$(LINKERFLAGS)' |
| 709 |
|
| 710 |
!endif |
| 711 |
|