###############################################################################
# COPYRIGHT - VIX IP PTY LTD ("VIX"). ALL RIGHTS RESERVED.
#
# File:         TOOLSET/AVR_IAR.rul[e]
# Contents:     IAR rules as used for the AVR
#               Make definitions for the IAR tools.
#
# Description:
#       This file provides Toolset definitions for the target makefiles
#       The file is dropped into the top of the generated platform specfic makefile
#
# Revision History:
#       16-Aug-04   DDP     Created
###############################################################################

toolset = avr_iar

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

.SUFFIXES:  .asm
.PHONY:     iar

#
#   Ensure that the compiler can be found
#   Use the environment varibales
#       AVR_IAR - Root of the AVR workbench
#
ifndef GBE_AVR_IAR
    GBE_AVR_IAR := C:/Program Files/IAR Systems/Embedded Workbench 3.2
    export GBE_AVR_IAR
endif

iar:
	@if [ -z "$$GBE_AVR_IAR" ]; then echo "GBE_AVR_IAR env var not set"; exit 2; fi; \
	if [ ! -d "$$GBE_AVR_IAR" ]; then echo "ERROR: GBE_AVR_IAR directory not found ($$GBE_AVR_IAR). Compiler not available"; exit 2; fi; \
	echo "[Toolset AVR - IAR Systems]";

iar_avr = $(subst \,/,$(strip $(GBE_AVR_IAR)))

#
#   Define the compiler specfic names and paths for the various tools
#
COMPILER_HOME=$(iar_avr)
COMPILER_HOME_AVR=$(iar_avr)/avr

avr_iar_assembler       = $(COMPILER_HOME)/avr/bin/aavr.exe
avr_iar_compiler        = $(COMPILER_HOME)/avr/bin/iccavr.exe
avr_iar_cpp_compiler    = $(COMPILER_HOME)/avr/bin/iccavr.exe
avr_iar_linker          = $(COMPILER_HOME)/common/bin/xlink.exe
avr_iar_librarian       = $(COMPILER_HOME)/common/bin/xar.exe
avr_linker_lib_dir      = $(COMPILER_HOME)/avr/lib/clib
avr_linker_lib          = $(avr_linker_lib_dir)/cl6s-ec


