head	1.29;
access;
symbols
	core-8-5-9:1.21.2.1
	core-8-5-8:1.21.2.1
	macosx-cocoa-merge:1.24
	macosx-cocoa-premerge:1.24
	macosx-carbon-freeze:1.24
	core-8-5-7:1.21
	core-8-5-6:1.21
	core-8-6-b1:1.23
	core-8-6-a3:1.23
	core-8-5-5:1.21
	core-8-6-a2:1.23
	core-8-5-4:1.21
	core-8-5-3:1.21
	core-8-6-a1:1.23
	core-8-4-19:1.5.2.9
	core-8-5-branch:1.21.0.2
	core-8-5-2:1.21
	core-8-4-18:1.5.2.9
	core-8-5-1:1.21
	core-8-4-17:1.5.2.9
	core-8-5-0:1.21
	core-8-5-b3:1.19
	core-8-5-b2:1.18
	core-8-4-16:1.5.2.9
	core-8-5-b1:1.16
	core-stablilizer-merge:1.15
	core-stabilizer-branch:1.15.0.2
	core-stabilizer-merge:1.21
	core-8-4-15:1.5.2.8
	core-8-5-a6:1.15
	core-8-5-a5:1.13
	core-8-4-14:1.5.2.7
	core-8-5-a4:1.11
	core-8-4-13:1.5.2.2
	core-8-4-12:1.5.2.2
	core-8-4-11:1.5.2.2
	core-8-5-a3:1.11
	core-8-4-10:1.5.2.2
	core-8-4-9-branch:1.5.2.2.0.2
	core-8-5-a2:1.11
	core-8-4-9:1.5.2.2
	core-8-4-8:1.5.2.2
	core-8-4-7:1.5.2.1
	core-8-5-a1:1.11
	core-8-4-6:1.5.2.1
	core-8-4-5:1.5.2.1
	mistachkin-dev-branch:1.7.0.2
	core-8-4-4:1.5.2.1
	core-8-4-3:1.5.2.1
	core-8-4-branch:1.5.0.2
	core-8-4-2:1.5
	core-8-4-1:1.3
	core-8-4-0:1.3
	macosx-8-4-merge-2002-08-31-trunk:1.3
	macosx-8-4-premerge-2002-08-31-branch:1.1.2.3
	macosx-8-4-premerge-2002-08-31-trunk:1.3
	macosx-8-4-merge-2002-08-30-branch:1.1.2.3
	macosx-8-4-merge-2002-08-30-trunk:1.3
	macosx-8-4-merge-2002-08-20-branch:1.1.2.3
	macosx-8-4-merge-2002-08-20-trunk:1.3
	core-8-4-b2:1.3
	core-8-4-b1:1.3
	macosx-premerge-6-9-02:1.1.2.1
	core-8-4-win-speedup:1.2.0.2
	core-8-4-a4:1.1
	macosx-8-4-branch:1.1.0.2;
locks; strict;
comment	@# @;


1.29
date	2010.10.11.21.50.46;	author nijtmans;	state Exp;
branches;
next	1.28;

1.28
date	2010.09.14.08.50.20;	author nijtmans;	state Exp;
branches;
next	1.27;

1.27
date	2010.09.09.14.59.24;	author nijtmans;	state Exp;
branches;
next	1.26;

1.26
date	2010.07.01.21.31.26;	author nijtmans;	state Exp;
branches;
next	1.25;

1.25
date	2010.03.12.15.23.39;	author nijtmans;	state Exp;
branches;
next	1.24;

1.24
date	2008.12.31.23.11.48;	author davygrvy;	state Exp;
branches;
next	1.23;

1.23
date	2008.06.13.05.46.09;	author mistachkin;	state Exp;
branches;
next	1.22;

1.22
date	2008.05.15.00.06.19;	author patthoyts;	state Exp;
branches;
next	1.21;

1.21
date	2007.12.13.15.28.52;	author dgp;	state Exp;
branches
	1.21.2.1;
next	1.20;

1.20
date	2007.12.10.11.57.38;	author patthoyts;	state Exp;
branches;
next	1.19;

1.19
date	2007.10.31.00.05.53;	author patthoyts;	state Exp;
branches;
next	1.18;

1.18
date	2007.10.12.18.56.33;	author patthoyts;	state Exp;
branches;
next	1.17;

1.17
date	2007.10.12.14.14.54;	author patthoyts;	state Exp;
branches;
next	1.16;

1.16
date	2007.08.21.20.35.11;	author patthoyts;	state Exp;
branches;
next	1.15;

1.15
date	2007.02.04.00.10.54;	author mistachkin;	state Exp;
branches
	1.15.2.1;
next	1.14;

1.14
date	2006.10.31.14.45.04;	author patthoyts;	state Exp;
branches;
next	1.13;

1.13
date	2006.10.19.00.48.26;	author patthoyts;	state Exp;
branches;
next	1.12;

1.12
date	2006.09.22.19.02.08;	author andreas_kupries;	state Exp;
branches;
next	1.11;

1.11
date	2004.02.08.01.38.03;	author davygrvy;	state Exp;
branches;
next	1.10;

1.10
date	2004.02.01.10.40.07;	author davygrvy;	state Exp;
branches;
next	1.9;

1.9
date	2004.01.13.02.02.57;	author davygrvy;	state Exp;
branches;
next	1.8;

1.8
date	2003.12.23.02.48.29;	author davygrvy;	state Exp;
branches;
next	1.7;

1.7
date	2003.03.23.02.17.44;	author kennykb;	state Exp;
branches;
next	1.6;

1.6
date	2003.03.06.03.08.40;	author davygrvy;	state Exp;
branches;
next	1.5;

1.5
date	2003.02.14.20.28.21;	author davygrvy;	state Exp;
branches
	1.5.2.1;
next	1.4;

1.4
date	2002.11.04.07.49.43;	author davygrvy;	state Exp;
branches;
next	1.3;

1.3
date	2002.06.14.14.43.18;	author davygrvy;	state Exp;
branches;
next	1.2;

1.2
date	2002.03.28.23.23.03;	author davygrvy;	state Exp;
branches
	1.2.2.1;
next	1.1;

1.1
date	2001.11.13.02.46.23;	author davygrvy;	state Exp;
branches
	1.1.2.1;
next	;

1.1.2.1
date	2002.02.05.02.25.18;	author wolfsuit;	state Exp;
branches;
next	1.1.2.2;

1.1.2.2
date	2002.06.10.05.38.27;	author wolfsuit;	state Exp;
branches;
next	1.1.2.3;

1.1.2.3
date	2002.08.20.20.27.19;	author das;	state Exp;
branches;
next	;

1.2.2.1
date	2002.04.02.21.17.03;	author hobbs;	state Exp;
branches;
next	;

1.5.2.1
date	2003.03.23.02.25.22;	author kennykb;	state Exp;
branches;
next	1.5.2.2;

1.5.2.2
date	2004.10.27.00.36.34;	author davygrvy;	state Exp;
branches;
next	1.5.2.3;

1.5.2.3
date	2006.06.14.23.52.01;	author patthoyts;	state Exp;
branches;
next	1.5.2.4;

1.5.2.4
date	2006.09.22.19.01.52;	author andreas_kupries;	state Exp;
branches;
next	1.5.2.5;

1.5.2.5
date	2006.09.26.23.55.50;	author patthoyts;	state Exp;
branches;
next	1.5.2.6;

1.5.2.6
date	2006.10.06.18.10.41;	author patthoyts;	state Exp;
branches;
next	1.5.2.7;

1.5.2.7
date	2006.10.18.08.56.21;	author patthoyts;	state Exp;
branches;
next	1.5.2.8;

1.5.2.8
date	2006.10.31.15.18.28;	author patthoyts;	state Exp;
branches;
next	1.5.2.9;

1.5.2.9
date	2007.09.11.00.13.12;	author patthoyts;	state Exp;
branches;
next	1.5.2.10;

1.5.2.10
date	2010.10.23.21.43.05;	author nijtmans;	state Exp;
branches;
next	1.5.2.11;

1.5.2.11
date	2010.10.31.21.25.55;	author nijtmans;	state Exp;
branches;
next	;

1.15.2.1
date	2007.09.04.17.44.26;	author dgp;	state Exp;
branches;
next	1.15.2.2;

1.15.2.2
date	2007.10.15.18.38.41;	author dgp;	state Exp;
branches;
next	1.15.2.3;

1.15.2.3
date	2007.11.01.16.37.25;	author dgp;	state Exp;
branches;
next	1.15.2.4;

1.15.2.4
date	2007.12.10.18.39.32;	author dgp;	state Exp;
branches;
next	;

1.21.2.1
date	2009.10.15.21.07.49;	author patthoyts;	state Exp;
branches;
next	1.21.2.2;

1.21.2.2
date	2010.10.23.21.29.54;	author nijtmans;	state Exp;
branches;
next	;


desc
@@


1.29
log
@[FRQ 491789]: "setargv() doesn't support a unicode
cmdline" implemented for Tk on MSVC++
@
text
@#------------------------------------------------------------------------------
# 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-2007 Patrick Thoyts
#
#------------------------------------------------------------------------------
# RCS: @@(#) $Id: rules.vc,v 1.28 2010/09/14 08:50:20 nijtmans Exp $
#------------------------------------------------------------------------------

!ifndef _RULES_VC
_RULES_VC = 1

cc32		= $(CC)   # built-in default.
link32		= link
lib32		= lib
rc32		= $(RC)   # built-in default.

!ifndef INSTALLDIR
### Assume the normal default.
_INSTALLDIR	= C:\Program Files\Tcl
!else
### Fix the path separators.
_INSTALLDIR	= $(INSTALLDIR:/=\)
!endif

!ifndef MACHINE
!if "$(CPU)" == "" || "$(CPU)" == "i386"
MACHINE		= IX86
!else
MACHINE         = $(CPU)
!endif
!endif

