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