# -*- mode: mak; -*-
###############################################################################
# File:         TOOLSET/vcwin.def
# Contents:     Visual C/C++ defines
###############################################################################

toolset		= vcwin

o		= obj
s		= asm
a		= lib
exe		= .exe

.SUFFIXES:	.asm

#
#   Setup the basic MSVS environment paths
#   This is taken from "c:\Program Files\Microsoft Visual Studio\VC98\Bin\VCVARS32.BAT"
#
#   Cannot use VCVARS32.BAT data imported from the environment as it
#   will conflict with other versions of MS
#
#   The following are the default installed locations, which may be
#   overriden by environment variables
#
PROGRAMFILES  ?= C:\\Program Files
VSCommonDir   ?= $(PROGRAMFILES)\Microsoft Visual Studio\Common
MSDevDir      ?= $(PROGRAMFILES)\Microsoft Visual Studio\Common\MSDev98
MSVCDir       ?= $(PROGRAMFILES)\Microsoft Visual Studio\VC98
VcOsDir       ?= WINNT


# Verify environment variable requirements
.PHONY:		visualc
visualc:
  ifndef GBE_NOTOOLSTEST
	    @$(echo) '[Toolset VCWIN32 - Visual C/C++ WIN32]'; \
	    if [ ! -d "$(VSCommonDir)" ]; then echo "Directory VSCommonDir does not exist: $(VSCommonDir)"; exit 2; fi; \
	    if [ ! -d "$(MSDevDir)" ];    then echo "Directory MSDevDir does not exist: $(MSDevDir)"; exit 2; fi; \
	    if [ ! -d "$(MSVCDir)" ];     then echo "Directory MSVCDir does not exist: $(MSVCDir)"; exit 2; fi;
  endif

VISUALC		:= $(subst \,/,$(strip $(MSVCDir)))
visualc		:= $(subst $(space),$(spacealt),$(subst \,/,$(strip $(MSVCDir))))

#
#   Setup PATH, VC_LIB and INCLUDE
#
V6_PATH := $(MSDevDir)\BIN
V6_PATH := $(V6_PATH);$(MSVCDir)\BIN
V6_PATH := $(V6_PATH);$(VSCommonDir)\TOOLS\$(VcOsDir)
V6_PATH := $(V6_PATH);$(VSCommonDir)\TOOLS

ifeq "$(findstring $(V6_PATH),$(PATH))" ""
PATH    := $(V6_PATH);$(PATH)
endif
Path    := $(PATH)
export PATH

INCLUDE := $(MSVCDir)\ATL\INCLUDE
INCLUDE := $(INCLUDE);$(MSVCDir)\INCLUDE
INCLUDE := $(INCLUDE);$(MSVCDir)\MFC\INCLUDE
export INCLUDE

VC_LIB     := $(MSVCDir)\LIB
VC_LIB     := $(VC_LIB);$(MSVCDir)\MFC\LIB


# rpcgen configuration
#
RPCGEN_CPP	:= cl
RPCGEN_CFLAGS	:= -EP
export RPCGEN_CPP RPCGEN_CFLAGS

#