!ifndef CFG_ENCODING
CFG_ENCODING	= \"cp1252\"
!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 /Q
ERRNULL  = 2>NUL
!if ![ver | find "4.0" > nul]
CPY	= echo y | xcopy /i >NUL
COPY	= copy >NUL
!else
CPY	= xcopy /i /y >NUL
COPY	= 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 /Y
NULL    = \NUL # Used in testing directory existence
ERRNULL = >NUL # Win9x shell cannot redirect stderr
!endif
MKDIR   = mkdir

!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
!else
ALIGN98_HACK	= 0
!endif

LINKERFLAGS     =

!if [nmakehlp -l -ltcg]
LINKERFLAGS     =-ltcg
!endif

#----------------------------------------------------------
# MSVC8 (ships with Visual Studio 2005) generates a manifest
# file that we should link into the binaries. This is how.
#----------------------------------------------------------

_VC_MANIFEST_EMBED_EXE=
_VC_MANIFEST_EMBED_DLL=
VCVER=0
!if ![echo VCVERSION=_MSC_VER > vercl.x] \
    && ![cl -nologo -TC -P vercl.x $(ERRNULL)]
!include vercl.i
!if $(VCVERSION) >= 1600
VCVER=10
!elseif $(VCVERSION) >= 1500
VCVER=9
!elseif $(VCVERSION) >= 1400
VCVER=8
!elseif $(VCVERSION) >= 1300
VCVER=7
!elseif $(VCVERSION) >= 1200
VCVER=6
!endif
!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

#----------------------------------------------------------
# Decode the options requested.
#----------------------------------------------------------

!if "$(OPTS)" == "" || [nmakehlp -f "$(OPTS)" "none"]
STATIC_BUILD	= 0
TCL_THREADS	= 1
DEBUG		= 0
SYMBOLS		= 0
PROFILE		= 0
PGO		= 0
MSVCRT		= 0
LOIMPACT	= 0
TCL_USE_STATIC_PACKAGES	= 0
USE_THREAD_ALLOC = 1
UNCHECKED	= 0
!else
!if [nmakehlp -f $(OPTS) "static"]
!message *** Doing static
STATIC_BUILD	= 1
!else
STATIC_BUILD	= 0
!endif
!if [nmakehlp -f $(OPTS) "msvcrt"]
!message *** Doing msvcrt
MSVCRT		= 1
!else
MSVCRT		= 0
!endif
!if [nmakehlp -f $(OPTS) "staticpkg"]
!message *** Doing staticpkg
TCL_USE_STATIC_PACKAGES	= 1
!else
TCL_USE_STATIC_PACKAGES	= 0
!endif
!if [nmakehlp -f $(OPTS) "nothreads"]
TCL_THREADS	= 0
!else
!message *** Doing threads
TCL_THREADS	= 1
USE_THREAD_ALLOC= 1
!endif
!if [nmakehlp -f $(OPTS) "symbols"]
!message *** Doing symbols
DEBUG		= 1
!else
DEBUG		= 0
!endif
!if [nmakehlp -f $(OPTS) "pdbs"]
!message *** Doing pdbs
SYMBOLS		= 1
!else
SYMBOLS		= 0
!endif
!if [nmakehlp -f $(OPTS) "profile"]
!message *** Doing profile
PROFILE		= 1
!else
PROFILE		= 0
!endif
!if [nmakehlp -f $(OPTS) "pgi"]
!message *** Doing profile guided optimization instrumentation
PGO		= 1
!elseif [nmakehlp -f $(OPTS) "pgo"]
!message *** Doing profile guided optimization
PGO		= 2
!else
PGO		= 0
!endif
!if [nmakehlp -f $(OPTS) "loimpact"]
!message *** Doing loimpact
LOIMPACT	= 1
!else
LOIMPACT	= 0
!endif
!if [nmakehlp -f $(OPTS) "thrdalloc"]
!message *** Doing thrdalloc
USE_THREAD_ALLOC = 1
!endif
!if [nmakehlp -f $(OPTS) "tclalloc"]
!message *** Doing thrdalloc
USE_THREAD_ALLOC = 0
!endif
!if [nmakehlp -f $(OPTS) "unchecked"]
!message *** Doing unchecked
UNCHECKED = 1
!else
UNCHECKED = 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
!else
BUILDDIRTOP = Release
!endif

!if "$(MACHINE)" != "IX86"
BUILDDIRTOP =$(BUILDDIRTOP)_$(MACHINE)
!endif
!if $(VCVER) > 6
BUILDDIRTOP =$(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
!else
TMP_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_DIR
TMP_DIR	    = $(TMP_DIRFULL)
!ifndef OUT_DIR
OUT_DIR	    = .\$(BUILDDIRTOP)
!endif
!else
!ifndef OUT_DIR
OUT_DIR	    = $(TMP_DIR)
!endif
!endif


#----------------------------------------------------------
# Decode the statistics requested.
#----------------------------------------------------------

!if "$(STATS)" == "" || [nmakehlp -f "$(STATS)" "none"]
TCL_MEM_DEBUG	    = 0
TCL_COMPILE_DEBUG   = 0
!else
!if [nmakehlp -f $(STATS) "memdbg"]
!message *** Doing memdbg
TCL_MEM_DEBUG	    = 1
!else
TCL_MEM_DEBUG	    = 0
!endif
!if [nmakehlp -f $(STATS) "compdbg"]
!message *** Doing compdbg
TCL_COMPILE_DEBUG   = 1
!else
TCL_COMPILE_DEBUG   = 0
!endif
!endif


#----------------------------------------------------------
# Decode the checks requested.
#----------------------------------------------------------

!if "$(CHECKS)" == "" || [nmakehlp -f "$(CHECKS)" "none"]
TCL_NO_DEPRECATED	    = 0
WARNINGS		    = -W3
!else
!if [nmakehlp -f $(CHECKS) "nodep"]
!message *** Doing nodep check
TCL_NO_DEPRECATED	    = 1
!else
TCL_NO_DEPRECATED	    = 0
!endif
!if [nmakehlp -f $(CHECKS) "fullwarn"]
!message *** Doing full warnings check
WARNINGS		    = -W4
!if [nmakehlp -l -warn:3]
LINKERFLAGS		    = $(LINKERFLAGS) -warn:3
!endif
!else
WARNINGS		    = -W3
!endif
!if [nmakehlp -f $(CHECKS) "64bit"] && [nmakehlp -c -Wp64]
!message *** Doing 64bit portability warnings
WARNINGS		    = $(WARNINGS) -Wp64
!endif
!endif

!if $(PGO) > 1
!if [nmakehlp -l -ltcg:pgoptimize]
LINKERFLAGS	= $(LINKERFLAGS:-ltcg=) -ltcg:pgoptimize
!else
MSG=^
This compiler does not support profile guided optimization.
!error $(MSG)
!endif
!elseif $(PGO) > 0
!if [nmakehlp -l -ltcg:pginstrument]
LINKERFLAGS	= $(LINKERFLAGS:-ltcg=) -ltcg:pginstrument
!else
MSG=^
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) -DTCL_CFG_DEBUG
!elseif $(OPTIMIZING)
OPTDEFINES	= $(OPTDEFINES) -DTCL_CFG_OPTIMIZED
!endif
!if $(PROFILE)
OPTDEFINES	= $(OPTDEFINES) -DTCL_CFG_PROFILED
!endif
!if "$(MACHINE)" == "IA64" || "$(MACHINE)" == "AMD64"
OPTDEFINES	= $(OPTDEFINES) -DTCL_CFG_DO64BIT
!endif


#----------------------------------------------------------
# Locate the Tcl headers to build against
#----------------------------------------------------------

!if "$(PROJECT)" == "tcl"

_TCL_H          = ..\generic\tcl.h

!else

# If INSTALLDIR set to tcl root dir then reset to the lib dir.
!if exist("$(_INSTALLDIR)\include\tcl.h")
_INSTALLDIR=$(_INSTALLDIR)\lib
!endif

!if !defined(TCLDIR)
!if exist("$(_INSTALLDIR)\..\include\tcl.h")
TCLINSTALL	= 1
_TCLDIR		= $(_INSTALLDIR)\..
_TCL_H          = $(_INSTALLDIR)\..\include\tcl.h
TCLDIR          = $(_INSTALLDIR)\..
!else
MSG=^
Failed to find tcl.h.  Set the TCLDIR macro.
!error $(MSG)
!endif
!else
_TCLDIR	= $(TCLDIR:/=\)
!if exist("$(_TCLDIR)\include\tcl.h")
TCLINSTALL	= 1
_TCL_H          = $(_TCLDIR)\include\tcl.h
!elseif exist("$(_TCLDIR)\generic\tcl.h")
TCLINSTALL	= 0
_TCL_H          = $(_TCLDIR)\generic\tcl.h
!else
MSG =^
Failed to find tcl.h.  The TCLDIR macro does not appear correct.
!error $(MSG)
!endif
!endif
!endif

#--------------------------------------------------------------
# Extract various version numbers from tcl headers
# The generated file is then included in the makefile.
#--------------------------------------------------------------

!if [echo REM = This file is generated from rules.vc > versions.vc]
!endif
!if [echo TCL_MAJOR_VERSION = \>> versions.vc] \
   && [nmakehlp -V "$(_TCL_H)" TCL_MAJOR_VERSION >> versions.vc]
!endif
!if [echo TCL_MINOR_VERSION = \>> versions.vc] \
   && [nmakehlp -V "$(_TCL_H)" TCL_MINOR_VERSION >> versions.vc]
!endif
!if [echo TCL_PATCH_LEVEL = \>> versions.vc] \
   && [nmakehlp -V "$(_TCL_H)" TCL_PATCH_LEVEL >> versions.vc]
!endif

# If building the tcl core then we need additional package versions
!if "$(PROJECT)" == "tcl"
!if [echo PKG_HTTP_VER = \>> versions.vc] \
   && [nmakehlp -V ..\library\http\pkgIndex.tcl http >> versions.vc]
!endif
!if [echo PKG_TCLTEST_VER = \>> versions.vc] \
   && [nmakehlp -V ..\library\tcltest\pkgIndex.tcl tcltest >> versions.vc]
