#/****************************************************************
#KPIT Cummins Infosystems Limited Pune, India. -01-Sept-2003.
#
#This program is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
#*****************************************************************/

PREFIX=rx-elf

DEBUG_FLAGS=-gdwarf-2

# Specify compiler to be used
CC = $(PREFIX)-gcc

# Specify Assembler to be used
AS = $(PREFIX)-as

# Specify linker to be used
LD = $(PREFIX)-ld

# Specify CPU flag
CPU = -mcpu=rx600 -mlittle-endian-data

# Common compiler flags
CFLAGS = -nostartfiles

ALL_FLAGS = $(CFLAGS) $(DEBUG_FLAGS) $(CPU)


# Application name
#APPNAME = 

# Specify all objects that you are going to link together
OBJS	=	 vector_table.o hardware_setup.o interrupt_handlers.o Rx62t_led_flasher.o
SOURCES =	 start.S vector_table.c hardware_setup.c interrupt_handlers.c Rx62t_led_flasher.c

Rx62t_led_flasher.mot : Rx62t_led_flasher.out
	$(PREFIX)-objcopy -O srec Rx62t_led_flasher.out $@

# Define ROMSTART if compiling for ROM
Rx62t_led_flasher.out:$(SOURCES) Rx62t_led_flasher.ld	 makefile
	$(CC) $(ALL_FLAGS) -DROMSTART -DTIMER -T Rx62t_led_flasher.ld -Xlinker -Map -Xlinker Rx62t_led_flasher.map -o $@ $(SOURCES) -lm
	
all:Rx62t_led_flasher.mot
rom:Rx62t_led_flasher.mot

clean:
	rm -f *.o *.out *.mot *.map



