# change the file name or add files here
CFILES = main.c
AFILES = sub.S
OBJECTS = crt0.o $(CFILES:.c=.o) $(AFILES:.S=.o)

TARGET = main.elf

# 
# Change the flags if you needed
#
CC = sde-gcc
LD = sde-gcc

CFLAGS = -g -O0 -mcpu=4kc -mips32 -EL -mno-float
ASFLAGS = -g -O0 -mcpu=4kc -mips32 -EL -mno-float
CPPFLAGS = -I/usr/local/sde5/sde/include
LDFLAGS = -EL  -Ttext 0x80000400 -lc

all: $(TARGET)

$(TARGET): $(OBJECTS)
	$(LD) $(CFLAGS)  $^ -o $@ $(LDFLAGS) 

clean:
	$(RM) $(TARGET) $(OBJECTS) 

clear: clean
	$(RM) *.mws *.mpj *.ld

PHONY: all clean clear

