# Skunks 2.0.0
# Ported to Dreamcast by Indiket

# Put the filename of the output binary here
TARGET = skunks.elf

# List all of your C files here, but change the extension to ".o"
# Include "romdisk.o" if you want a rom disk.
OBJS = src/skunks.o src/menu.o

# If you define this, the Makefile.rules will create a romdisk.o for you
# from the named dir.
KOS_ROMDISK_DIR = romdisk

# The rm-elf step is to remove the target before building, to force the
# re-creation of the rom disk.
all: rm-elf $(TARGET)

# Chui DREAMCAST SDL + ODE 0.11.1
INCLUDES = -I$(KOS_BASE)/addons/include/SDL -I$(KOS_BASE)/addons/include/Ode

KOS_CFLAGS += $(INCLUDES) -DDREAMCAST -DMENU -ffast-math -funroll-loops -fomit-frame-pointer -fmessage-length=0

include $(KOS_BASE)/Makefile.rules

clean:
	-rm -f $(TARGET) $(OBJS) romdisk.*

rm-elf:
	-rm -f $(TARGET)

$(TARGET): $(OBJS) $(PROBJS) romdisk.o
	$(KOS_CC) $(KOS_CFLAGS) $(KOS_LDFLAGS) -o $(TARGET) $(KOS_START) \
		$(OBJS) $(PROBJS) romdisk.o $(OBJEXTRA) -L$(KOS_BASE)/lib -lgcc -lODE_0111 -lOPCODE_0111 -lSDL_129 -lSDL_ttf -lfreetype -lm -lstdc++ $(KOS_LIBS)

run: $(TARGET)
	$(KOS_LOADER) $(TARGET)

dist:
	rm -f $(OBJS)
	$(KOS_STRIP) $(TARGET)
	
bin:
	$(KOS_OBJCOPY) -O binary -R .stack $(TARGET) skunks.bin