!endif
!if [echo PKG_MSGCAT_VER = \>> versions.vc] \
   && [nmakehlp -V ..\library\msgcat\pkgIndex.tcl msgcat >> versions.vc]
!endif
!if [echo PKG_PLATFORM_VER = \>> versions.vc] \
   && [nmakehlp -V ..\library\platform\pkgIndex.tcl "platform " >> versions.vc]
!endif
!if [echo PKG_SHELL_VER = \>> versions.vc] \
   && [nmakehlp -V ..\library\platform\pkgIndex.tcl "platform::shell" >> versions.vc]
!endif
!endif

!include versions.vc

#--------------------------------------------------------------
# Setup tcl version dependent stuff headers
#--------------------------------------------------------------

!if "$(PROJECT)" != "tcl"

TCL_VERSION	= $(TCL_MAJOR_VERSION)$(TCL_MINOR_VERSION)

!if $(TCL_VERSION) < 81
TCL_DOES_STUBS	= 0
!else
TCL_DOES_STUBS	= 1
!endif

!if $(TCLINSTALL)
TCLSH		= "$(_TCLDIR)\bin\tclsh$(TCL_VERSION)$(SUFX).exe"
!if !exist($(TCLSH)) && $(TCL_THREADS)
TCLSH           = "$(_TCLDIR)\bin\tclsh$(TCL_VERSION)t$(SUFX).exe"
!endif
TCLSTUBLIB	= "$(_TCLDIR)\lib\tclstub$(TCL_VERSION).lib"
TCLIMPLIB	= "$(_TCLDIR)\lib\tcl$(TCL_VERSION)$(SUFX).lib"
TCL_LIBRARY	= $(_TCLDIR)\lib
TCLREGLIB	= "$(_TCLDIR)\lib\tclreg13$(SUFX:t=).lib"
TCLDDELIB	= "$(_TCLDIR)\lib\tcldde13$(SUFX:t=).lib"
COFFBASE	= \must\have\tcl\sources\to\build\this\target
TCLTOOLSDIR	= \must\have\tcl\sources\to\build\this\target
TCL_INCLUDES    = -I"$(_TCLDIR)\include"
!else
TCLSH		= "$(_TCLDIR)\win\$(BUILDDIRTOP)\tclsh$(TCL_VERSION)$(SUFX).exe"
!if !exist($(TCLSH)) && $(TCL_THREADS)
TCLSH		= "$(_TCLDIR)\win\$(BUILDDIRTOP)\tclsh$(TCL_VERSION)t$(SUFX).exe"
!endif
TCLSTUBLIB	= "$(_TCLDIR)\win\$(BUILDDIRTOP)\tclstub$(TCL_VERSION).lib"
TCLIMPLIB	= "$(_TCLDIR)\win\$(BUILDDIRTOP)\tcl$(TCL_VERSION)$(SUFX).lib"
TCL_LIBRARY	= $(_TCLDIR)\library
TCLREGLIB	= "$(_TCLDIR)\win\$(BUILDDIRTOP)\tclreg13$(SUFX:t=).lib"
TCLDDELIB	= "$(_TCLDIR)\win\$(BUILDDIRTOP)\tcldde13$(SUFX:t=).lib"
COFFBASE	= "$(_TCLDIR)\win\coffbase.txt"
TCLTOOLSDIR	= $(_TCLDIR)\tools
TCL_INCLUDES	= -I"$(_TCLDIR)\generic" -I"$(_TCLDIR)\win"
!endif

!endif

#-------------------------------------------------------------------------
# Locate the Tk headers to build against
#-------------------------------------------------------------------------

!if "$(PROJECT)" == "tk"
_TK_H          = ..\generic\tk.h
_INSTALLDIR    = $(_INSTALLDIR)\..
!endif

!ifdef PROJECT_REQUIRES_TK
!if !defined(TKDIR)
!if exist("$(_INSTALLDIR)\..\include\tk.h")
TKINSTALL      = 1
_TKDIR         = $(_INSTALLDIR)\..
_TK_H          = $(_TKDIR)\include\tk.h
TKDIR          = $(_TKDIR)
!elseif exist("$(_TCLDIR)\include\tk.h")
TKINSTALL      = 1
_TKDIR         = $(_TCLDIR)
_TK_H          = $(_TKDIR)\include\tk.h
TKDIR          = $(_TKDIR)
!endif
!else
_TKDIR = $(TKDIR:/=\)
!if exist("$(_TKDIR)\include\tk.h")
TKINSTALL      = 1
_TK_H          = $(_TKDIR)\include\tk.h
!elseif exist("$(_TKDIR)\generic\tk.h")
TKINSTALL      = 0
_TK_H          = $(_TKDIR)\generic\tk.h
!else
MSG =^
Failed to find tk.h. The TKDIR macro does not appear correct.
!error $(MSG)
!endif
!endif
!endif

#-------------------------------------------------------------------------
# Extract Tk version numbers
#-------------------------------------------------------------------------

!if defined(PROJECT_REQUIRES_TK) || "$(PROJECT)" == "tk"

!if [echo TK_MAJOR_VERSION = \>> versions.vc] \
   && [nmakehlp -V $(_TK_H) TK_MAJOR_VERSION >> versions.vc]
!endif
!if [echo TK_MINOR_VERSION = \>> versions.vc] \
   && [nmakehlp -V $(_TK_H) TK_MINOR_VERSION >> versions.vc]
!endif
!if [echo TK_PATCH_LEVEL = \>> versions.vc] \
   && [nmakehlp -V $(_TK_H) TK_PATCH_LEVEL >> versions.vc]
!endif

!include versions.vc

TK_DOTVERSION	= $(TK_MAJOR_VERSION).$(TK_MINOR_VERSION)
TK_VERSION	= $(TK_MAJOR_VERSION)$(TK_MINOR_VERSION)

!if "$(PROJECT)" != "tk"
!if $(TKINSTALL)
WISH		= "$(_TKDIR)\bin\wish$(TK_VERSION)$(SUFX).exe"
TKSTUBLIB	= "$(_TKDIR)\lib\tkstub$(TK_VERSION).lib"
TKIMPLIB	= "$(_TKDIR)\lib\tk$(TK_VERSION)$(SUFX).lib"
TK_INCLUDES     = -I"$(_TKDIR)\include"
!else
WISH		= "$(_TKDIR)\win\$(BUILDDIRTOP)\wish$(TCL_VERSION)$(SUFX).exe"
TKSTUBLIB	= "$(_TKDIR)\win\$(BUILDDIRTOP)\tkstub$(TCL_VERSION).lib"
TKIMPLIB	= "$(_TKDIR)\win\$(BUILDDIRTOP)\tk$(TCL_VERSION)$(SUFX).lib"
TK_INCLUDES     = -I"$(_TKDIR)\generic" -I"$(_TKDIR)\win" -I"$(_TKDIR)\xlib"
!endif
!endif

!endif

#----------------------------------------------------------
# Display stats being used.
#----------------------------------------------------------

!message *** Intermediate directory will be '$(TMP_DIR)'
!message *** Output directory will be '$(OUT_DIR)'
!message *** Suffix for binaries will be '$(SUFX)'
!message *** Optional defines are '$(OPTDEFINES)'
!message *** Compiler version $(VCVER). Target machine is $(MACHINE)
!message *** Compiler options '$(COMPILERFLAGS) $(OPTIMIZATIONS) $(DEBUGFLAGS) $(WARNINGS)'
!message *** Link options '$(LINKERFLAGS)'

!endif
@


1.28
log
@[FRQ 2965056]: Windows build with -DUNICODE
@
text
@d14 1
a14 1
# RCS: @@(#) $Id$
d192 3
a194 1
!if $(VCVERSION) >= 1500
@


1.27
log
@win/rules.vc:   (sync with tcl version)
mingw should always link with -ladvapi32
Remove ascii variant of tkWinPocs table,
it is no longer necessary.
@
text
@d133 1
a133 1
COMPILERFLAGS  =-W3
@


