###############################################################################
# File:         TOOLSET/KeilArmV3.def
# Contents:     KeilArmV3 defines
###############################################################################

toolset		= KeilArmV3
s		    = s
o		    = o
a		    = lib
exe		    =

.SUFFIXES:	.asm

#
#   Toolset global variables
#       KEILMDK_ARM340     - Root of the Keil MDK 340 Toolkit (From Environment)
#       KEILMDK_ARM        - Root of the Keil MDK 340 Toolkit (Make format)
#       KEILMDK_ARM_BIN    - Root of the Arm compiler
#
KEILMDK_ARM340  ?= C:\Keil\ARM
KEILMDK_ARM	    := $(subst \,/,$(strip $(KEILMDK_ARM340)))
KEILMDK_ARM_BIN	:= $(KEILMDK_ARM)/bin31

#
#   Ensure that the tools are available
#
.PHONY:		KeilArm
KeilArmV3:
	@$(echo) [Toolset $(toolset)]; \
	[ -z "$KEILMDK_ARM340" ] && echo KEILMDK_ARM340 env var not set && exit 2; \
	if [ ! -d "$(KEILMDK_ARM)" ] ; then echo KEILMDK_ARM340 Directory not found: $(KEILMDK_ARM);  exit 2; fi; \
	if [ ! -d "$(KEILMDK_ARM_BIN)" ] ; then echo Keil Compiler directory not found: $(KEILMDK_ARM_BIN); exit 2; fi; \


#
#   Toolset programs
#
assembler   := $(KEILMDK_ARM_BIN)/armasm
compiler    := $(KEILMDK_ARM_BIN)/armcc
librarian   := $(KEILMDK_ARM_BIN)/armar
linker      := $(KEILMDK_ARM_BIN)/armlink
fromelf     := $(KEILMDK_ARM_BIN)/fromelf

#
#   Compiler include search paths
#
KEIL_INCLUDES  := $(KEILMDK_ARM)/RV31/INC

#
#   Compiler library search paths
#
KEIL_LIBS  := $(KEILMDK_ARM)/RV31/LIB

#
#   Prevent the user from subverting the toolset
#
RVCT31_CCOPT :=
RVCT31_ASMOPT :=
RVCT31_LINKOPT :=
export RVCT31_CCOPT RVCT31_ASMOPT RVCT31_LINKOPT

#
