# Dwarf Connect 4
# 2012 Port by Indiket
#   

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

# List all of your C files here, but change the extension to ".o"
# Sound.o won't be compiled (game does not have any sound...).
OBJS = src/Connect4.o src/Game.o \
src/engine/AIHeuristics.o src/engine/AIMinimax.o src/engine/AIRandom.o src/engine/Board.o src/engine/C4Game.o src/engine/GamesRules.o \
src/general/Log.o \
src/wintoolkit/Button.o src/wintoolkit/CheckBox.o src/wintoolkit/Combo.o src/wintoolkit/Control.o src/wintoolkit/Drawing.o src/wintoolkit/Font.o src/wintoolkit/FontManager.o \
src/wintoolkit/Image.o src/wintoolkit/Label.o src/wintoolkit/ListBox.o src/wintoolkit/Slider.o src/wintoolkit/TabSheet.o src/wintoolkit/TextBox.o src/wintoolkit/Window.o src/wintoolkit/WindowManager.o src/wintoolkit/WinToolKitGeneral.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)

include $(KOS_BASE)/Makefile.rules

#Use // in PACKAGE_DATA_DIR as MinGW Fix
KOS_CFLAGS += -DINT_MIN=-32767 -DINT_MAX=32767 -DPACKAGE_DATA_DIR="//rd" -DDREAMCAST -I$(KOS_BASE)/addons/include/SDL

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

rm-elf:
	-rm -f $(TARGET) romdisk.*

#Libs: SDL 1213, SDL_Image_124 (libPNG128 + zlib123). We could use libPNG159, but not necessary...
$(TARGET): $(OBJS) romdisk.o
	$(KOS_CC) $(KOS_CFLAGS) $(KOS_LDFLAGS) -o $(TARGET) $(KOS_START) \
		$(OBJS) romdisk.o $(OBJEXTRA) -L$(KOS_BASE)/lib -lgcc -lSDL_image_124 -lpng_128 -lz_123 -lSDL_1213 -lm -lstdc++ $(KOS_LIBS)

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

bin:
	$(KOS_OBJCOPY) -O binary -R .stack $(TARGET) dconnect4.bin