1.26
log
@[Bug #3020677] wish can't link reg1.2
@
text
@d14 1
a14 1
# RCS: @@(#) $Id: rules.vc,v 1.25 2010/03/12 15:23:39 nijtmans Exp $
d146 1
a146 1
COMPILERFLAGS  = $(COMPILERFLAGSS) -QI0f
d215 1
a215 1
TCL_THREADS	= 0
d219 1
d223 1
a223 1
USE_THREAD_ALLOC = 0
d244 3
a246 1
!if [nmakehlp -f $(OPTS) "threads"]
a249 2
!else
TCL_THREADS	= 0
d269 9
d432 18
@


1.25
log
@Fix [Tcl Bug 2967340]: Static build failure
@
text
@d9 1
a9 1
# 
d14 1
a14 1
# RCS: @@(#) $Id: rules.vc,v 1.24 2008/12/31 23:11:48 davygrvy Exp $
d562 1
a562 1
TCLREGLIB	= "$(_TCLDIR)\lib\tclreg12$(SUFX:t=).lib"
d575 1
a575 1
TCLREGLIB	= "$(_TCLDIR)\win\$(BUILDDIRTOP)\tclreg12$(SUFX:t=).lib"
@


1.24
log
@	* win/rules.vc: small bug not setting SYMBOLS macro fixed.
@
text
@d14 1
a14 1
# RCS: @@(#) $Id: rules.vc,v 1.23 2008/06/13 05:46:09 mistachkin Exp $
d562 2
a563 2
TCLREGLIB	= "$(_TCLDIR)\lib\tclreg11$(SUFX:t=).lib"
TCLDDELIB	= "$(_TCLDIR)\lib\tcldde12$(SUFX:t=).lib"
d575 2
a576 2
TCLREGLIB	= "$(_TCLDIR)\win\$(BUILDDIRTOP)\tclreg11$(SUFX:t=).lib"
TCLDDELIB	= "$(_TCLDIR)\win\$(BUILDDIRTOP)\tcldde12$(SUFX:t=).lib"
@


1.23
log
@TIP 285 Implementation
@
text
@d14 1
a14 1
# RCS: @@(#) $Id: rules.vc,v 1.22 2008/05/15 00:06:19 patthoyts Exp $
d217 1
@


1.22
log
@We should use the thread allocator for threaded builds. Added 'tclalloc' option to disable.
@
text
@d14 1
a14 1
# RCS: @@(#) $Id: rules.vc,v 1.21 2007/12/13 15:28:52 dgp Exp $
d255 6
@


1.21
log
@merge stable branch onto HEAD
@
text
@d14 1
a14 1
# RCS: @@(#) $Id: rules.vc,v 1.15.2.4 2007/12/10 18:39:32 dgp Exp $
d245 1
d270 3
a272 1
!else
@


1.21.2.1
log
@Update dll version numbers of dde/reg extension in the makefile.
@
text
@d14 1
a14 1
# RCS: @@(#) $Id: rules.vc,v 1.21 2007/12/13 15:28:52 dgp Exp $
d565 2
a566 2
TCLREGLIB	= "$(_TCLDIR)\win\$(BUILDDIRTOP)\tclreg12$(SUFX:t=).lib"
TCLDDELIB	= "$(_TCLDIR)\win\$(BUILDDIRTOP)\tcldde13$(SUFX:t=).lib"
@


1.21.2.2
log
@Update for VS10
@
text
@d14 1
a14 1
# RCS: @@(#) $Id: rules.vc,v 1.21.2.1 2009/10/15 21:07:49 patthoyts Exp $
d146 1
a146 1
COMPILERFLAGS  = $(COMPILERFLAGS) -QI0f
d192 1
a192 3
!if $(VCVERSION) >= 1600
VCVER=10
!elseif $(VCVERSION) >= 1500
d552 2
a553 2
TCLREGLIB	= "$(_TCLDIR)\lib\tclreg12$(SUFX:t=).lib"
TCLDDELIB	= "$(_TCLDIR)\lib\tcldde13$(SUFX:t=).lib"
@


1.20
log
@Handle MSVC 9 (aka: Visual Studio 2008)
@
text
@d14 1
a14 1
# RCS: @@(#) $Id: rules.vc,v 1.19 2007/10/31 00:05:53 patthoyts Exp $
@


1.19
log
@Use -fp:strict with msvc8 as -fp:precise fails on amd64 builds. Fix
the two places in Tk that generate errors with msvc8 when using this
flag.
@
text
@d14 1
a14 1
# RCS: @@(#) $Id: rules.vc,v 1.18 2007/10/12 18:56:33 patthoyts Exp $
d192 3
a194 1
!if $(VCVERSION) >= 1400
a195 2
_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
d203 6
@


1.18
log
@Fixed install of tk broken with last commit
@
text
@d14 1
a14 1
# RCS: @@(#) $Id: rules.vc,v 1.17 2007/10/12 14:14:54 patthoyts Exp $
a108 2
# Tk doesnt seem to be able to use -fp:strict.
!if "$(PROJECT)" != "tk"
a111 8
!else
!if [nmakehlp -c -fp:precise]
OPTIMIZATIONS  = $(OPTIMIZATIONS) -fp:precise
!endif
!if [nmakehlp -c -fp:except]
OPTIMIZATIONS  = $(OPTIMIZATIONS) -fp:except
!endif
!endif
@


1.17
log
@Mine all version information from headers.  Sync tcl and tk and bring
extension versions closer together. Try and avoid using tclsh to do
substitutions as we may cross compile.
@
text
@d14 1
a14 1
# RCS: @@(#) $Id: rules.vc,v 1.16 2007/08/21 20:35:11 patthoyts Exp $
d584 1
@


1.16
log
@Synchronize with tcl rules.vc
@
text
@d11 1
a11 1
# Copyright (c) 2003-2006 Patrick Thoyts
d14 1
a14 1
# RCS: @@(#) $Id: rules.vc,v 1.15 2007/02/04 00:10:54 mistachkin Exp $
d91 1
a91 1
!message *** Compiler doesn't have 'Optimizations'
d109 6
a117 1

d121 1
d158 1
a158 1
!message *** Compiler doesn't have 'Pentium 0x0f fix'
d178 1
a178 1
!message *** Linker doesn't have 'Win98 alignment problem'
a226 1
HAVE_UXTHEME_H  = 1
a281 6
!if [nmakehlp -f $(OPTS) "noxp"]
!message *** Exclude support for XP theme
HAVE_UXTHEME_H  = 0
!else
HAVE_UXTHEME_H  = 1
!endif
d393 1
a393 1
FULLWARNINGS		    = 0
d403 4
a406 1
FULLWARNINGS		    = 1
d408 5
a412 1
FULLWARNINGS		    = 0
a415 1

d455 1
a455 1
# Get common info used when building extensions.
d458 10
a467 1
!if "$(PROJECT)" != "tcl"
d470 1
a470 2
!if exist("$(_INSTALLDIR)\include\tcl.h")
TCLH		= "$(_INSTALLDIR)\include\tcl.h"
d472 3
a474 1
_TCLDIR		= $(_INSTALLDIR)
a482 1
TCLH		= "$(_TCLDIR)\include\tcl.h"
d484 1
a485 1
TCLH		= "$(_TCLDIR)\generic\tcl.h"
d487 1
d494 1
d496 16
a511 4
#----------------------------------------------------------
# Get the version from the header file.  Try all possibles
# even though some aren't fully valid.
#----------------------------------------------------------
d513 17
a529 22
!if [nmakehlp -g $(TCLH) TCL_VERSION] == 76
TCL_DOTVERSION	= 7.6
!elseif [nmakehlp -g $(TCLH) TCL_VERSION] == 80
TCL_DOTVERSION	= 8.0
!elseif [nmakehlp -g $(TCLH) TCL_VERSION] == 81
TCL_DOTVERSION	= 8.1
!elseif [nmakehlp -g $(TCLH) TCL_VERSION] == 82
TCL_DOTVERSION	= 8.2
!elseif [nmakehlp -g $(TCLH) TCL_VERSION] == 83
TCL_DOTVERSION	= 8.3
!elseif [nmakehlp -g $(TCLH) TCL_VERSION] == 84
TCL_DOTVERSION	= 8.4
!elseif [nmakehlp -g $(TCLH) TCL_VERSION] == 85
TCL_DOTVERSION	= 8.5
!elseif [nmakehlp -g $(TCLH) TCL_VERSION] == 86
TCL_DOTVERSION	= 8.6
!elseif [nmakehlp -g $(TCLH) TCL_VERSION] == 90
TCL_DOTVERSION	= 9.0
!elseif [nmakehlp -g $(TCLH) TCL_VERSION] == 0
MSG =^
Can't get version string from $(TCLH)
!error $(MSG)
d532 9
a540 1
TCL_VERSION	= $(TCL_DOTVERSION:.=)
d549 9
a557 6
TCLSH		= "$(_INSTALLDIR)\bin\tclsh$(TCL_VERSION)$(SUFX).exe"
TCLSTUBLIB	= "$(_INSTALLDIR)\lib\tclstub$(TCL_VERSION).lib"
TCLIMPLIB	= "$(_INSTALLDIR)\lib\tcl$(TCL_VERSION)$(SUFX).lib"
TCL_LIBRARY	= $(_INSTALLDIR)\lib
TCLREGLIB	= "$(_INSTALLDIR)\lib\tclreg11$(SUFX:t=).lib"
TCLDDELIB	= "$(_INSTALLDIR)\lib\tcldde12$(SUFX:t=).lib"
d560 1
d563 3
d573 3
d578 6
d586 65
d660 2
a661 2
!message *** Compiler version $(VCVER)
!message *** Compiler options '$(OPTIMIZATIONS) $(DEBUGFLAGS)'
@


1.15
log
@see log
@
text
@d14 1
a14 1
# RCS: @@(#) $Id: rules.vc,v 1.14 2006/10/31 14:45:04 patthoyts Exp $
d53 1
d65 2
a68 1
COPY    = copy /y >NUL
d192 5
a196 5
!if ![cl /Zs /Tc NUL 2>&1 | find "Version 12" > NUL]
VCVER=6
!elseif ![cl /Zs /Tc NUL 2>&1 | find "Version 13" > NUL]
VCVER=7
!elseif ![cl /Zs /Tc NUL 2>&1 | find "Version 14" > NUL]
d200 5
a204 2
!else
VCVER=0
@


1.15.2.1
log
@merge updates from HEAD
@
text
@d14 1
a14 1
# RCS: @@(#) $Id: rules.vc,v 1.15 2007/02/04 00:10:54 mistachkin Exp $
a52 1
ERRNULL  = 2>NUL
a63 2
NULL    = \NUL # Used in testing directory existence
ERRNULL = >NUL # Win9x shell cannot redirect stderr
d66 1
d190 5
a194 5
VCVER=0
!if ![echo VCVERSION=_MSC_VER > vercl.x] \
    && ![cl -nologo -TC -P vercl.x $(ERRNULL)]
!include vercl.i
!if $(VCVERSION) >= 1400
d198 2
a199 5
!elseif $(VCVERSION) >= 1300
VCVER=7
!elseif $(VCVERSION) >= 1200
VCVER=6
!endif
@


1.15.2.2
log
@merge updates from HEAD
@
text
@d11 1
a11 1
# Copyright (c) 2003-2007 Patrick Thoyts
d14 1
a14 1
# RCS: @@(#) $Id: rules.vc,v 1.15.2.1 2007/09/04 17:44:26 dgp Exp $
d91 1
a91 1
!message *** Compiler does not have 'Optimizations'
a108 6
# Tk doesnt seem to be able to use -fp:strict.
!if "$(PROJECT)" != "tk"
!if [nmakehlp -c -fp:strict]
OPTIMIZATIONS  = $(OPTIMIZATIONS) -fp:strict
!endif
!else
d112 1
a115 1
!endif
d152 1
a152 1
!message *** Compiler does not have 'Pentium 0x0f fix'
d172 1
a172 1
!message *** Linker does not have 'Win98 alignment problem'
d221 1
d277 6
d394 1
a394 1
WARNINGS		    = -W3
d404 1
a404 4
WARNINGS		    = -W4
!if [nmakehlp -l -warn:3]
LINKERFLAGS		    = $(LINKERFLAGS) -warn:3
!endif
d406 1
a406 5
WARNINGS		    = -W3
!endif
!if [nmakehlp -f $(CHECKS) "64bit"] && [nmakehlp -c -Wp64]
!message *** Doing 64bit portability warnings
WARNINGS		    = $(WARNINGS) -Wp64
d409 1
d450 1
a450 1
# Locate the Tcl headers to build against
d453 1
a453 1
!if "$(PROJECT)" == "tcl"
d455 1
a455 5
_TCL_H          = ..\generic\tcl.h

!else

# If INSTALLDIR set to tcl root dir then reset to the lib dir.
d457 1
a457 5
_INSTALLDIR=$(_INSTALLDIR)\lib
!endif

!if !defined(TCLDIR)
!if exist("$(_INSTALLDIR)\..\include\tcl.h")
d459 1
a459 3
_TCLDIR		= $(_INSTALLDIR)\..
_TCL_H          = $(_INSTALLDIR)\..\include\tcl.h
TCLDIR          = $(_INSTALLDIR)\..
d468 1
a469 1
_TCL_H          = $(_TCLDIR)\include\tcl.h
d471 1
a472 1
_TCL_H          = $(_TCLDIR)\generic\tcl.h
a478 1
!endif
d480 4
a483 4
#--------------------------------------------------------------
# Extract various version numbers from tcl headers
# The generated file is then included in the makefile.
#--------------------------------------------------------------
d485 22
a506 28
!if [echo REM = This file is generated from rules.vc > versions.vc]
!endif
!if [echo TCL_MAJOR_VERSION = \>> versions.vc] \
   && [nmakehlp -V "$(_TCL_H)" TCL_MAJOR_VERSION >> versions.vc]
!endif
!if [echo TCL_MINOR_VERSION = \>> versions.vc] \
   && [nmakehlp -V "$(_TCL_H)" TCL_MINOR_VERSION >> versions.vc]
!endif
!if [echo TCL_PATCH_LEVEL = \>> versions.vc] \
   && [nmakehlp -V "$(_TCL_H)" TCL_PATCH_LEVEL >> versions.vc]
!endif

# If building the tcl core then we need additional package versions
!if "$(PROJECT)" == "tcl"
!if [echo PKG_HTTP_VER = \>> versions.vc] \
   && [nmakehlp -V ..\library\http\pkgIndex.tcl http >> versions.vc]
!endif
!if [echo PKG_TCLTEST_VER = \>> versions.vc] \
   && [nmakehlp -V ..\library\tcltest\pkgIndex.tcl tcltest >> versions.vc]
!endif
!if [echo PKG_MSGCAT_VER = \>> versions.vc] \
   && [nmakehlp -V ..\library\msgcat\pkgIndex.tcl msgcat >> versions.vc]
!endif
!if [echo PKG_PLATFORM_VER = \>> versions.vc] \
   && [nmakehlp -V ..\library\platform\pkgIndex.tcl "platform " >> versions.vc]
!endif
!if [echo PKG_SHELL_VER = \>> versions.vc] \
   && [nmakehlp -V ..\library\platform\pkgIndex.tcl "platform::shell" >> versions.vc]
a507 9
!endif

!include versions.vc

#--------------------------------------------------------------
# Setup tcl version dependent stuff headers
#--------------------------------------------------------------

!if "$(PROJECT)" != "tcl"
d509 1
a509 1
TCL_VERSION	= $(TCL_MAJOR_VERSION)$(TCL_MINOR_VERSION)
d518 6
a523 9
TCLSH		= "$(_TCLDIR)\bin\tclsh$(TCL_VERSION)$(SUFX).exe"
!if !exist($(TCLSH)) && $(TCL_THREADS)
TCLSH           = "$(_TCLDIR)\bin\tclsh$(TCL_VERSION)t$(SUFX).exe"
!endif
TCLSTUBLIB	= "$(_TCLDIR)\lib\tclstub$(TCL_VERSION).lib"
TCLIMPLIB	= "$(_TCLDIR)\lib\tcl$(TCL_VERSION)$(SUFX).lib"
TCL_LIBRARY	= $(_TCLDIR)\lib
TCLREGLIB	= "$(_TCLDIR)\lib\tclreg11$(SUFX:t=).lib"
TCLDDELIB	= "$(_TCLDIR)\lib\tcldde12$(SUFX:t=).lib"
a525 1
TCL_INCLUDES    = -I"$(_TCLDIR)\include"
a527 3
!if !exist($(TCLSH)) && $(TCL_THREADS)
TCLSH		= "$(_TCLDIR)\win\$(BUILDDIRTOP)\tclsh$(TCL_VERSION)t$(SUFX).exe"
!endif
a534 3
TCL_INCLUDES	= -I"$(_TCLDIR)\generic" -I"$(_TCLDIR)\win"
!endif

a536 7
#-------------------------------------------------------------------------
# Locate the Tk headers to build against
#-------------------------------------------------------------------------

!if "$(PROJECT)" == "tk"
_TK_H          = ..\generic\tk.h
_INSTALLDIR    = $(_INSTALLDIR)\..
a538 65
!ifdef PROJECT_REQUIRES_TK
!if !defined(TKDIR)
!if exist("$(_INSTALLDIR)\..\include\tk.h")
TKINSTALL      = 1
_TKDIR         = $(_INSTALLDIR)\..
_TK_H          = $(_TKDIR)\include\tk.h
TKDIR          = $(_TKDIR)
!elseif exist("$(_TCLDIR)\include\tk.h")
TKINSTALL      = 1
_TKDIR         = $(_TCLDIR)
_TK_H          = $(_TKDIR)\include\tk.h
TKDIR          = $(_TKDIR)
!endif
!else
_TKDIR = $(TKDIR:/=\)
!if exist("$(_TKDIR)\include\tk.h")
TKINSTALL      = 1
_TK_H          = $(_TKDIR)\include\tk.h
!elseif exist("$(_TKDIR)\generic\tk.h")
TKINSTALL      = 0
_TK_H          = $(_TKDIR)\generic\tk.h
!else
MSG =^
Failed to find tk.h. The TKDIR macro does not appear correct.
!error $(MSG)
!endif
!endif
!endif

#-------------------------------------------------------------------------
# Extract Tk version numbers
#-------------------------------------------------------------------------

!if defined(PROJECT_REQUIRES_TK) || "$(PROJECT)" == "tk"

!if [echo TK_MAJOR_VERSION = \>> versions.vc] \
   && [nmakehlp -V $(_TK_H) TK_MAJOR_VERSION >> versions.vc]
!endif
!if [echo TK_MINOR_VERSION = \>> versions.vc] \
   && [nmakehlp -V $(_TK_H) TK_MINOR_VERSION >> versions.vc]
!endif
!if [echo TK_PATCH_LEVEL = \>> versions.vc] \
   && [nmakehlp -V $(_TK_H) TK_PATCH_LEVEL >> versions.vc]
!endif

!include versions.vc

TK_DOTVERSION	= $(TK_MAJOR_VERSION).$(TK_MINOR_VERSION)
TK_VERSION	= $(TK_MAJOR_VERSION)$(TK_MINOR_VERSION)

!if "$(PROJECT)" != "tk"
!if $(TKINSTALL)
WISH		= "$(_TKDIR)\bin\wish$(TK_VERSION)$(SUFX).exe"
TKSTUBLIB	= "$(_TKDIR)\lib\tkstub$(TK_VERSION).lib"
TKIMPLIB	= "$(_TKDIR)\lib\tk$(TK_VERSION)$(SUFX).lib"
TK_INCLUDES     = -I"$(_TKDIR)\include"
!else
WISH		= "$(_TKDIR)\win\$(BUILDDIRTOP)\wish$(TCL_VERSION)$(SUFX).exe"
TKSTUBLIB	= "$(_TKDIR)\win\$(BUILDDIRTOP)\tkstub$(TCL_VERSION).lib"
TKIMPLIB	= "$(_TKDIR)\win\$(BUILDDIRTOP)\tk$(TCL_VERSION)$(SUFX).lib"
TK_INCLUDES     = -I"$(_TKDIR)\generic" -I"$(_TKDIR)\win" -I"$(_TKDIR)\xlib"
!endif
!endif

!endif
d548 2
a549 2
!message *** Compiler version $(VCVER). Target machine is $(MACHINE)
!message *** Compiler options '$(COMPILERFLAGS) $(OPTIMIZATIONS) $(DEBUGFLAGS) $(WARNINGS)'
@


1.15.2.3
log
@merge updates from HEAD
@
text
@d14 1
a14 1
# RCS: @@(#) $Id: rules.vc,v 1.15.2.2 2007/10/15 18:38:41 dgp Exp $
d109 2
d114 8
@


1.15.2.4
log
@merge updates from HEAD
@
text
@d14 1
a14 1
# RCS: @@(#) $Id: rules.vc,v 1.15.2.3 2007/11/01 16:37:25 dgp Exp $
d192 1
a192 3
!if $(VCVERSION) >= 1500
VCVER=9
!elseif $(VCVERSION) >= 1400
d194 2
a202 6
# 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

@


1.14
log
@Update to support ttk merge.
@
text
@d14 1
a14 1
# RCS: @@(#) $Id: rules.vc,v 1.13 2006/10/19 00:48:26 patthoyts Exp $
d54 2
a55 1
CPY	= echo y | xcopy /i
d58 1
d60 3
a62 2
!else
CPY	= xcopy /i
@


1.13
log
@generic/tkImgBmap.c: Fixed line endings.
win/makefile.vc:  Patched up build system to manage
win/rules.vc:     AMD64 with MSVC8
win/nmakehlp.c:   Ensure operation without Platform SDK.
@
text
@d14 1
a14 1
# RCS: @@(#) $Id: rules.vc,v 1.26 2006/10/06 14:14:29 patthoyts Exp $
d34 1
a34 1
!if "$(CPU)" == ""
d134 1
d136 1
d139 1
d213 1
d269 6
@


1.12
log
@
	* generic/tkConsole.c: TIP #268 update regarding registered package
	* generic/tkMain.c:    version, now using full patchlevel instead of
	* generic/tkWindow.c:  major.minor
	* library/tk.tcl:
	* unix/configure:
	* unix/Makefile.in:
	* unix/tcl.m4:
	* win/configure:
	* win/Makefile.in:
	* win/makefile.vc:
	* win/rules.vc:
	* win/tcl.m4:
@
text
@d11 1
d14 1
a14 1
# RCS: @@(#) $Id: rules.vc,v 1.11 2004/02/08 01:38:03 davygrvy Exp $
d29 1
a29 1
### Fix the path seperators.
d34 1
d36 3
d56 1
a56 1
CPY	= xcopy /i /y
d62 2
a63 1

d73 1
a73 1
!if [$(cc32) -nologo -ML nmakehlp.c -link -subsystem:console > nul]
d82 1
a82 1
!if [nmakehlp -c -Otip]
d90 48
d142 1
a142 1
PENT_0F_ERRATA	= 1
a144 1
PENT_0F_ERRATA	= 0
d146 13
a167 1
PENT_0F_ERRATA	= 0
d171 4
a174 8
!if "$(MACHINE)" == "IA64"
### test for Itanium errata
!if [nmakehlp -c -QIA64_Bx]
!message *** Compiler has 'B-stepping errata workarounds'
ITAN_B_ERRATA	= 1
!else
!message *** Compiler doesn't have 'B-stepping errata workarounds'
ITAN_B_ERRATA	= 0
d176 16
d193 1
a193 1
ITAN_B_ERRATA	= 0
d300 7
d397 1
a397 1
OPTDEFINES	= -DTCL_CFGVAL_ENCODING=$(CFG_ENCODING)
d426 1
a426 1
!if "$(MACHINE)" == "IA64"
d444 1
a444 1
Don't know where tcl.h is.  Set the TCLDIR macro.
d457 1
a457 1
Don't know where tcl.h is.  The TCLDIR macro doesn't appear correct.
a490 1
TCL_PATCHLEVEL  = a5
d530 3
@


1.11
log
@* win/makefile.vc:
* win/rules.vc:
* win/rc/tk.rc:
* win/rc/wish.rc:  Now supports the 'unchecked' option when building.
@
text
@d13 1
a13 1
# RCS: @@(#) $Id: rules.vc,v 1.18 2004/02/07 21:47:19 davygrvy Exp $
d407 1
@


1.10
log
@sync'd to Tcl.
@
text
@d13 1
a13 1
# RCS: @@(#) $Id: rules.vc,v 1.17 2004/01/15 23:08:10 davygrvy Exp $
d132 1
d182 6
d205 10
a218 1
DBGX	    = g
d221 3
a223 1
DBGX	    =
@


1.9
log
@	* win/rules.vc:  Sync'd to Tcl, respects the CHECKS=nodep
	commandline macro and was used to verify the Tcl_Panic change above.
@
text
@d13 1
a13 1
# RCS: @@(#) $Id: rules.vc,v 1.16 2004/01/10 00:24:55 davygrvy Exp $
d274 1
d282 6
@


1.8
log
@sync'd to Tcl.
@
text
@d13 1
a13 1
# RCS: @@(#) $Id: rules.vc,v 1.15 2003/12/23 02:19:13 davygrvy Exp $
d269 16
d305 3
@


1.7
log
@Corrected several problems that prevented OPTS=symbols from building
properly. [Patch 707792] Thanks to Joe Mistachkin for the fixes.
@
text
@d10 1
a10 1
# Copyright (c) 2001-2002 David Gravereaux.
d13 1
a13 1
# RCS: @@(#) $Id: rules.vc,v 1.6 2003/03/06 03:08:40 davygrvy Exp $
d36 3
d272 2
a273 1
OPTDEFINES	=
d275 1
a275 1
OPTDEFINES	= -DTCL_MEM_DEBUG
d290 12
d311 1
d322 1
d325 1
d334 4
a337 9
### TODO: add a command to nmakehlp.c to grep for Tcl's version from tcl.h.
### Because nmake can't return a string, we'll need to play games with return
### codes.  It might look something like this:
#!if [nmakehlp -g $(TCL.H)] == 81
#TCL_DOTVERSION	= 8.1
#!elseif [nmakehlp -g $(TCL.H)] == 82
#TCL_DOTVERSION	= 8.2
#...
#!endif
d339 13
d353 10
d364 6
@


1.6
log
@updated default tcl version to 8.5
@
text
@d13 1
a13 1
# RCS: @@(#) $Id: rules.vc,v 1.5 2003/02/14 20:28:21 davygrvy Exp $
d195 1
a195 1
SUFX	    = tsdx
d199 1
a199 1
DBGX	    = d
d203 1
a203 1
SUFX	    = $(SUFX:d=)
@


1.5
log
@matched to the Tcl one.
@
text
@d13 1
a13 1
# RCS: @@(#) $Id: rules.vc,v 1.10 2003/01/05 00:44:24 davygrvy Exp $
d325 1
a325 1
TCL_DOTVERSION	= 8.4
@


1.5.2.1
log
@Corrected several problems that prevented OPTS=symbols from building
properly. [Patch 707792] Thanks to Joe Mistachkin for the fixes.
@
text
@d13 1
a13 1
# RCS: @@(#) $Id: rules.vc,v 1.5 2003/02/14 20:28:21 davygrvy Exp $
d195 1
a195 1
SUFX	    = tsgx
d199 1
a199 1
DBGX	    = g
d203 1
a203 1
SUFX	    = $(SUFX:g=)
@


1.5.2.2
log
@* win/makefile.vc:  Backport to the most recent
* win/rules.vc:     changes on the HEAD.
* win/nmakehlp.c:
@
text
@d10 1
a10 1
# Copyright (c) 2001-2003 David Gravereaux.
d13 1
a13 1
# RCS: @@(#) $Id: rules.vc,v 1.11 2004/02/08 01:38:03 davygrvy Exp $
a35 3
!ifndef CFG_ENCODING
CFG_ENCODING	= \"cp1252\"
!endif
a128 1
UNCHECKED	= 0
a177 6
!if [nmakehlp -f $(OPTS) "unchecked"]
!message *** Doing unchecked
UNCHECKED = 1
!else
UNCHECKED = 0
!endif
a194 10
#----------------------------------------
# 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.
#----------------------------------------
d199 1
d202 1
a202 3
!endif

!if !$(DEBUG) || $(DEBUG) && $(UNCHECKED)
a265 23
# Decode the checks requested.
#----------------------------------------------------------

!if "$(CHECKS)" == "" || [nmakehlp -f "$(CHECKS)" "none"]
TCL_NO_DEPRECATED	    = 0
FULLWARNINGS		    = 0
!else
!if [nmakehlp -f $(CHECKS) "nodep"]
!message *** Doing nodep check
TCL_NO_DEPRECATED	    = 1
!else
TCL_NO_DEPRECATED	    = 0
!endif
!if [nmakehlp -f $(CHECKS) "fullwarn"]
!message *** Doing full warnings check
FULLWARNINGS		    = 1
!else
FULLWARNINGS		    = 0
!endif
!endif


#----------------------------------------------------------
d269 1
a269 2
OPTDEFINES	= -DTCL_CFGVAL_ENCODING=$(CFG_ENCODING)

d271 1
a271 1
OPTDEFINES	= $(OPTDEFINES) -DTCL_MEM_DEBUG
a284 15
!if $(TCL_NO_DEPRECATED)
OPTDEFINES	= $(OPTDEFINES) -DTCL_NO_DEPRECATED
!endif

!if $(DEBUG)
OPTDEFINES	= $(OPTDEFINES) -DTCL_CFG_DEBUG
!elseif $(OPTIMIZING)
OPTDEFINES	= $(OPTDEFINES) -DTCL_CFG_OPTIMIZED
!endif
!if $(PROFILE)
OPTDEFINES	= $(OPTDEFINES) -DTCL_CFG_PROFILED
!endif
!if "$(MACHINE)" == "IA64"
OPTDEFINES	= $(OPTDEFINES) -DTCL_CFG_DO64BIT
!endif
a294 1
TCLH		= "$(_INSTALLDIR)\include\tcl.h"
a304 1
TCLH		= "$(_TCLDIR)\include\tcl.h"
a306 1
TCLH		= "$(_TCLDIR)\generic\tcl.h"
d315 9
a323 4
#----------------------------------------------------------
# Get the version from the header file.  Try all possibles
# even though some aren't fully valid.
#----------------------------------------------------------
a324 11
!if [nmakehlp -g $(TCLH) TCL_VERSION] == 76
TCL_DOTVERSION	= 7.6
!elseif [nmakehlp -g $(TCLH) TCL_VERSION] == 80
TCL_DOTVERSION	= 8.0
!elseif [nmakehlp -g $(TCLH) TCL_VERSION] == 81
TCL_DOTVERSION	= 8.1
!elseif [nmakehlp -g $(TCLH) TCL_VERSION] == 82
TCL_DOTVERSION	= 8.2
!elseif [nmakehlp -g $(TCLH) TCL_VERSION] == 83
TCL_DOTVERSION	= 8.3
!elseif [nmakehlp -g $(TCLH) TCL_VERSION] == 84
a325 12
!elseif [nmakehlp -g $(TCLH) TCL_VERSION] == 85
TCL_DOTVERSION	= 8.5
!elseif [nmakehlp -g $(TCLH) TCL_VERSION] == 86
TCL_DOTVERSION	= 8.6
!elseif [nmakehlp -g $(TCLH) TCL_VERSION] == 90
TCL_DOTVERSION	= 9.0
!elseif [nmakehlp -g $(TCLH) TCL_VERSION] == 0
MSG =^
Can't get version string from $(TCLH)
!error $(MSG)
!endif

a327 6
!if $(TCL_VERSION) < 81
TCL_DOES_STUBS	= 0
!else
TCL_DOES_STUBS	= 1
!endif

@


1.5.2.3
log
@Sync with tcl to enable building with VC8 (VS2005 C compiler)
@
text
@d10 1
a10 2
# Copyright (c) 2001-2002 David Gravereaux.
# Copyright (c) 2003 Patrick Thoyts
d13 1
a13 1
# RCS: @@(#) $Id: rules.vc,v 1.11.2.2 2006/06/14 15:24:19 patthoyts Exp $
d28 1
a28 1
### Fix the path separators.
d36 3
d67 1
a67 1
!if [$(cc32) -nologo nmakehlp.c -link -subsystem:console > nul]
d76 1
a76 1
!if [nmakehlp -c -Ot]
a83 44
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:precise]
OPTIMIZATIONS  = $(OPTIMIZATIONS) -fp:precise
!endif

