author | sl |
Tue, 10 Jun 2014 14:32:02 +0200 | |
changeset 1 | 260cb5ec6c19 |
permissions | -rw-r--r-- |
sl@0 | 1 |
#------------------------------------------------------------------------------ |
sl@0 | 2 |
# rules.vc -- |
sl@0 | 3 |
# |
sl@0 | 4 |
# Microsoft Visual C++ makefile include for decoding the commandline |
sl@0 | 5 |
# macros. This file does not need editing to build Tcl. |
sl@0 | 6 |
# |
sl@0 | 7 |
# See the file "license.terms" for information on usage and redistribution |
sl@0 | 8 |
# of this file, and for a DISCLAIMER OF ALL WARRANTIES. |
sl@0 | 9 |
# |
sl@0 | 10 |
# Copyright (c) 2001-2003 David Gravereaux. |
sl@0 | 11 |
# Copyright (c) 2003-2006 Patrick Thoyts |
sl@0 | 12 |
# |
sl@0 | 13 |
#------------------------------------------------------------------------------ |
sl@0 | 14 |
# RCS: @(#) $Id: rules.vc,v 1.11.2.6 2006/10/31 15:17:20 patthoyts Exp $ |
sl@0 | 15 |
#------------------------------------------------------------------------------ |
sl@0 | 16 |
|
sl@0 | 17 |
!ifndef _RULES_VC |
sl@0 | 18 |
_RULES_VC = 1 |
sl@0 | 19 |
|
sl@0 | 20 |
cc32 = $(CC) # built-in default. |
sl@0 | 21 |
link32 = link |
sl@0 | 22 |
lib32 = lib |
sl@0 | 23 |
rc32 = $(RC) # built-in default. |
sl@0 | 24 |
|
sl@0 | 25 |
!ifndef INSTALLDIR |
sl@0 | 26 |
### Assume the normal default. |
sl@0 | 27 |
_INSTALLDIR = C:\Program Files\Tcl |
sl@0 | 28 |
!else |
sl@0 | 29 |
### Fix the path separators. |
sl@0 | 30 |
_INSTALLDIR = $(INSTALLDIR:/=\) |
sl@0 | 31 |
!endif |
sl@0 | 32 |
|
sl@0 | 33 |
!ifndef MACHINE |
sl@0 | 34 |
!if "$(CPU)" == "" || "$(CPU)" == "i386" |
sl@0 | 35 |
MACHINE = IX86 |
sl@0 | 36 |
!else |
sl@0 | 37 |
MACHINE = $(CPU) |
sl@0 | 38 |
!endif |
sl@0 | 39 |
!endif |
sl@0 | 40 |
|
sl@0 | 41 |
!ifndef CFG_ENCODING |
sl@0 | 42 |
CFG_ENCODING = \"cp1252\" |
sl@0 | 43 |
!endif |
sl@0 | 44 |
|
sl@0 | 45 |
#---------------------------------------------------------- |
sl@0 | 46 |
# Set the proper copy method to avoid overwrite questions |
sl@0 | 47 |
# to the user when copying files and selecting the right |
sl@0 | 48 |
# "delete all" method. |
sl@0 | 49 |
#---------------------------------------------------------- |
sl@0 | 50 |
|
sl@0 | 51 |
!if "$(OS)" == "Windows_NT" |
sl@0 | 52 |
RMDIR = rmdir /S /Q |
sl@0 | 53 |
!if ![ver | find "4.0" > nul] |
sl@0 | 54 |
CPY = echo y | xcopy /i |
sl@0 | 55 |
!else |
sl@0 | 56 |
CPY = xcopy /i /y >NUL |
sl@0 | 57 |
!endif |
sl@0 | 58 |
!else |
sl@0 | 59 |
CPY = xcopy /i |
sl@0 | 60 |
RMDIR = deltree /Y |
sl@0 | 61 |
!endif |
sl@0 | 62 |
MKDIR = mkdir |
sl@0 | 63 |
COPY = copy /y >NUL |
sl@0 | 64 |
|
sl@0 | 65 |
!message =============================================================================== |
sl@0 | 66 |
|
sl@0 | 67 |
#---------------------------------------------------------- |
sl@0 | 68 |
# build the helper app we need to overcome nmake's limiting |
sl@0 | 69 |
# environment. |
sl@0 | 70 |
#---------------------------------------------------------- |
sl@0 | 71 |
|
sl@0 | 72 |
!if !exist(nmakehlp.exe) |
sl@0 | 73 |
!if [$(cc32) -nologo nmakehlp.c -link -subsystem:console > nul] |
sl@0 | 74 |
!endif |
sl@0 | 75 |
!endif |
sl@0 | 76 |
|
sl@0 | 77 |
#---------------------------------------------------------- |
sl@0 | 78 |
# Test for compiler features |
sl@0 | 79 |
#---------------------------------------------------------- |
sl@0 | 80 |
|
sl@0 | 81 |
### test for optimizations |
sl@0 | 82 |
!if [nmakehlp -c -Ot] |
sl@0 | 83 |
!message *** Compiler has 'Optimizations' |
sl@0 | 84 |
OPTIMIZING = 1 |
sl@0 | 85 |
!else |
sl@0 | 86 |
!message *** Compiler doesn't have 'Optimizations' |
sl@0 | 87 |
OPTIMIZING = 0 |
sl@0 | 88 |
!endif |
sl@0 | 89 |
|
sl@0 | 90 |
OPTIMIZATIONS = |
sl@0 | 91 |
|
sl@0 | 92 |
!if [nmakehlp -c -Ot] |
sl@0 | 93 |
OPTIMIZATIONS = $(OPTIMIZATIONS) -Ot |
sl@0 | 94 |
!endif |
sl@0 | 95 |
|
sl@0 | 96 |
!if [nmakehlp -c -Oi] |
sl@0 | 97 |
OPTIMIZATIONS = $(OPTIMIZATIONS) -Oi |
sl@0 | 98 |
!endif |
sl@0 | 99 |
|
sl@0 | 100 |
!if [nmakehlp -c -Op] |
sl@0 | 101 |
OPTIMIZATIONS = $(OPTIMIZATIONS) -Op |
sl@0 | 102 |
!endif |
sl@0 | 103 |
|
sl@0 | 104 |
!if [nmakehlp -c -fp:strict] |
sl@0 | 105 |
OPTIMIZATIONS = $(OPTIMIZATIONS) -fp:strict |
sl@0 | 106 |
!endif |
sl@0 | 107 |
|
sl@0 | 108 |
!if [nmakehlp -c -Gs] |
sl@0 | 109 |
OPTIMIZATIONS = $(OPTIMIZATIONS) -Gs |
sl@0 | 110 |
!endif |
sl@0 | 111 |
|
sl@0 | 112 |
!if [nmakehlp -c -GS] |
sl@0 | 113 |
OPTIMIZATIONS = $(OPTIMIZATIONS) -GS |
sl@0 | 114 |
!endif |
sl@0 | 115 |
|
sl@0 | 116 |
!if [nmakehlp -c -GL] |
sl@0 | 117 |
OPTIMIZATIONS = $(OPTIMIZATIONS) -GL |
sl@0 | 118 |
!endif |
sl@0 | 119 |
|
sl@0 | 120 |
DEBUGFLAGS = |
sl@0 | 121 |
|
sl@0 | 122 |
!if [nmakehlp -c -RTC1] |
sl@0 | 123 |
DEBUGFLAGS = $(DEBUGFLAGS) -RTC1 |
sl@0 | 124 |
!elseif [nmakehlp -c -GZ] |
sl@0 | 125 |
DEBUGFLAGS = $(DEBUGFLAGS) -GZ |
sl@0 | 126 |
!endif |
sl@0 | 127 |
|
sl@0 | 128 |
COMPILERFLAGS =-W3 |
sl@0 | 129 |
|
sl@0 | 130 |
# In v13 -GL and -YX are incompatible. |
sl@0 | 131 |
!if [nmakehlp -c -YX] |
sl@0 | 132 |
!if ![nmakehlp -c -GL] |
sl@0 | 133 |
OPTIMIZATIONS = $(OPTIMIZATIONS) -YX |
sl@0 | 134 |
!endif |
sl@0 | 135 |
!endif |
sl@0 | 136 |
|
sl@0 | 137 |
!if "$(MACHINE)" == "IX86" |
sl@0 | 138 |
### test for pentium errata |
sl@0 | 139 |
!if [nmakehlp -c -QI0f] |
sl@0 | 140 |
!message *** Compiler has 'Pentium 0x0f fix' |
sl@0 | 141 |
COMPILERFLAGS = $(COMPILERFLAGSS) -QI0f |
sl@0 | 142 |
!else |
sl@0 | 143 |
!message *** Compiler doesn't have 'Pentium 0x0f fix' |
sl@0 | 144 |
!endif |
sl@0 | 145 |
!endif |
sl@0 | 146 |
|
sl@0 | 147 |
!if "$(MACHINE)" == "IA64" |
sl@0 | 148 |
### test for Itanium errata |
sl@0 | 149 |
!if [nmakehlp -c -QIA64_Bx] |
sl@0 | 150 |
!message *** Compiler has 'B-stepping errata workarounds' |
sl@0 | 151 |
COMPILERFLAGS = $(COMPILERFLAGS) -QIA64_Bx |
sl@0 | 152 |
!else |
sl@0 | 153 |
!message *** Compiler does not have 'B-stepping errata workarounds' |
sl@0 | 154 |
!endif |
sl@0 | 155 |
!endif |
sl@0 | 156 |
|
sl@0 | 157 |
!if "$(MACHINE)" == "IX86" |
sl@0 | 158 |
### test for -align:4096, when align:512 will do. |
sl@0 | 159 |
!if [nmakehlp -l -opt:nowin98] |
sl@0 | 160 |
!message *** Linker has 'Win98 alignment problem' |
sl@0 | 161 |
ALIGN98_HACK = 1 |
sl@0 | 162 |
!else |
sl@0 | 163 |
!message *** Linker doesn't have 'Win98 alignment problem' |
sl@0 | 164 |
ALIGN98_HACK = 0 |
sl@0 | 165 |
!endif |
sl@0 | 166 |
!else |
sl@0 | 167 |
ALIGN98_HACK = 0 |
sl@0 | 168 |
!endif |
sl@0 | 169 |
|
sl@0 | 170 |
LINKERFLAGS = |
sl@0 | 171 |
|
sl@0 | 172 |
!if [nmakehlp -l -ltcg] |
sl@0 | 173 |
LINKERFLAGS =-ltcg |
sl@0 | 174 |
!endif |
sl@0 | 175 |
|
sl@0 | 176 |
#---------------------------------------------------------- |
sl@0 | 177 |
# MSVC8 (ships with Visual Studio 2005) generates a manifest |
sl@0 | 178 |
# file that we should link into the binaries. This is how. |
sl@0 | 179 |
#---------------------------------------------------------- |
sl@0 | 180 |
|
sl@0 | 181 |
_VC_MANIFEST_EMBED_EXE= |
sl@0 | 182 |
_VC_MANIFEST_EMBED_DLL= |
sl@0 | 183 |
!if ![cl /Zs /Tc NUL 2>&1 | find "Version 12" > NUL] |
sl@0 | 184 |
VCVER=6 |
sl@0 | 185 |
!elseif ![cl /Zs /Tc NUL 2>&1 | find "Version 13" > NUL] |
sl@0 | 186 |
VCVER=7 |
sl@0 | 187 |
!elseif ![cl /Zs /Tc NUL 2>&1 | find "Version 14" > NUL] |
sl@0 | 188 |
VCVER=8 |
sl@0 | 189 |
_VC_MANIFEST_EMBED_EXE=if exist $@.manifest mt -nologo -manifest $@.manifest -outputresource:$@;1 |
sl@0 | 190 |
_VC_MANIFEST_EMBED_DLL=if exist $@.manifest mt -nologo -manifest $@.manifest -outputresource:$@;2 |
sl@0 | 191 |
!else |
sl@0 | 192 |
VCVER=0 |
sl@0 | 193 |
!endif |
sl@0 | 194 |
|
sl@0 | 195 |
#---------------------------------------------------------- |
sl@0 | 196 |
# Decode the options requested. |
sl@0 | 197 |
#---------------------------------------------------------- |
sl@0 | 198 |
|
sl@0 | 199 |
!if "$(OPTS)" == "" || [nmakehlp -f "$(OPTS)" "none"] |
sl@0 | 200 |
STATIC_BUILD = 0 |
sl@0 | 201 |
TCL_THREADS = 0 |
sl@0 | 202 |
DEBUG = 0 |
sl@0 | 203 |
PROFILE = 0 |
sl@0 | 204 |
MSVCRT = 0 |
sl@0 | 205 |
LOIMPACT = 0 |
sl@0 | 206 |
TCL_USE_STATIC_PACKAGES = 0 |
sl@0 | 207 |
USE_THREAD_ALLOC = 0 |
sl@0 | 208 |
UNCHECKED = 0 |
sl@0 | 209 |
!else |
sl@0 | 210 |
!if [nmakehlp -f $(OPTS) "static"] |
sl@0 | 211 |
!message *** Doing static |
sl@0 | 212 |
STATIC_BUILD = 1 |
sl@0 | 213 |
!else |
sl@0 | 214 |
STATIC_BUILD = 0 |
sl@0 | 215 |
!endif |
sl@0 | 216 |
!if [nmakehlp -f $(OPTS) "msvcrt"] |
sl@0 | 217 |
!message *** Doing msvcrt |
sl@0 | 218 |
MSVCRT = 1 |
sl@0 | 219 |
!else |
sl@0 | 220 |
MSVCRT = 0 |
sl@0 | 221 |
!endif |
sl@0 | 222 |
!if [nmakehlp -f $(OPTS) "staticpkg"] |
sl@0 | 223 |
!message *** Doing staticpkg |
sl@0 | 224 |
TCL_USE_STATIC_PACKAGES = 1 |
sl@0 | 225 |
!else |
sl@0 | 226 |
TCL_USE_STATIC_PACKAGES = 0 |
sl@0 | 227 |
!endif |
sl@0 | 228 |
!if [nmakehlp -f $(OPTS) "threads"] |
sl@0 | 229 |
!message *** Doing threads |
sl@0 | 230 |
TCL_THREADS = 1 |
sl@0 | 231 |
!else |
sl@0 | 232 |
TCL_THREADS = 0 |
sl@0 | 233 |
!endif |
sl@0 | 234 |
!if [nmakehlp -f $(OPTS) "symbols"] |
sl@0 | 235 |
!message *** Doing symbols |
sl@0 | 236 |
DEBUG = 1 |
sl@0 | 237 |
!else |
sl@0 | 238 |
DEBUG = 0 |
sl@0 | 239 |
!endif |
sl@0 | 240 |
!if [nmakehlp -f $(OPTS) "profile"] |
sl@0 | 241 |
!message *** Doing profile |
sl@0 | 242 |
PROFILE = 1 |
sl@0 | 243 |
!else |
sl@0 | 244 |
PROFILE = 0 |
sl@0 | 245 |
!endif |
sl@0 | 246 |
!if [nmakehlp -f $(OPTS) "loimpact"] |
sl@0 | 247 |
!message *** Doing loimpact |
sl@0 | 248 |
LOIMPACT = 1 |
sl@0 | 249 |
!else |
sl@0 | 250 |
LOIMPACT = 0 |
sl@0 | 251 |
!endif |
sl@0 | 252 |
!if [nmakehlp -f $(OPTS) "thrdalloc"] |
sl@0 | 253 |
!message *** Doing thrdalloc |
sl@0 | 254 |
USE_THREAD_ALLOC = 1 |
sl@0 | 255 |
!else |
sl@0 | 256 |
USE_THREAD_ALLOC = 0 |
sl@0 | 257 |
!endif |
sl@0 | 258 |
!if [nmakehlp -f $(OPTS) "unchecked"] |
sl@0 | 259 |
!message *** Doing unchecked |
sl@0 | 260 |
UNCHECKED = 1 |
sl@0 | 261 |
!else |
sl@0 | 262 |
UNCHECKED = 0 |
sl@0 | 263 |
!endif |
sl@0 | 264 |
!endif |
sl@0 | 265 |
|
sl@0 | 266 |
|
sl@0 | 267 |
!if !$(STATIC_BUILD) |
sl@0 | 268 |
# Make sure we don't build overly fat DLLs. |
sl@0 | 269 |
MSVCRT = 1 |
sl@0 | 270 |
# We shouldn't statically put the extensions inside the shell when dynamic. |
sl@0 | 271 |
TCL_USE_STATIC_PACKAGES = 0 |
sl@0 | 272 |
!endif |
sl@0 | 273 |
|
sl@0 | 274 |
|
sl@0 | 275 |
#---------------------------------------------------------- |
sl@0 | 276 |
# Figure-out how to name our intermediate and output directories. |
sl@0 | 277 |
# We wouldn't want different builds to use the same .obj files |
sl@0 | 278 |
# by accident. |
sl@0 | 279 |
#---------------------------------------------------------- |
sl@0 | 280 |
|
sl@0 | 281 |
#---------------------------------------- |
sl@0 | 282 |
# Naming convention: |
sl@0 | 283 |
# t = full thread support. |
sl@0 | 284 |
# s = static library (as opposed to an |
sl@0 | 285 |
# import library) |
sl@0 | 286 |
# g = linked to the debug enabled C |
sl@0 | 287 |
# run-time. |
sl@0 | 288 |
# x = special static build when it |
sl@0 | 289 |
# links to the dynamic C run-time. |
sl@0 | 290 |
#---------------------------------------- |
sl@0 | 291 |
SUFX = tsgx |
sl@0 | 292 |
|
sl@0 | 293 |
!if $(DEBUG) |
sl@0 | 294 |
BUILDDIRTOP = Debug |
sl@0 | 295 |
DBGX = g |
sl@0 | 296 |
!else |
sl@0 | 297 |
BUILDDIRTOP = Release |
sl@0 | 298 |
DBGX = |
sl@0 | 299 |
SUFX = $(SUFX:g=) |
sl@0 | 300 |
!endif |
sl@0 | 301 |
|
sl@0 | 302 |
!if "$(MACHINE)" != "IX86" |
sl@0 | 303 |
BUILDDIRTOP =$(BUILDDIRTOP)_$(MACHINE) |
sl@0 | 304 |
!endif |
sl@0 | 305 |
!if $(VCVER) > 6 |
sl@0 | 306 |
BUILDDIRTOP =$(BUILDDIRTOP)_VC$(VCVER) |
sl@0 | 307 |
!endif |
sl@0 | 308 |
|
sl@0 | 309 |
TMP_DIRFULL = .\$(BUILDDIRTOP)\$(PROJECT)_ThreadedDynamicStaticX |
sl@0 | 310 |
|
sl@0 | 311 |
!if !$(STATIC_BUILD) |
sl@0 | 312 |
TMP_DIRFULL = $(TMP_DIRFULL:Static=) |
sl@0 | 313 |
SUFX = $(SUFX:s=) |
sl@0 | 314 |
EXT = dll |
sl@0 | 315 |
!if $(MSVCRT) |
sl@0 | 316 |
TMP_DIRFULL = $(TMP_DIRFULL:X=) |
sl@0 | 317 |
SUFX = $(SUFX:x=) |
sl@0 | 318 |
!endif |
sl@0 | 319 |
!else |
sl@0 | 320 |
TMP_DIRFULL = $(TMP_DIRFULL:Dynamic=) |
sl@0 | 321 |
EXT = lib |
sl@0 | 322 |
!if !$(MSVCRT) |
sl@0 | 323 |
TMP_DIRFULL = $(TMP_DIRFULL:X=) |
sl@0 | 324 |
SUFX = $(SUFX:x=) |
sl@0 | 325 |
!endif |
sl@0 | 326 |
!endif |
sl@0 | 327 |
|
sl@0 | 328 |
!if !$(TCL_THREADS) |
sl@0 | 329 |
TMP_DIRFULL = $(TMP_DIRFULL:Threaded=) |
sl@0 | 330 |
SUFX = $(SUFX:t=) |
sl@0 | 331 |
!endif |
sl@0 | 332 |
|
sl@0 | 333 |
!ifndef TMP_DIR |
sl@0 | 334 |
TMP_DIR = $(TMP_DIRFULL) |
sl@0 | 335 |
!ifndef OUT_DIR |
sl@0 | 336 |
OUT_DIR = .\$(BUILDDIRTOP) |
sl@0 | 337 |
!endif |
sl@0 | 338 |
!else |
sl@0 | 339 |
!ifndef OUT_DIR |
sl@0 | 340 |
OUT_DIR = $(TMP_DIR) |
sl@0 | 341 |
!endif |
sl@0 | 342 |
!endif |
sl@0 | 343 |
|
sl@0 | 344 |
|
sl@0 | 345 |
#---------------------------------------------------------- |
sl@0 | 346 |
# Decode the statistics requested. |
sl@0 | 347 |
#---------------------------------------------------------- |
sl@0 | 348 |
|
sl@0 | 349 |
!if "$(STATS)" == "" || [nmakehlp -f "$(STATS)" "none"] |
sl@0 | 350 |
TCL_MEM_DEBUG = 0 |
sl@0 | 351 |
TCL_COMPILE_DEBUG = 0 |
sl@0 | 352 |
!else |
sl@0 | 353 |
!if [nmakehlp -f $(STATS) "memdbg"] |
sl@0 | 354 |
!message *** Doing memdbg |
sl@0 | 355 |
TCL_MEM_DEBUG = 1 |
sl@0 | 356 |
!else |
sl@0 | 357 |
TCL_MEM_DEBUG = 0 |
sl@0 | 358 |
!endif |
sl@0 | 359 |
!if [nmakehlp -f $(STATS) "compdbg"] |
sl@0 | 360 |
!message *** Doing compdbg |
sl@0 | 361 |
TCL_COMPILE_DEBUG = 1 |
sl@0 | 362 |
!else |
sl@0 | 363 |
TCL_COMPILE_DEBUG = 0 |
sl@0 | 364 |
!endif |
sl@0 | 365 |
!endif |
sl@0 | 366 |
|
sl@0 | 367 |
#---------------------------------------------------------- |
sl@0 | 368 |
# Decode the checks requested. |
sl@0 | 369 |
#---------------------------------------------------------- |
sl@0 | 370 |
|
sl@0 | 371 |
!if "$(CHECKS)" == "" || [nmakehlp -f "$(CHECKS)" "none"] |
sl@0 | 372 |
TCL_NO_DEPRECATED = 0 |
sl@0 | 373 |
FULLWARNINGS = 0 |
sl@0 | 374 |
!else |
sl@0 | 375 |
!if [nmakehlp -f $(CHECKS) "nodep"] |
sl@0 | 376 |
!message *** Doing nodep check |
sl@0 | 377 |
TCL_NO_DEPRECATED = 1 |
sl@0 | 378 |
!else |
sl@0 | 379 |
TCL_NO_DEPRECATED = 0 |
sl@0 | 380 |
!endif |
sl@0 | 381 |
!if [nmakehlp -f $(CHECKS) "fullwarn"] |
sl@0 | 382 |
!message *** Doing full warnings check |
sl@0 | 383 |
FULLWARNINGS = 1 |
sl@0 | 384 |
!else |
sl@0 | 385 |
FULLWARNINGS = 0 |
sl@0 | 386 |
!endif |
sl@0 | 387 |
!endif |
sl@0 | 388 |
|
sl@0 | 389 |
|
sl@0 | 390 |
#---------------------------------------------------------- |
sl@0 | 391 |
# Set our defines now armed with our options. |
sl@0 | 392 |
#---------------------------------------------------------- |
sl@0 | 393 |
|
sl@0 | 394 |
OPTDEFINES = |
sl@0 | 395 |
!if $(TCL_MEM_DEBUG) |
sl@0 | 396 |
OPTDEFINES = $(OPTDEFINES) -DTCL_MEM_DEBUG |
sl@0 | 397 |
!endif |
sl@0 | 398 |
!if $(TCL_COMPILE_DEBUG) |
sl@0 | 399 |
OPTDEFINES = $(OPTDEFINES) -DTCL_COMPILE_DEBUG -DTCL_COMPILE_STATS |
sl@0 | 400 |
!endif |
sl@0 | 401 |
!if $(TCL_THREADS) |
sl@0 | 402 |
OPTDEFINES = $(OPTDEFINES) -DTCL_THREADS=1 |
sl@0 | 403 |
!if $(USE_THREAD_ALLOC) |
sl@0 | 404 |
OPTDEFINES = $(OPTDEFINES) -DUSE_THREAD_ALLOC=1 |
sl@0 | 405 |
!endif |
sl@0 | 406 |
!endif |
sl@0 | 407 |
!if $(STATIC_BUILD) |
sl@0 | 408 |
OPTDEFINES = $(OPTDEFINES) -DSTATIC_BUILD |
sl@0 | 409 |
!endif |
sl@0 | 410 |
|
sl@0 | 411 |
!if $(DEBUG) |
sl@0 | 412 |
OPTDEFINES = $(OPTDEFINES) -DTCL_CFG_DEBUG |
sl@0 | 413 |
!elseif $(OPTIMIZING) |
sl@0 | 414 |
OPTDEFINES = $(OPTDEFINES) -DTCL_CFG_OPTIMIZED |
sl@0 | 415 |
!endif |
sl@0 | 416 |
!if $(PROFILE) |
sl@0 | 417 |
OPTDEFINES = $(OPTDEFINES) -DTCL_CFG_PROFILED |
sl@0 | 418 |
!endif |
sl@0 | 419 |
!if "$(MACHINE)" == "IA64" || "$(MACHINE)" == "AMD64" |
sl@0 | 420 |
OPTDEFINES = $(OPTDEFINES) -DTCL_CFG_DO64BIT |
sl@0 | 421 |
!endif |
sl@0 | 422 |
|
sl@0 | 423 |
|
sl@0 | 424 |
#---------------------------------------------------------- |
sl@0 | 425 |
# Get common info used when building extensions. |
sl@0 | 426 |
#---------------------------------------------------------- |
sl@0 | 427 |
|
sl@0 | 428 |
!if "$(PROJECT)" != "tcl" |
sl@0 | 429 |
|
sl@0 | 430 |
!if !defined(TCLDIR) |
sl@0 | 431 |
!if exist("$(_INSTALLDIR)\include\tcl.h") |
sl@0 | 432 |
TCLH = "$(_INSTALLDIR)\include\tcl.h" |
sl@0 | 433 |
TCLINSTALL = 1 |
sl@0 | 434 |
_TCLDIR = $(_INSTALLDIR) |
sl@0 | 435 |
!else |
sl@0 | 436 |
MSG=^ |
sl@0 | 437 |
Failed to find tcl.h. Set the TCLDIR macro. |
sl@0 | 438 |
!error $(MSG) |
sl@0 | 439 |
!endif |
sl@0 | 440 |
!else |
sl@0 | 441 |
_TCLDIR = $(TCLDIR:/=\) |
sl@0 | 442 |
!if exist("$(_TCLDIR)\include\tcl.h") |
sl@0 | 443 |
TCLH = "$(_TCLDIR)\include\tcl.h" |
sl@0 | 444 |
TCLINSTALL = 1 |
sl@0 | 445 |
!elseif exist("$(_TCLDIR)\generic\tcl.h") |
sl@0 | 446 |
TCLH = "$(_TCLDIR)\generic\tcl.h" |
sl@0 | 447 |
TCLINSTALL = 0 |
sl@0 | 448 |
!else |
sl@0 | 449 |
MSG =^ |
sl@0 | 450 |
Failed to find tcl.h. The TCLDIR macro does not appear correct. |
sl@0 | 451 |
!error $(MSG) |
sl@0 | 452 |
!endif |
sl@0 | 453 |
!endif |
sl@0 | 454 |
|
sl@0 | 455 |
### TODO: add a command to nmakehlp.c to grep for Tcl's version from tcl.h. |
sl@0 | 456 |
### Because nmake can't return a string, we'll need to play games with return |
sl@0 | 457 |
### codes. It might look something like this: |
sl@0 | 458 |
#!if [nmakehlp -g $(TCL.H)] == 81 |
sl@0 | 459 |
#TCL_DOTVERSION = 8.1 |
sl@0 | 460 |
#!elseif [nmakehlp -g $(TCL.H)] == 82 |
sl@0 | 461 |
#TCL_DOTVERSION = 8.2 |
sl@0 | 462 |
#... |
sl@0 | 463 |
#!endif |
sl@0 | 464 |
|
sl@0 | 465 |
TCL_DOTVERSION = 8.4 |
sl@0 | 466 |
TCL_VERSION = $(TCL_DOTVERSION:.=) |
sl@0 | 467 |
|
sl@0 | 468 |
!if $(TCLINSTALL) |
sl@0 | 469 |
TCLSH = "$(_INSTALLDIR)\bin\tclsh$(TCL_VERSION)$(SUFX).exe" |
sl@0 | 470 |
TCLSTUBLIB = "$(_INSTALLDIR)\lib\tclstub$(TCL_VERSION).lib" |
sl@0 | 471 |
TCLIMPLIB = "$(_INSTALLDIR)\lib\tcl$(TCL_VERSION)$(SUFX).lib" |
sl@0 | 472 |
TCL_LIBRARY = $(_INSTALLDIR)\lib |
sl@0 | 473 |
TCLREGLIB = "$(_INSTALLDIR)\lib\tclreg11$(SUFX:t=).lib" |
sl@0 | 474 |
TCLDDELIB = "$(_INSTALLDIR)\lib\tcldde12$(SUFX:t=).lib" |
sl@0 | 475 |
COFFBASE = \must\have\tcl\sources\to\build\this\target |
sl@0 | 476 |
TCLTOOLSDIR = \must\have\tcl\sources\to\build\this\target |
sl@0 | 477 |
!else |
sl@0 | 478 |
TCLSH = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tclsh$(TCL_VERSION)$(SUFX).exe" |
sl@0 | 479 |
TCLSTUBLIB = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tclstub$(TCL_VERSION).lib" |
sl@0 | 480 |
TCLIMPLIB = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tcl$(TCL_VERSION)$(SUFX).lib" |
sl@0 | 481 |
TCL_LIBRARY = $(_TCLDIR)\library |
sl@0 | 482 |
TCLREGLIB = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tclreg11$(SUFX:t=).lib" |
sl@0 | 483 |
TCLDDELIB = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tcldde12$(SUFX:t=).lib" |
sl@0 | 484 |
COFFBASE = "$(_TCLDIR)\win\coffbase.txt" |
sl@0 | 485 |
TCLTOOLSDIR = $(_TCLDIR)\tools |
sl@0 | 486 |
!endif |
sl@0 | 487 |
|
sl@0 | 488 |
!endif |
sl@0 | 489 |
|
sl@0 | 490 |
|
sl@0 | 491 |
#---------------------------------------------------------- |
sl@0 | 492 |
# Display stats being used. |
sl@0 | 493 |
#---------------------------------------------------------- |
sl@0 | 494 |
|
sl@0 | 495 |
!message *** Intermediate directory will be '$(TMP_DIR)' |
sl@0 | 496 |
!message *** Output directory will be '$(OUT_DIR)' |
sl@0 | 497 |
!message *** Suffix for binaries will be '$(SUFX)' |
sl@0 | 498 |
!message *** Optional defines are '$(OPTDEFINES)' |
sl@0 | 499 |
!message *** Compiler version $(VCVER) |
sl@0 | 500 |
!message *** Compiler options '$(OPTIMIZATIONS) $(DEBUGFLAGS)' |
sl@0 | 501 |
!message *** Link options '$(LINKERFLAGS)' |
sl@0 | 502 |
|
sl@0 | 503 |
!endif |
sl@0 | 504 |