GNU_INSTALL_ROOT	=C:/Program Files/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_EABI
GNU_VERSION			=4.7.2
THUMB2GNULIB 	="$(GNU_INSTALL_ROOT)/lib/gcc/arm-none-eabi/$(GNU_VERSION)/thumb2"
THUMB2GNULIB2	="$(GNU_INSTALL_ROOT)/arm-none-eabi/lib/thumb2"

CC = arm-none-eabi-gcc
CPP = arm-none-eabi-g++
AR = arm-none-eabi-ar
AS = arm-none-eabi-as
STRIP = arm-none-eabi-strip
OBJ = arm-none-eabi-objcopy
#OPTS = -mthumb -mcpu=cortex-m3 -Os -std=c11 -Wall -nostartfiles -fms-extensions \
#	   -DTARGET_IS_TEMPEST_RC1 -D__BUILD_WITH_EXAMPLE__ -Dtoolchain_gcc -DCORE_M3

CPU       		= cortex-m3
OPTIM			= s	   
OPTS			= -mcpu=$(CPU) 
OPTS			+= -mthumb 
OPTS			+= -Wall 
OPTS			+= -O$(OPTIM) 
OPTS			+= -mapcs-frame 
OPTS			+= -D__thumb2__=1 
#OPTS	 		+= -msoft-float 
OPTS			+= -gdwarf-2 
OPTS   		+= -mno-sched-prolog 
OPTS			+= -fno-hosted 
OPTS			+= -mtune=cortex-m3 
OPTS			+= -march=armv7-m 
OPTS			+= -mfix-cortex-m3-ldrd  
#OPTS  			+= -ffunction-sections 
#OPTS			+= -fdata-sections 	   
OPTS			+= -DTARGET_IS_TEMPEST_RC1 -D__BUILD_WITH_EXAMPLE__ -Dtoolchain_gcc 
OPTS			+= -DCORE_M3
OPTS			+= -nostartfiles
#OPTS			+= -mfloat-abi=softfp
OPTS			+= -Dsprintf=siprintf
OPTS			+= -Dstrtoul=at_strtoul
OPTS			+= -Dstrtol=at_strtol
OPTS			+= -Datoi=at_atoi

LK			= -static
#LK       		+= -Xlinker --gc-sections
LK       		+= -Wl,--start-group 
LK 				+= -L$(THUMB2GNULIB) -L$(THUMB2GNULIB2)
LK       		+= -lc -lg -lstdc++ -lsupc++ 
LK 				+= -lgcc -lm 
LK       		+= -Wl,--end-group 

	   
AOPTS = -mthumb -mcpu=cortex-m3 --defsym RAM_MODE=1
	   
LD_SCRIPT = scripts/ldscript_rom_gnu.ld
#LD_SCRIPT = scripts/lpc176x.ld