!if [nmakehlp -c -fp:except]
OPTIMIZATIONS  = $(OPTIMIZATIONS) -fp:except
!endif

!if [nmakehlp -c -Gs]
OPTIMIZATIONS  = $(OPTIMIZATIONS) -Gs
!endif

!if [nmakehlp -c -GS]
OPTIMIZATIONS  = $(OPTIMIZATIONS) -GS
!endif

DEBUGFLAGS     =

!if [nmakehlp -c -RTC1]
DEBUGFLAGS     = $(DEBUGFLAGS) -RTC1
!elseif [nmakehlp -c -GZ]
DEBUGFLAGS     = $(DEBUGFLAGS) -GZ
!endif

COMPILERFLAGS  =-W3

!if [nmakehlp -c -YX]
OPTIMIZATIONS  = $(OPTIMIZATIONS) -YX
!endif

d88 1
a88 1
COMPILERFLAGS  = $(COMPILERFLAGSS) -QI0f
d91 1
a92 13
!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"
d102 1
d106 9
a114 15
#----------------------------------------------------------
# MSVC8 (ships with Visual Studio 2005) generates a manifest
# file that we should link into the binaries. This is how.
#----------------------------------------------------------

_VC_MANIFEST_EMBED_EXE=
_VC_MANIFEST_EMBED_DLL=
!if ![cl /Zs /Tc NUL 2>&1 | find "Version 12" > NUL]
VCVER=6
!elseif ![cl /Zs /Tc NUL 2>&1 | find "Version 13" > NUL]
VCVER=7
!elseif ![cl /Zs /Tc NUL 2>&1 | find "Version 14" > NUL]
VCVER=8
_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
d116 1
a116 1
VCVER=0
d205 10
a218 1
DBGX	    = g
d221 3
a223 1
DBGX	    =
a226 4
#!if $(VCVER) > 6
#BUILDDIRTOP =$(BUILDDIRTOP)_VC$(VCVER)
#!endif

