###############################################################################
# COPYRIGHT - VIX IP PTY LTD ("VIX"). ALL RIGHTS RESERVED.
#
# File:         TOOLSET/VERIX.def
# Contents:     VERIX rules as used for the Verix V SDK
#               Make definitions for the Verix Tools
#
# Description:
#       This file provides Toolset definitions for the target makefiles
#       The file is dropped into the top of the generated platform specfic makefile
#
###############################################################################

toolset = VERIX

o		= o
s		= asm
a		= a
exe		= .out

.SUFFIXES:  .asm

#
#   Ensure that the compiler can be found
#   Use the environment variables
#       GBE_VERIXV      - Root of the VERIX Install
#       GBE_VERIXV_ARM  - Root of the ARM install
#       GBE_VERIXV_SIGN - Root of the VeriShield File Signing Tool
#
ifndef GBE_VERIXV
    GBE_VERIXV := c:\VerixVAps
    export GBE_VERIXV
endif

ifndef GBE_VERIXV_ARM
    GBE_VERIXV_ARM := C:/Program Files/ARM
    export GBE_VERIXV_ARM
endif

ifndef GBE_VERIXV_SIGN
    GBE_VERIXV_SIGN := C:/Program Files/VeriShield File Signing Tool
    export GBE_VERIXV_SIGN
endif


.PHONY:     VERIX
verix:
	@if [ -z "$$GBE_VERIXV" ]; then echo "GBE_VERIXV env var not set"; exit 2; fi; \
	if [ -z "$$GBE_VERIXV_ARM" ]; then echo "GBE_VERIXV_ARM env var not set"; exit 2; fi; \
	if [ -z "$$GBE_VERIXV_SIGN" ]; then echo "GBE_VERIXV_SIGN env var not set"; exit 2; fi; \
	if [ ! -d "$$GBE_VERIXV" ]; then echo "ERROR: GBE_VERIXV directory not found ($$GBE_VERIXV). Compiler not available"; exit 2; fi; \
	if [ ! -d "$$GBE_VERIXV_ARM" ]; then echo "ERROR: GBE_VERIXV_ARM directory not found ($$GBE_VERIXV_ARM). Compiler not available"; exit 2; fi; \
	if [ ! -d "$$GBE_VERIXV_SIGN" ]; then echo "ERROR: GBE_VERIXV_SIGN directory not found ($$GBE_VERIXV_SIGN). FileSign Tool not available"; exit 2; fi; \
	echo "[Toolset Verifone VERIX]";

VERIX       := $(subst \,/,$(strip $(GBE_VERIXV)))
VERIXV_ARM  := $(subst \,/,$(strip $(GBE_VERIXV_ARM)))
VERIXV_SIGN := $(subst \,/,$(strip $(GBE_VERIXV_SIGN)))

#
#   Extend the PATH used by the toolset
#
VX_PATH:= $(VERIX)/vfsdk/bin
VX_PATH:= $(VX_PATH);$(VERIXV_ARM)/RVD/Core/1.7/283/win_32-pentium/bin
VX_PATH:= $(VX_PATH);$(VERIXV_ARM)/Utilities/FLEXlm/9.2/release/win_32-pentium
VX_PATH:= $(VX_PATH);$(VERIXV_ARM)/bin/win_32-pentium
VX_PATH:= $(VX_PATH);$(VERIXV_ARM)/RVCT/Programs/2.0.1/277/win_32-pentium

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

#
#   Define compiler specific include and library directories
#
VERIX_INCLUDE := $(VERIX)/vfsdk/include
VERIX_INCLUDE := $(VERIX_INCLUDE) $(VERIX)/ACT2000/include

VERIX_LIB := $(VERIX)/ACT2000/output/rv/files/Static/Debug

#
#   Define the compiler specfic names and paths for the various tools
#
VERIX_compiler      := $(VERIX)/vfsdk/bin/vrxcc
VERIX_linker        := $(VERIX)/vfsdk/bin/vrxcc
VERIX_hdr           := $(VERIX)/vfsdk/bin/vrxhdr
ARM_ar              := $(VERIXV_ARM)/RVCT/Programs/2.0.1/277/win_32-pentium/armar
VERIX_FileSignature := $(VERIXV_SIGN)/FileSignature

#
#   Setup the LM_LICENSE_FILE
#   Not used for network license
#
LM_LICENSE_FILE := $(VERIXV_ARM)/License/license.dat
export LM_LICENSE_FILE

#
