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