d287 23
d313 2
a314 1
OPTDEFINES	=
d316 1
a316 1
OPTDEFINES	= -DTCL_MEM_DEBUG
d330 3
d342 1
a342 1
!if "$(MACHINE)" == "IA64" || "$(MACHINE)" == "AMD64"
d355 1
d360 1
a360 1
Failed to find tcl.h.  Set the TCLDIR macro.
d366 1
d369 1
d373 1
a373 1
Failed to find tcl.h.  The TCLDIR macro does not appear correct.
d378 4
a381 9
### TODO: add a command to nmakehlp.c to grep for Tcl's version from tcl.h.
### Because nmake can't return a string, we'll need to play games with return
### codes.  It might look something like this:
#!if [nmakehlp -g $(TCL.H)] == 81
#TCL_DOTVERSION	= 8.1
#!elseif [nmakehlp -g $(TCL.H)] == 82
#TCL_DOTVERSION	= 8.2
#...
#!endif
d383 11
d395 12
d409 6
a445 2
!message *** Compiler version $(VCVER) options are\
 '$(COMPILERFLAGS) $(OPTIMIZATIONS) $(DEBUGFLAGS)'
@


1.5.2.4
log
@
	* generic/tkConsole.c: TIP #268 update regarding registered package
	* generic/tkMain.c:    version, now using full patchlevel instead of
	* generic/tkWindow.c:  major.minor
	* library/tk.tcl:
	* unix/configure:
	* unix/Makefile.in:
	* unix/tcl.m4:
	* win/configure:
	* win/Makefile.in:
	* win/makefile.vc:
	* win/rules.vc:
	* win/tcl.m4:
