711 lines · 18.3 KB · Text
RawDownload
#------------------------------------------------------------------------------# rules.vc --##	Microsoft Visual C++ makefile include for decoding the commandline#	macros.  This file does not need editing to build Tcl.## See the file "license.terms" for information on usage and redistribution# of this file, and for a DISCLAIMER OF ALL WARRANTIES.## Copyright (c) 2001-2003 David Gravereaux.# Copyright (c) 2003-2008 Patrick Thoyts#------------------------------------------------------------------------------ !ifndef _RULES_VC_RULES_VC = 1 cc32		= $(CC)   # built-in default.link32		= linklib32		= librc32		= $(RC)   # built-in default. !ifndef INSTALLDIR### Assume the normal default._INSTALLDIR	= C:\Program Files\Tcl!else### Fix the path separators._INSTALLDIR	= $(INSTALLDIR:/=\)!endif #----------------------------------------------------------# Set the proper copy method to avoid overwrite questions# to the user when copying files and selecting the right# "delete all" method.#---------------------------------------------------------- !if "$(OS)" == "Windows_NT"RMDIR	= rmdir /S /QERRNULL  = 2>NUL!if ![ver | find "4.0" > nul]CPY	= echo y | xcopy /i >NULCOPY	= copy >NUL!elseCPY	= xcopy /i /y >NULCOPY	= copy /y >NUL!endif!else # "$(OS)" != "Windows_NT"CPY	= xcopy /i >_JUNK.OUT # On Win98 NUL does not work here.COPY	= copy >_JUNK.OUT # On Win98 NUL does not work here.RMDIR	= deltree /YNULL    = \NUL # Used in testing directory existenceERRNULL = >NUL # Win9x shell cannot redirect stderr!endifMKDIR   = mkdir #------------------------------------------------------------------------------# Determine the host and target architectures and compiler version.#------------------------------------------------------------------------------ _HASH=^#_VC_MANIFEST_EMBED_EXE=_VC_MANIFEST_EMBED_DLL=VCVER=0!if ![echo VCVERSION=_MSC_VER > vercl.x] \    && ![echo $(_HASH)if defined(_M_IX86) >> vercl.x] \    && ![echo ARCH=IX86 >> vercl.x] \    && ![echo $(_HASH)elif defined(_M_AMD64) >> vercl.x] \    && ![echo ARCH=AMD64 >> vercl.x] \    && ![echo $(_HASH)endif >> vercl.x] \    && ![cl -nologo -TC -P vercl.x $(ERRNULL)]!include vercl.i!if ![echo VCVER= ^\> vercl.vc] \    && ![set /a $(VCVERSION) / 100 - 6 >> vercl.vc]!include vercl.vc!endif!endif!if ![del $(ERRNUL) /q/f vercl.x vercl.i vercl.vc]!endif !if ![reg query HKLM\Hardware\Description\System\CentralProcessor\0 /v Identifier | findstr /i x86]NATIVE_ARCH=IX86!elseNATIVE_ARCH=AMD64!endif # Since MSVC8 we must deal with manifest resources.!if $(VCVERSION) >= 1400_VC_MANIFEST_EMBED_EXE=if exist $@.manifest mt -nologo -manifest $@.manifest -outputresource:$@;1_VC_MANIFEST_EMBED_DLL=if exist $@.manifest mt -nologo -manifest $@.manifest -outputresource:$@;2!endif !ifndef MACHINEMACHINE=$(ARCH)!endif !ifndef CFG_ENCODINGCFG_ENCODING	= \"cp1252\"!endif !message =============================================================================== #----------------------------------------------------------# build the helper app we need to overcome nmake's limiting# environment.#---------------------------------------------------------- !if !exist(nmakehlp.exe)!if [$(cc32) -nologo nmakehlp.c -link -subsystem:console > nul]!endif!endif #----------------------------------------------------------# Test for compiler features#---------------------------------------------------------- ### test for optimizations!if [nmakehlp -c -Ot]!message *** Compiler has 'Optimizations'OPTIMIZING	= 1!else!message *** Compiler does not have 'Optimizations'OPTIMIZING	= 0!endif OPTIMIZATIONS   = !if [nmakehlp -c -Ot]OPTIMIZATIONS  = $(OPTIMIZATIONS) -Ot!endif !if [nmakehlp -c -Oi]OPTIMIZATIONS  = $(OPTIMIZATIONS) -Oi!endif !if [nmakehlp -c -Op]OPTIMIZATIONS  = $(OPTIMIZATIONS) -Op!endif !if [nmakehlp -c -fp:strict]OPTIMIZATIONS  = $(OPTIMIZATIONS) -fp:strict!endif !if [nmakehlp -c -Gs]OPTIMIZATIONS  = $(OPTIMIZATIONS) -Gs!endif !if [nmakehlp -c -GS]OPTIMIZATIONS  = $(OPTIMIZATIONS) -GS!endif !if [nmakehlp -c -GL]OPTIMIZATIONS  = $(OPTIMIZATIONS) -GL!endif DEBUGFLAGS     = !if [nmakehlp -c -RTC1]DEBUGFLAGS     = $(DEBUGFLAGS) -RTC1!elseif [nmakehlp -c -GZ]DEBUGFLAGS     = $(DEBUGFLAGS) -GZ!endif COMPILERFLAGS  =-W3 -DUNICODE -D_UNICODE # In v13 -GL and -YX are incompatible.!if [nmakehlp -c -YX]!if ![nmakehlp -c -GL]OPTIMIZATIONS  = $(OPTIMIZATIONS) -YX!endif!endif !if "$(MACHINE)" == "IX86"### test for pentium errata!if [nmakehlp -c -QI0f]!message *** Compiler has 'Pentium 0x0f fix'COMPILERFLAGS  = $(COMPILERFLAGS) -QI0f!else!message *** Compiler does not have 'Pentium 0x0f fix'!endif!endif !if "$(MACHINE)" == "IA64"### test for Itanium errata!if [nmakehlp -c -QIA64_Bx]!message *** Compiler has 'B-stepping errata workarounds'COMPILERFLAGS   = $(COMPILERFLAGS) -QIA64_Bx!else!message *** Compiler does not have 'B-stepping errata workarounds'!endif!endif !if "$(MACHINE)" == "IX86"### test for -align:4096, when align:512 will do.!if [nmakehlp -l -opt:nowin98]!message *** Linker has 'Win98 alignment problem'ALIGN98_HACK	= 1!else!message *** Linker does not have 'Win98 alignment problem'ALIGN98_HACK	= 0!endif!elseALIGN98_HACK	= 0!endif LINKERFLAGS     = !if [nmakehlp -l -ltcg]LINKERFLAGS     =-ltcg!endif #----------------------------------------------------------# Decode the options requested.#---------------------------------------------------------- !if "$(OPTS)" == "" || [nmakehlp -f "$(OPTS)" "none"]STATIC_BUILD	= 0TCL_THREADS	= 1DEBUG		= 0SYMBOLS		= 0PROFILE		= 0PGO		= 0MSVCRT		= 0LOIMPACT	= 0TCL_USE_STATIC_PACKAGES	= 0USE_THREAD_ALLOC = 1UNCHECKED	= 0!else!if [nmakehlp -f $(OPTS) "static"]!message *** Doing staticSTATIC_BUILD	= 1!elseSTATIC_BUILD	= 0!endif!if [nmakehlp -f $(OPTS) "msvcrt"]!message *** Doing msvcrtMSVCRT		= 1!elseMSVCRT		= 0!endif!if [nmakehlp -f $(OPTS) "staticpkg"]!message *** Doing staticpkgTCL_USE_STATIC_PACKAGES	= 1!elseTCL_USE_STATIC_PACKAGES	= 0!endif!if [nmakehlp -f $(OPTS) "nothreads"]!message *** Compile explicitly for non-threaded tclTCL_THREADS	= 0!elseTCL_THREADS	= 1USE_THREAD_ALLOC= 1!endif!if [nmakehlp -f $(OPTS) "symbols"]!message *** Doing symbolsDEBUG		= 1!elseDEBUG		= 0!endif!if [nmakehlp -f $(OPTS) "pdbs"]!message *** Doing pdbsSYMBOLS		= 1!elseSYMBOLS		= 0!endif!if [nmakehlp -f $(OPTS) "profile"]!message *** Doing profilePROFILE		= 1!elsePROFILE		= 0!endif!if [nmakehlp -f $(OPTS) "pgi"]!message *** Doing profile guided optimization instrumentationPGO		= 1!elseif [nmakehlp -f $(OPTS) "pgo"]!message *** Doing profile guided optimizationPGO		= 2!elsePGO		= 0!endif!if [nmakehlp -f $(OPTS) "loimpact"]!message *** Doing loimpactLOIMPACT	= 1!elseLOIMPACT	= 0!endif!if [nmakehlp -f $(OPTS) "thrdalloc"]!message *** Doing thrdallocUSE_THREAD_ALLOC = 1!endif!if [nmakehlp -f $(OPTS) "tclalloc"]!message *** Doing tclallocUSE_THREAD_ALLOC = 0!endif!if [nmakehlp -f $(OPTS) "unchecked"]!message *** Doing uncheckedUNCHECKED = 1!elseUNCHECKED = 0!endif!endif  !if !$(STATIC_BUILD)# Make sure we don't build overly fat DLLs.MSVCRT		= 1# We shouldn't statically put the extensions inside the shell when dynamic.TCL_USE_STATIC_PACKAGES = 0!endif  #----------------------------------------------------------# Figure-out how to name our intermediate and output directories.# We wouldn't want different builds to use the same .obj files# by accident.#---------------------------------------------------------- #----------------------------------------# Naming convention:#   t = full thread support.#   s = static library (as opposed to an#	import library)#   g = linked to the debug enabled C#	run-time.#   x = special static build when it#	links to the dynamic C run-time.#----------------------------------------SUFX	    = tsgx !if $(DEBUG)BUILDDIRTOP = Debug!elseBUILDDIRTOP = Release!endif !if "$(MACHINE)" != "IX86"BUILDDIRTOP =$(BUILDDIRTOP)_$(MACHINE)!endif!if $(VCVER) > 6BUILDDIRTOP =$(BUILDDIRTOP)_VC$(VCVER)!endif !if !$(DEBUG) || $(DEBUG) && $(UNCHECKED)SUFX	    = $(SUFX:g=)!endif TMP_DIRFULL = .\$(BUILDDIRTOP)\$(PROJECT)_ThreadedDynamicStaticX !if !$(STATIC_BUILD)TMP_DIRFULL = $(TMP_DIRFULL:Static=)SUFX	    = $(SUFX:s=)EXT	    = dll!if $(MSVCRT)TMP_DIRFULL = $(TMP_DIRFULL:X=)SUFX	    = $(SUFX:x=)!endif!elseTMP_DIRFULL = $(TMP_DIRFULL:Dynamic=)EXT	    = lib!if !$(MSVCRT)TMP_DIRFULL = $(TMP_DIRFULL:X=)SUFX	    = $(SUFX:x=)!endif!endif !if !$(TCL_THREADS)TMP_DIRFULL = $(TMP_DIRFULL:Threaded=)SUFX	    = $(SUFX:t=)!endif !ifndef TMP_DIRTMP_DIR	    = $(TMP_DIRFULL)!ifndef OUT_DIROUT_DIR	    = .\$(BUILDDIRTOP)!endif!else!ifndef OUT_DIROUT_DIR	    = $(TMP_DIR)!endif!endif  #----------------------------------------------------------# Decode the statistics requested.#---------------------------------------------------------- !if "$(STATS)" == "" || [nmakehlp -f "$(STATS)" "none"]TCL_MEM_DEBUG	    = 0TCL_COMPILE_DEBUG   = 0!else!if [nmakehlp -f $(STATS) "memdbg"]!message *** Doing memdbgTCL_MEM_DEBUG	    = 1!elseTCL_MEM_DEBUG	    = 0!endif!if [nmakehlp -f $(STATS) "compdbg"]!message *** Doing compdbgTCL_COMPILE_DEBUG   = 1!elseTCL_COMPILE_DEBUG   = 0!endif!endif  #----------------------------------------------------------# Decode the checks requested.#---------------------------------------------------------- !if "$(CHECKS)" == "" || [nmakehlp -f "$(CHECKS)" "none"]TCL_NO_DEPRECATED	    = 0WARNINGS		    = -W3!else!if [nmakehlp -f $(CHECKS) "nodep"]!message *** Doing nodep checkTCL_NO_DEPRECATED	    = 1!elseTCL_NO_DEPRECATED	    = 0!endif!if [nmakehlp -f $(CHECKS) "fullwarn"]!message *** Doing full warnings checkWARNINGS		    = -W4!if [nmakehlp -l -warn:3]LINKERFLAGS		    = $(LINKERFLAGS) -warn:3!endif!elseWARNINGS		    = -W3!endif!if [nmakehlp -f $(CHECKS) "64bit"] && [nmakehlp -c -Wp64]!message *** Doing 64bit portability warningsWARNINGS		    = $(WARNINGS) -Wp64!endif!endif !if $(PGO) > 1!if [nmakehlp -l -ltcg:pgoptimize]LINKERFLAGS	= $(LINKERFLAGS:-ltcg=) -ltcg:pgoptimize!elseMSG=^This compiler does not support profile guided optimization.!error $(MSG)!endif!elseif $(PGO) > 0!if [nmakehlp -l -ltcg:pginstrument]LINKERFLAGS	= $(LINKERFLAGS:-ltcg=) -ltcg:pginstrument!elseMSG=^This compiler does not support profile guided optimization.!error $(MSG)!endif!endif #----------------------------------------------------------# Set our defines now armed with our options.#---------------------------------------------------------- OPTDEFINES	= -DTCL_CFGVAL_ENCODING=$(CFG_ENCODING) -DSTDC_HEADERS !if $(TCL_MEM_DEBUG)OPTDEFINES	= $(OPTDEFINES) -DTCL_MEM_DEBUG!endif!if $(TCL_COMPILE_DEBUG)OPTDEFINES	= $(OPTDEFINES) -DTCL_COMPILE_DEBUG -DTCL_COMPILE_STATS!endif!if $(TCL_THREADS)OPTDEFINES	= $(OPTDEFINES) -DTCL_THREADS=1!if $(USE_THREAD_ALLOC)OPTDEFINES	= $(OPTDEFINES) -DUSE_THREAD_ALLOC=1!endif!endif!if $(STATIC_BUILD)OPTDEFINES	= $(OPTDEFINES) -DSTATIC_BUILD!endif!if $(TCL_NO_DEPRECATED)OPTDEFINES	= $(OPTDEFINES) -DTCL_NO_DEPRECATED!endif !if !$(DEBUG)OPTDEFINES	= $(OPTDEFINES) -DNDEBUG!if $(OPTIMIZING)OPTDEFINES	= $(OPTDEFINES) -DTCL_CFG_OPTIMIZED!endif!endif!if $(PROFILE)OPTDEFINES	= $(OPTDEFINES) -DTCL_CFG_PROFILED!endif!if "$(MACHINE)" == "IA64" || "$(MACHINE)" == "AMD64"OPTDEFINES	= $(OPTDEFINES) -DTCL_CFG_DO64BIT!endif!if $(VCVERSION) < 1300OPTDEFINES	= $(OPTDEFINES) -DNO_STRTOI64!endif #----------------------------------------------------------# Locate the Tcl headers to build against#---------------------------------------------------------- !if "$(PROJECT)" == "tcl" _TCL_H          = ..\generic\tcl.h !else

Lines 1–500 of 711.