os/persistentdata/persistentstorage/sqlite3api/TEST/TCL/tcldistribution/win/rules.vc
First public contribution.
1 #------------------------------------------------------------------------------
4 # Microsoft Visual C++ makefile include for decoding the commandline
5 # macros. This file does not need editing to build Tcl.
7 # See the file "license.terms" for information on usage and redistribution
8 # of this file, and for a DISCLAIMER OF ALL WARRANTIES.
10 # Copyright (c) 2001-2003 David Gravereaux.
11 # Copyright (c) 2003-2006 Patrick Thoyts
13 #------------------------------------------------------------------------------
14 # RCS: @(#) $Id: rules.vc,v 1.11.2.6 2006/10/31 15:17:20 patthoyts Exp $
15 #------------------------------------------------------------------------------
20 cc32 = $(CC) # built-in default.
23 rc32 = $(RC) # built-in default.
26 ### Assume the normal default.
27 _INSTALLDIR = C:\Program Files\Tcl
29 ### Fix the path separators.
30 _INSTALLDIR = $(INSTALLDIR:/=\)
34 !if "$(CPU)" == "" || "$(CPU)" == "i386"
42 CFG_ENCODING = \"cp1252\"
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 #----------------------------------------------------------
51 !if "$(OS)" == "Windows_NT"
53 !if ![ver | find "4.0" > nul]
54 CPY = echo y | xcopy /i
56 CPY = xcopy /i /y >NUL
65 !message ===============================================================================
67 #----------------------------------------------------------
68 # build the helper app we need to overcome nmake's limiting
70 #----------------------------------------------------------
72 !if !exist(nmakehlp.exe)
73 !if [$(cc32) -nologo nmakehlp.c -link -subsystem:console > nul]
77 #----------------------------------------------------------
78 # Test for compiler features
79 #----------------------------------------------------------
81 ### test for optimizations
83 !message *** Compiler has 'Optimizations'
86 !message *** Compiler doesn't have 'Optimizations'
93 OPTIMIZATIONS = $(OPTIMIZATIONS) -Ot
97 OPTIMIZATIONS = $(OPTIMIZATIONS) -Oi
100 !if [nmakehlp -c -Op]
101 OPTIMIZATIONS = $(OPTIMIZATIONS) -Op
104 !if [nmakehlp -c -fp:strict]
105 OPTIMIZATIONS = $(OPTIMIZATIONS) -fp:strict
108 !if [nmakehlp -c -Gs]
109 OPTIMIZATIONS = $(OPTIMIZATIONS) -Gs
112 !if [nmakehlp -c -GS]
113 OPTIMIZATIONS = $(OPTIMIZATIONS) -GS
116 !if [nmakehlp -c -GL]
117 OPTIMIZATIONS = $(OPTIMIZATIONS) -GL
122 !if [nmakehlp -c -RTC1]
123 DEBUGFLAGS = $(DEBUGFLAGS) -RTC1
124 !elseif [nmakehlp -c -GZ]
125 DEBUGFLAGS = $(DEBUGFLAGS) -GZ
130 # In v13 -GL and -YX are incompatible.
131 !if [nmakehlp -c -YX]
132 !if ![nmakehlp -c -GL]
133 OPTIMIZATIONS = $(OPTIMIZATIONS) -YX
137 !if "$(MACHINE)" == "IX86"
138 ### test for pentium errata
139 !if [nmakehlp -c -QI0f]
140 !message *** Compiler has 'Pentium 0x0f fix'
141 COMPILERFLAGS = $(COMPILERFLAGSS) -QI0f
143 !message *** Compiler doesn't have 'Pentium 0x0f fix'
147 !if "$(MACHINE)" == "IA64"
148 ### test for Itanium errata
149 !if [nmakehlp -c -QIA64_Bx]
150 !message *** Compiler has 'B-stepping errata workarounds'
151 COMPILERFLAGS = $(COMPILERFLAGS) -QIA64_Bx
153 !message *** Compiler does not have 'B-stepping errata workarounds'
157 !if "$(MACHINE)" == "IX86"
158 ### test for -align:4096, when align:512 will do.
159 !if [nmakehlp -l -opt:nowin98]
160 !message *** Linker has 'Win98 alignment problem'
163 !message *** Linker doesn't have 'Win98 alignment problem'
172 !if [nmakehlp -l -ltcg]
176 #----------------------------------------------------------
177 # MSVC8 (ships with Visual Studio 2005) generates a manifest
178 # file that we should link into the binaries. This is how.
179 #----------------------------------------------------------
181 _VC_MANIFEST_EMBED_EXE=
182 _VC_MANIFEST_EMBED_DLL=
183 !if ![cl /Zs /Tc NUL 2>&1 | find "Version 12" > NUL]
185 !elseif ![cl /Zs /Tc NUL 2>&1 | find "Version 13" > NUL]
187 !elseif ![cl /Zs /Tc NUL 2>&1 | find "Version 14" > NUL]
189 _VC_MANIFEST_EMBED_EXE=if exist $@.manifest mt -nologo -manifest $@.manifest -outputresource:$@;1
190 _VC_MANIFEST_EMBED_DLL=if exist $@.manifest mt -nologo -manifest $@.manifest -outputresource:$@;2
195 #----------------------------------------------------------
196 # Decode the options requested.
197 #----------------------------------------------------------
199 !if "$(OPTS)" == "" || [nmakehlp -f "$(OPTS)" "none"]
206 TCL_USE_STATIC_PACKAGES = 0
210 !if [nmakehlp -f $(OPTS) "static"]
211 !message *** Doing static
216 !if [nmakehlp -f $(OPTS) "msvcrt"]
217 !message *** Doing msvcrt
222 !if [nmakehlp -f $(OPTS) "staticpkg"]
223 !message *** Doing staticpkg
224 TCL_USE_STATIC_PACKAGES = 1
226 TCL_USE_STATIC_PACKAGES = 0
228 !if [nmakehlp -f $(OPTS) "threads"]
229 !message *** Doing threads
234 !if [nmakehlp -f $(OPTS) "symbols"]
235 !message *** Doing symbols
240 !if [nmakehlp -f $(OPTS) "profile"]
241 !message *** Doing profile
246 !if [nmakehlp -f $(OPTS) "loimpact"]
247 !message *** Doing loimpact
252 !if [nmakehlp -f $(OPTS) "thrdalloc"]
253 !message *** Doing thrdalloc
258 !if [nmakehlp -f $(OPTS) "unchecked"]
259 !message *** Doing unchecked
268 # Make sure we don't build overly fat DLLs.
270 # We shouldn't statically put the extensions inside the shell when dynamic.
271 TCL_USE_STATIC_PACKAGES = 0
275 #----------------------------------------------------------
276 # Figure-out how to name our intermediate and output directories.
277 # We wouldn't want different builds to use the same .obj files
279 #----------------------------------------------------------
281 #----------------------------------------
283 # t = full thread support.
284 # s = static library (as opposed to an
286 # g = linked to the debug enabled C
288 # x = special static build when it
289 # links to the dynamic C run-time.
290 #----------------------------------------
297 BUILDDIRTOP = Release
302 !if "$(MACHINE)" != "IX86"
303 BUILDDIRTOP =$(BUILDDIRTOP)_$(MACHINE)
306 BUILDDIRTOP =$(BUILDDIRTOP)_VC$(VCVER)
309 TMP_DIRFULL = .\$(BUILDDIRTOP)\$(PROJECT)_ThreadedDynamicStaticX
312 TMP_DIRFULL = $(TMP_DIRFULL:Static=)
316 TMP_DIRFULL = $(TMP_DIRFULL:X=)
320 TMP_DIRFULL = $(TMP_DIRFULL:Dynamic=)
323 TMP_DIRFULL = $(TMP_DIRFULL:X=)
329 TMP_DIRFULL = $(TMP_DIRFULL:Threaded=)
334 TMP_DIR = $(TMP_DIRFULL)
336 OUT_DIR = .\$(BUILDDIRTOP)
345 #----------------------------------------------------------
346 # Decode the statistics requested.
347 #----------------------------------------------------------
349 !if "$(STATS)" == "" || [nmakehlp -f "$(STATS)" "none"]
351 TCL_COMPILE_DEBUG = 0
353 !if [nmakehlp -f $(STATS) "memdbg"]
354 !message *** Doing memdbg
359 !if [nmakehlp -f $(STATS) "compdbg"]
360 !message *** Doing compdbg
361 TCL_COMPILE_DEBUG = 1
363 TCL_COMPILE_DEBUG = 0
367 #----------------------------------------------------------
368 # Decode the checks requested.
369 #----------------------------------------------------------
371 !if "$(CHECKS)" == "" || [nmakehlp -f "$(CHECKS)" "none"]
372 TCL_NO_DEPRECATED = 0
375 !if [nmakehlp -f $(CHECKS) "nodep"]
376 !message *** Doing nodep check
377 TCL_NO_DEPRECATED = 1
379 TCL_NO_DEPRECATED = 0
381 !if [nmakehlp -f $(CHECKS) "fullwarn"]
382 !message *** Doing full warnings check
390 #----------------------------------------------------------
391 # Set our defines now armed with our options.
392 #----------------------------------------------------------
396 OPTDEFINES = $(OPTDEFINES) -DTCL_MEM_DEBUG
398 !if $(TCL_COMPILE_DEBUG)
399 OPTDEFINES = $(OPTDEFINES) -DTCL_COMPILE_DEBUG -DTCL_COMPILE_STATS
402 OPTDEFINES = $(OPTDEFINES) -DTCL_THREADS=1
403 !if $(USE_THREAD_ALLOC)
404 OPTDEFINES = $(OPTDEFINES) -DUSE_THREAD_ALLOC=1
408 OPTDEFINES = $(OPTDEFINES) -DSTATIC_BUILD
412 OPTDEFINES = $(OPTDEFINES) -DTCL_CFG_DEBUG
413 !elseif $(OPTIMIZING)
414 OPTDEFINES = $(OPTDEFINES) -DTCL_CFG_OPTIMIZED
417 OPTDEFINES = $(OPTDEFINES) -DTCL_CFG_PROFILED
419 !if "$(MACHINE)" == "IA64" || "$(MACHINE)" == "AMD64"
420 OPTDEFINES = $(OPTDEFINES) -DTCL_CFG_DO64BIT
424 #----------------------------------------------------------
425 # Get common info used when building extensions.
426 #----------------------------------------------------------
428 !if "$(PROJECT)" != "tcl"
431 !if exist("$(_INSTALLDIR)\include\tcl.h")
432 TCLH = "$(_INSTALLDIR)\include\tcl.h"
434 _TCLDIR = $(_INSTALLDIR)
437 Failed to find tcl.h. Set the TCLDIR macro.
441 _TCLDIR = $(TCLDIR:/=\)
442 !if exist("$(_TCLDIR)\include\tcl.h")
443 TCLH = "$(_TCLDIR)\include\tcl.h"
445 !elseif exist("$(_TCLDIR)\generic\tcl.h")
446 TCLH = "$(_TCLDIR)\generic\tcl.h"
450 Failed to find tcl.h. The TCLDIR macro does not appear correct.
455 ### TODO: add a command to nmakehlp.c to grep for Tcl's version from tcl.h.
456 ### Because nmake can't return a string, we'll need to play games with return
457 ### codes. It might look something like this:
458 #!if [nmakehlp -g $(TCL.H)] == 81
459 #TCL_DOTVERSION = 8.1
460 #!elseif [nmakehlp -g $(TCL.H)] == 82
461 #TCL_DOTVERSION = 8.2
466 TCL_VERSION = $(TCL_DOTVERSION:.=)
469 TCLSH = "$(_INSTALLDIR)\bin\tclsh$(TCL_VERSION)$(SUFX).exe"
470 TCLSTUBLIB = "$(_INSTALLDIR)\lib\tclstub$(TCL_VERSION).lib"
471 TCLIMPLIB = "$(_INSTALLDIR)\lib\tcl$(TCL_VERSION)$(SUFX).lib"
472 TCL_LIBRARY = $(_INSTALLDIR)\lib
473 TCLREGLIB = "$(_INSTALLDIR)\lib\tclreg11$(SUFX:t=).lib"
474 TCLDDELIB = "$(_INSTALLDIR)\lib\tcldde12$(SUFX:t=).lib"
475 COFFBASE = \must\have\tcl\sources\to\build\this\target
476 TCLTOOLSDIR = \must\have\tcl\sources\to\build\this\target
478 TCLSH = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tclsh$(TCL_VERSION)$(SUFX).exe"
479 TCLSTUBLIB = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tclstub$(TCL_VERSION).lib"
480 TCLIMPLIB = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tcl$(TCL_VERSION)$(SUFX).lib"
481 TCL_LIBRARY = $(_TCLDIR)\library
482 TCLREGLIB = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tclreg11$(SUFX:t=).lib"
483 TCLDDELIB = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tcldde12$(SUFX:t=).lib"
484 COFFBASE = "$(_TCLDIR)\win\coffbase.txt"
485 TCLTOOLSDIR = $(_TCLDIR)\tools
491 #----------------------------------------------------------
492 # Display stats being used.
493 #----------------------------------------------------------
495 !message *** Intermediate directory will be '$(TMP_DIR)'
496 !message *** Output directory will be '$(OUT_DIR)'
497 !message *** Suffix for binaries will be '$(SUFX)'
498 !message *** Optional defines are '$(OPTDEFINES)'
499 !message *** Compiler version $(VCVER)
500 !message *** Compiler options '$(OPTIMIZATIONS) $(DEBUGFLAGS)'
501 !message *** Link options '$(LINKERFLAGS)'