TARGET=sh-elf
DCBASE=/usr/local/dreamcast
CC=$(DCBASE)/bin/$(TARGET)-gcc -ml -O
LD=$(DCBASE)/bin/$(TARGET)-ld
AS=$(DCBASE)/bin/$(TARGET)-as
AR=$(DCBASE)/bin/$(TARGET)-ar

INCS=
OBJFILES  = libdream.o video.o serial.o tty.o font.o spu.o
OBJFILES += input.o controller.o
OBJFILES += cdfs.o gd_syscalls.o
OBJFILES += maple.o

all: libdream.a sh-stub.o

libdream.a: $(OBJFILES)
	$(AR) rcs $@ $(OBJFILES)

%.o: %.c
	$(CC) $(INCS) -ml -c $< -o $@

%.o: %.s
	$(AS) -little $< -o $@

spu.o: spu.c aica_fw.h

sh-stub.o: sh-stub.c
	$(CC) $(INCS) -g -ml -c $< -o $@

clean:
	-rm -f *.o *.a *.bck

forceall: clean all