@
text
@d14 1
a14 1
# RCS: @@(#) $Id: rules.vc,v 1.5.2.3 2006/06/14 23:52:01 patthoyts Exp $
a410 1
TCL_PATCHLEVEL  = .14
@


1.5.2.5
log
@	* win/makefile.vc:  Support MSVC8 and AMD64 target. Also try using
	* win/rules.vc:     sed to generate the manifest (cross-compile cannot
	* win/nmakehlp.c:   execute tclsh). If no sed, use the tclsh exe.
@
text
@d10 2
a11 2
# Copyright (c) 2001-2003 David Gravereaux.
# Copyright (c) 2003-2006 Patrick Thoyts
d14 1
a14 1
# RCS: @@(#) $Id: rules.vc,v 1.5.2.4 2006/09/22 19:01:52 andreas_kupries Exp $
a36 3
!ifndef CFG_ENCODING
CFG_ENCODING	= \"cp1252\"
!endif
d49 1
a49 1
CPY	= xcopy /i /y >NUL
d55 1
a55 2
MKDIR   = mkdir
COPY    = copy /y >NUL
a111 4
!if [nmakehlp -c -GL]
OPTIMIZATIONS  = $(OPTIMIZATIONS) -GL
!endif

a119 4
!if [nmakehlp -c -RTCc]
DEBUGFLAGS     = $(DEBUGFLAGS) -RTCc
!endif

a158 6
LINKERFLAGS     =

!if [nmakehlp -l -ltcg]
LINKERFLAGS     =-ltcg
!endif

a263 10
#----------------------------------------
# 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.
#----------------------------------------
d275 3
a277 6
!if "$(MACHINE)" != "IX86"
BUILDDIRTOP =$(BUILDDIRTOP)_$(MACHINE)
!endif
!if $(VCVER) > 6
BUILDDIRTOP =$(BUILDDIRTOP)_VC$(VCVER)
!endif
a336 22
#----------------------------------------------------------
# Decode the checks requested.
#----------------------------------------------------------

!if "$(CHECKS)" == "" || [nmakehlp -f "$(CHECKS)" "none"]
TCL_NO_DEPRECATED	    = 0
FULLWARNINGS		    = 0
!else
!if [nmakehlp -f $(CHECKS) "nodep"]
!message *** Doing nodep check
TCL_NO_DEPRECATED	    = 1
!else
TCL_NO_DEPRECATED	    = 0
!endif
!if [nmakehlp -f $(CHECKS) "fullwarn"]
!message *** Doing full warnings check
FULLWARNINGS		    = 1
!else
FULLWARNINGS		    = 0
!endif
!endif

d344 1
a344 1
OPTDEFINES	= $(OPTDEFINES) -DTCL_MEM_DEBUG
a379 1
TCLH		= "$(_INSTALLDIR)\include\tcl.h"
a389 1
TCLH		= "$(_TCLDIR)\include\tcl.h"
a391 1
TCLH		= "$(_TCLDIR)\generic\tcl.h"
d445 2
a446 3
!message *** Compiler version $(VCVER)
!message *** Compiler options '$(OPTIMIZATIONS) $(DEBUGFLAGS)'
!message *** Link options '$(LINKERFLAGS)'
@


1.5.2.6
log
@Remove the /RTCc flag
@
text
@d14 1
a14 1
# RCS: @@(#) $Id: rules.vc,v 1.5.2.5 2006/09/26 23:55:50 patthoyts Exp $
d128 4
@


1.5.2.7
log
@Ensure builds with VC6 without Platform SDK and pickup MACHINE from environment
to make life easier on Windows non-x86 platforms.
@
text
@d14 1
a14 1
# RCS: @@(#) $Id: rules.vc,v 1.11.2.4 2006/10/06 14:04:49 patthoyts Exp $
a33 1
!if "$(CPU)" == ""
a34 3
!else
MACHINE         = $(CPU)
!endif
d463 1
d497 1
a497 1
!message *** Compiler version $(VCVER), arch is $(MACHINE)
@


1.5.2.8
log
@Fix bug #1582769 build with VC2003 and correct i386 arch.
@
text
@d14 1
a14 1
# RCS: @@(#) $Id: rules.vc,v 1.5.2.7 2006/10/18 08:56:21 patthoyts Exp $
d34 1
a34 1
!if "$(CPU)" == "" || "$(CPU)" == "i386"
a133 1
# In v13 -GL and -YX are incompatible.
a134 1
!if ![nmakehlp -c -GL]
a136 1
!endif
d500 1
a500 1
!message *** Compiler version $(VCVER)
@


1.5.2.9
log
@Fix for AMD64 symbols builds
@
text
@d14 1
a14 1
# RCS: @@(#) $Id: rules.vc,v 1.5.2.8 2006/10/31 15:18:28 patthoyts Exp $
a125 2
#  the platform SDK has broken headers that break the runtime checks for amd64
!if "$(MACHINE)" != "AMD64"
a130 1
!endif
@


1.5.2.10
log
@Update for VS10
@
text
@d14 1
a14 1
# RCS: @@(#) $Id: rules.vc,v 1.5.2.9 2007/09/11 00:13:12 patthoyts Exp $
d86 1
a86 1
!message *** Compiler does not have 'Optimizations'
d148 1
a148 1
COMPILERFLAGS  = $(COMPILERFLAGS) -QI0f
d150 1
a150 1
!message *** Compiler does not have 'Pentium 0x0f fix'
d170 1
a170 1
!message *** Linker does not have 'Win98 alignment problem'
a197 8
!elseif ![cl /Zs /Tc NUL 2>&1 | find "Version 15" > NUL]
VCVER=9
_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
!elseif ![cl /Zs /Tc NUL 2>&1 | find "Version 16" > NUL]
VCVER=10
_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
d396 1
@


