include $(DEVKITPPC)/wii_rules
#include $(DEVKITPPC)/gamecube_rules

OUTPUT := rin
OFILES := gbcore/cpu.o gbcore/gb.o gbcore/lcd.o gbcore/sgb.o \
	gbcore/rom.o gbcore/mbc.o gbcore/apu.o gbcore/cheat.o \
	main.o renderer.o sound.o screen.o pad.o filer.o\
	fatfs/tff.o fatfs/diskio.o fatfs/sdio.o

CFLAGS = -g -O2 -mrvl -Wall $(MACHDEP) $(INCLUDE)
LDFLAGS = -g $(MACHDEP) -mrvl -Wl,-Map,$(notdir $@).map -s
LIBS := -logc

INCLUDE := -I$(LIBOGC_INC)
LIBPATHS := -L$(LIBOGC_LIB)

LD := $(CC)
DEPSDIR := $(CURDIR)
GCUBE := D:/devkitPro/emulators/gcube/gcube.exe


all: $(OUTPUT).dol
$(OUTPUT).dol: $(OUTPUT).elf
$(OUTPUT).elf: $(OFILES)

clean:
	$(RM) *.o *.d gbcore/*.o gbcore/*.d fatfs/*.o fatfs/*.d *.map *.dol *.elf

run:
	$(GCUBE) $(OUTPUT).dol
