# -*- mode: mak; -*-
###############################################################################
# File:         TOOLSET/VCEMBEDDED2005.DEF
# Contents:     Visual Studio 2005 C/C++ defines for Embedded Development
###############################################################################

toolset		= vcembedded2005

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

.SUFFIXES:	.asm

#
#   Setup the basic .NET environment paths
#   This is taken from "C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\sdkvars.bat"
#
#   Cannot use vsvars.bat data imported from the environment as it
#   will conflict with other versions of MS
#
#   The following are the default installed locations
#   Currently assume default installation of .NET 2005
#
PROGRAMFILES        ?= C:\\Program Files
WINDIR              ?= C:\\WINDOWS
VSINSTALLDIR        ?= $(PROGRAMFILES)/Microsoft Visual Studio 8/Common7/IDE
VCINSTALLDIR        ?= $(PROGRAMFILES)/Microsoft Visual Studio 8

DevEnvDir   := $(VSINSTALLDIR)
MSVCDir     := $(VCINSTALLDIR)/VC

# Verify environment variable requirements
.PHONY:		vcembedded
vcembedded:
  ifndef GBE_NOTOOLSTEST
	    @$(echo) [Toolset WinCE - Visual Studio 2005]; \
	    if [ -z "$$WCEROOT" ]; then echo   "[VCEMBEDDED2005.DEF] (E) WCEROOT env var not set"; exit 2; fi; \
	    if [ -z "$$SDKROOT" ]; then echo   "[VCEMBEDDED2005.DEF] (E) SDKROOT env var not set"; exit 2; fi; \
	    if [ ! -d "$$WCEROOT" ]; then echo "[VCEMBEDDED2005.DEF] (E) WCEROOT directory not found: $$WCEROOT" ; exit 2; fi; \
	    if [ ! -d "$$SDKROOT" ]; then echo "[VCEMBEDDED2005.DEF] (E) SDKROOT directory not found: $$SDKROOT" ; exit 2; fi;
  endif

#
#   Sanitise root paths
#
WCEROOT		:= $(subst \,/,$(strip $(WCEROOT)))
SDKROOT		:= $(subst \,/,$(strip $(SDKROOT)))

#
#   Setup PATH for the SDK
#
NET_PATH:= $(MSVCDir)/ce/bin/$(WCE_VSTOOL)
NET_PATH:= $(NET_PATH);$(DevEnvDir)
NET_PATH:= $(NET_PATH);$(MSVCDir)/BIN
NET_PATH:= $(NET_PATH);$(VCINSTALLDIR)/Common7/Tools
NET_PATH:= $(NET_PATH);$(VCINSTALLDIR)/Common7/Tools/bin

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


        # The program database file
PDB		= $(OBJDIR)/$(GBE_PBASE)$(GBE_TYPE).pdb

	# rpcgen configuration
	#..
RPCGEN_CPP	:= $(WCE_CC)
RPCGEN_CFLAGS	:= -EP
export RPCGEN_CPP RPCGEN_CFLAGS

#