1.5.2.11
log
@Add -D_CRT_SECURE_NO_DEPRECATE and -D_CRT_NONSTDC_NO_DEPRECATE, reducing the number of
	deprecation warnings on later VC++ versions.
Better VCVERSION determination.
All changes backported from Tcl8.5/8.6
@
text
@d14 1
a14 1
# RCS: @@(#) $Id: rules.vc,v 1.5.2.10 2010/10/23 21:43:05 nijtmans Exp $
d190 13
a202 5
VCVER=0
!if ![echo VCVERSION=_MSC_VER > vercl.x] \
    && ![cl -nologo -TC -P vercl.x $(ERRNULL)]
!include vercl.i
!if $(VCVERSION) >= 1600
a203 13
!elseif $(VCVERSION) >= 1500
VCVER=9
!elseif $(VCVERSION) >= 1400
VCVER=8
!elseif $(VCVERSION) >= 1300
VCVER=7
!elseif $(VCVERSION) >= 1200
VCVER=6
!endif
!endif

# Since MSVC8 we must deal with manifest resources.
!if $(VCVERSION) >= 1400
d206 2
@


1.4
log
@	* win/winMain.c (Tcl_AppInit): Calls Registry_Init() and
	Dde_Init() when STATIC_BUILD and TCL_USE_STATIC_PACKAGES macros
	are set.

	* win/makefile.vc:  linkexten option now sets the
	TCL_USE_STATIC_PACKAGES	macro which also adds the registry and
	dde static lib files to the link of the shell. [Patch 479697]

	* win/rules.vc: Matches the one from Tcl.

	* win/buildall.vc.bat: More useful commentary.
@
text
@d13 1
a13 1
# RCS: @@(#) $Id: rules.vc,v 1.9 2002/11/04 05:50:19 davygrvy Exp $
d39 2
a40 1
# to the user when copying files.
d44 1
d52 1
d128 1
d142 2
a143 2
!if [nmakehlp -f $(OPTS) "linkexten"]
!message *** Doing linkexten
d172 6
d266 1
a266 1
# Set our defines armed with our options.
d278 3
d317 1
a317 1
### codes :)  It might look something like this:
@


1.3
log
@The test for compiler optimizations was in error.  Thanks goes to Roy Terry
<royterry@@earthlink.net> for his assistence with this.
@
text
@d13 1
a13 1
# RCS: @@(#) $Id: rules.vc,v 1.2 2002/03/28 23:23:03 davygrvy Exp $
d25 5
a29 1
INSTALLDIR	= C:\Progra~1\Tcl
d36 17
d124 1
a124 1
TCL_LINKWITHEXTENSIONS	= 0
d140 1
a140 1
TCL_LINKWITHEXTENSIONS	= 1
d142 1
a142 1
TCL_LINKWITHEXTENSIONS	= 0
d175 1
a175 1
TCL_LINKWITHEXTENSIONS = 0
d271 64
@


1.2
log
@	* win/.cvsignore (new):
	* win/lamp.bmp (new):
	* win/makefile.vc:
	* win/nmakehlp.c (new):
	* win/rules.vc:  Brought the makefile up-to-date with Tcl's one.
	This now has support for Win9x issues and the winhelp target now
	exists.  Color scheme can be changed.  I'm just imparting a first
	suggestion using orange :)  I'll have to think about the install
	portion of the helpfile as I'll need to do some tricks to insert
	tk's contents file into Tcl's using some special winhlp32.exe
	switches.  [Bug 533862 527941]
@
text
@d13 1
a13 1
# RCS: @@(#) $Id: rules.vc,v 1.7 2002/03/27 21:15:43 davygrvy Exp $
d49 1
a49 1
!if [nmakehlp -c -Ox]
@


1.2.2.1
log
@sync with head
@
text
@d13 1
a13 1
# RCS: @@(#) $Id: rules.vc,v 1.2 2002/03/28 23:23:03 davygrvy Exp $
@


1.1
log
@	* win/mkd.bat:
	* win/rmd.bat:  Removed -kb CVS attribute and added changes
	from Llyod Lim for better stability.  [Patch #456761]

	* win/rules.vc(new):
	* win/buildall.vc.bat(new):
	* win/makefile.vc:  large rewrite following Tcl's makefile.vc as
	a guide and Patch #456761.  Appears BugFree(tm).
@
text
@d10 1
a10 1
# Copyright (c) 2001 Tomasoft Engineering.
d13 1
a13 1
# RCS: @@(#) $Id: rules.vc,v 1.3 2001/11/08 21:32:23 davygrvy Exp $
d32 59
d95 2
a96 1
!if "$(OPTS)" == "" || ![echo $(OPTS) | find /i "none" > nul]
d102 1
d105 1
a105 1
!if ![echo $(OPTS) | find /i "static" > nul]
d111 1
a111 1
!if ![echo $(OPTS) | find /i "msvcrt" > nul]
d117 1
a117 1
!if ![echo $(OPTS) | find /i "linkexten" > nul]
d123 1
a123 1
!if ![echo $(OPTS) | find /i "threads" > nul]
d129 1
a129 1
!if ![echo $(OPTS) | find /i "symbols" > nul]
d135 1
a135 1
!if ![echo $(OPTS) | find /i "profile" > nul]
d141 6
d153 1
a153 1
# Shouldn't statically put the extensions inside the shell when dynamic.
a209 4
!message *** Intermediate directory will be '$(TMP_DIR)'
!message *** Output directory will be '$(OUT_DIR)'
!message *** Suffix for binaries will be '$(SUFX)'

d214 2
a215 1
!if "$(STATS)" == "" || ![echo $(STATS) | find /i "none" > nul]
d219 1
a219 1
!if ![echo $(STATS) | find /i "memdbg" > nul]
d225 1
a225 1
!if ![echo $(STATS) | find /i "compdbg" > nul]
d233 5
d252 8
@


1.1.2.1
log
@Merge with current TOT
Added support for the wm stackorder command
Fixed crash when selecting Menu items in the Application menu that we didn't
put there.
Added first bits of the use of CG for low-level drawing.  The line-drawing works,
the rest doesn't yet.  You have to set the file static useCGDrawing to 1 and
rebuild to activate this code.
@
text
@d13 1
a13 1
# RCS: @@(#) $Id$
@


1.1.2.2
log
@Merging with TOT as of 06/09/2002.
@
text
@d10 1
a10 1
# Copyright (c) 2001-2002 David Gravereaux.
a31 59
!message ===============================================================================

#----------------------------------------------------------
# build the helper app we need to overcome nmake's limiting
# environment.
#----------------------------------------------------------

!if !exist(nmakehlp.exe)
!if [$(cc32) -nologo -ML nmakehlp.c -link -subsystem:console > nul]
!endif
!endif

#----------------------------------------------------------
# Test for compiler features
#----------------------------------------------------------

### test for optimizations
!if [nmakehlp -c -Ox]
!message *** Compiler has 'Optimizations'
OPTIMIZING	= 1
!else
!message *** Compiler doesn't have 'Optimizations'
OPTIMIZING	= 0
!endif

!if "$(MACHINE)" == "IX86"
### test for pentium errata
!if [nmakehlp -c -QI0f]
!message *** Compiler has 'Pentium 0x0f fix'
PENT_0F_ERRATA	= 1
!else
!message *** Compiler doesn't have 'Pentium 0x0f fix'
PENT_0F_ERRATA	= 0
!endif
### 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 doesn't have 'Win98 alignment problem'
ALIGN98_HACK	= 0
!endif
!else
PENT_0F_ERRATA	= 0
ALIGN98_HACK	= 0
!endif

!if "$(MACHINE)" == "IA64"
### test for Itanium errata
!if [nmakehlp -c -QIA64_Bx]
!message *** Compiler has 'B-stepping errata workarounds'
ITAN_B_ERRATA	= 1
!else
!message *** Compiler doesn't have 'B-stepping errata workarounds'
ITAN_B_ERRATA	= 0
!endif
!else
ITAN_B_ERRATA	= 0
!endif
d36 1
a36 2

!if "$(OPTS)" == "" || [nmakehlp -f "$(OPTS)" "none"]
a41 1
LOIMPACT	= 0
d44 1
a44 1
!if [nmakehlp -f $(OPTS) "static"]
d50 1
a50 1
!if [nmakehlp -f $(OPTS) "msvcrt"]
d56 1
a56 1
!if [nmakehlp -f $(OPTS) "linkexten"]
d62 1
a62 1
!if [nmakehlp -f $(OPTS) "threads"]
d68 1
a68 1
!if [nmakehlp -f $(OPTS) "symbols"]
d74 1
a74 1
!if [nmakehlp -f $(OPTS) "profile"]
a79 6
!if [nmakehlp -f $(OPTS) "loimpact"]
!message *** Doing loimpact
LOIMPACT	= 1
!else
LOIMPACT	= 0
!endif
d86 1
a86 1
# We shouldn't statically put the extensions inside the shell when dynamic.
d143 4
d151 1
a151 2

!if "$(STATS)" == "" || [nmakehlp -f "$(STATS)" "none"]
d155 1
a155 1
!if [nmakehlp -f $(STATS) "memdbg"]
d161 1
a161 1
!if [nmakehlp -f $(STATS) "compdbg"]
a168 5

#----------------------------------------------------------
# Set our defines armed with our options.
#----------------------------------------------------------

a182 8

#----------------------------------------------------------
# Display stats being used.
#----------------------------------------------------------

!message *** Intermediate directory will be '$(TMP_DIR)'
!message *** Output directory will be '$(OUT_DIR)'
!message *** Suffix for binaries will be '$(SUFX)'
@


1.1.2.3
log
@merged with trunk at tag macosx-8-4-merge-2002-08-20-trunk
@
text
@d49 1
a49 1
!if [nmakehlp -c -Otip]
@


