#
# win/common.vc  --
#
# Visual C++ 2.x and 4.0 common include file for Windows.
#------------------------------------------------------------------------------
# Copyright 1996-1999 Karl Lehenbauer and Mark Diekhans.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted, provided
# that the above copyright notice appear in all copies.  Karl Lehenbauer and
# Mark Diekhans make no representations about the suitability of this
# software for any purpose.  It is provided "as is" without express or
# implied warranty.
#------------------------------------------------------------------------------
# $Id: common.vc,v 1.1.1.1 1999/06/28 20:35:39 damon Exp $
#------------------------------------------------------------------------------
#

#
# IMPORTANT:  Most paths in the file must be absolute paths.  This is normally
# done my making them relative to $(ROOT).
#

#
# Installation directory root.  They *MUST* point to the same location, only
# PREFIX should use the DOS convention of \ for path seperator and PREFIXU
# should use /.
#
PREFIX=C:\tcl
PREFIXU=C:/tcl

#
# TclX and TkX versions.
#
TCLX_VERSION = 8.1.1
TKX_VERSION  = 8.1.1

#
# Project directories
#
# o ROOT- Absolute path to the top of source tree.
# o TMP_DIR - Location where .obj files should be stored during build.
#   This maybe absolute or relative to the win build directories.
#   (In practice any value other than "." may not yet work!)
# o TOOLS32 - Location of VC++ 32-bit development tools. Note that the
#   VC++ 2.0 header files are broken, so you need to use the ones that
#   come with the developer network CD's, or later versions of VC++.
# o IDE32 - With VC++ 5.0 the resource compiler is in a separate directory
#

ROOT     = ..\..
TMP_DIR  = .
TOOLS32	= c:\Program Files\DevStudio\VC
IDE32	= c:\Program Files\DevStudio\SharedIDE

# Comment the following line to compile with symbols
NODEBUG=1
 
!IF "$(NODEBUG)" == "1"
cdebug = -Ox -Oy- -Gs -GD
!ELSE
cdebug = -Z7 -Od -WX
!ENDIF

# uncomment the following two lines to compile with TCL_MEM_DEBUG
#DEBUGDEFINES   =-DTCL_MEM_DEBUG


# Tcl/Tk build directories and library extensions depend on NODEBUG.
!IF "$(NODEBUG)" == "1"
TCL_TMP_DIR     = Release
TK_TMP_DIR	= Release
TCL_DBGX        =
TK_DBGX         =
!ELSE
TCL_TMP_DIR     = Debug
TK_TMP_DIR	= Debug
TCL_DBGX        = d
TK_DBGX         = d
!ENDIF

#
# Tcl build directories and files.
#
TCL_DIR          = $(ROOT)\..\tcl8.1.1
TCL_GENERIC_DIR  = $(TCL_DIR)\generic
TCL_WIN_DIR      = $(TCL_DIR)\win
TCL_BUILD_DIR    = $(TCL_WIN_DIR)\$(TCL_TMP_DIR)
TCL_RUNTIME_DIR  = $(TCL_DIR)\library
TCL_TESTS_DIR    = $(TCL_DIR)\tests
TCL_LIB          = $(TCL_WIN_DIR)\tcl81.lib
TCL_DLL          = $(TCL_WIN_DIR)\tcl81.dll
TCL_SALIB        = $(TCL_WIN_DIR)\tcl81sa.lib

#
# TK build directories and files.
#
TK_DIR           = $(ROOT)\..\tk8.1.1
TK_GENERIC_DIR   = $(TK_DIR)\generic
TK_WIN_DIR       = $(TK_DIR)\win
TK_BUILD_DIR     = $(TK_WIN_DIR)\$(TK_TMP_DIR)
TK_XLIB_DIR      = $(TK_DIR)\xlib
TK_RUNTIME_DIR   = $(TK_DIR)\library
TK_TESTS_DIR     = $(TK_DIR)\tests
TK_LIB           = $(TK_WIN_DIR)\tk81.lib
TK_DLL           = $(TK_WIN_DIR)\tk81.dll
TK_SALIB         = $(TK_WIN_DIR)\tk81sa.dll

#
# TclX directories.
#
TCLX_WIN_DIR      = $(ROOT)\tcl\win
TCLX_GENERIC_DIR  = $(ROOT)\tcl\generic
TCLX_RUNTIME_DIR  = $(ROOT)\tcl\runtime
TCLX_LIB          = $(TCLX_WIN_DIR)\tclx811.lib
TCLX_DLL          = $(TCLX_WIN_DIR)\tclx811.dll
TCLX_SALIB        = $(TCLX_WIN_DIR)\tclx811s.lib
TCLX_INST_BIN     = $(PREFIX)\bin
TCLX_INST_INCL    = $(PREFIX)\include
TCLX_INST_LIB     = $(PREFIX)\lib
TCLX_INST_LIBU    = $(PREFIXU)/lib
TCLX_INST_RUNTIME = $(TCLX_INST_LIB)\tclX$(TCLX_VERSION)
TCLX_INST_RUNTIMEU= $(TCLX_INST_LIBU)/tclX$(TCLX_VERSION)

#
# TkX directories.
#
TKX_WIN_DIR      = $(ROOT)\tk\win
TKX_GENERIC_DIR  = $(ROOT)\tk\generic
TKX_RUNTIME_DIR  = $(ROOT)\tk\runtime
TKX_LIB          = $(TKX_WIN_DIR)\tkx811.lib
TKX_DLL          = $(TKX_WIN_DIR)\tkx811.dll
TKX_SALIB        = $(TKX_WIN_DIR)\tkx811sa.dll
TKX_INST_BIN     = $(PREFIX)\bin
TKX_INST_INCL    = $(PREFIX)\include
TKX_INST_LIB     = $(PREFIX)\lib
TKX_INST_LIBU    = $(PREFIXU)/lib
TKX_INST_RUNTIME = $(TKX_INST_LIB)\tkX$(TKX_VERSION)
TKX_INST_RUNTIMEU= $(TKX_INST_LIBU)/tkX$(TKX_VERSION)

#
# Tools used during the build.
#
RUNTCL   = $(TCLX_WIN_DIR)\runtcl.bat
INSTCOPY = $(RUNTCL) $(TCLX_WIN_DIR)\instcopy


# Make sure the VC++ tools are at the head of the path
PATH=$(TOOLS32)\bin;$(PATH)

cc32 = "$(TOOLS32)\bin\cl" -I"$(TOOLS32)\include"
rc32 = "$(IDE32)\bin\rc"

# On Win95, developer studio defines INCLUDE and LIB, but not nmake.
# On NT you don't need these (same VC++ release!).

!IF "$(INCLUDE)" == ""
INCLUDE=$(TOOLS32)\INCLUDE;$(TOOLS32)\MFC\include
!endif
!IF "$(LIB)" == ""
LIB=$(TOOLS32)\LIB;\$(TOOLS32)\MFC\lib
!ENDIF

CPU=i386
CP=copy

# We are building 95 and NT. We define this to select windows sockets
# instead of windows sockets 2, which is not available on 95.
TARGETOS=BOTH
!include <ntwin32.mak>
 
# We need user32 in console mode for handling sockets.
baselibs=$(baselibs) user32.lib

# VC++ 5.0 complains if /MACHINE is not supplied.
MACHINE = IX86
lflags  = $(lflags) /MACHINE:$(MACHINE)
