# tong-its - a curious cards game
# https://github.com/ricoz/tong-its/
# Ported to Dreamcast by Indiket

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

# List all of your C files here, but change the extension to ".o"
# Include "romdisk.o" if you want a rom disk.
OBJS = main.o engine/src/CardGraphics.o engine/src/CCardRegion.o engine/src/CCardStack.o engine/src/CGame.o \
font/font.o \
tongits/src/CDeck.o tongits/src/CPlayer.o tongits/src/CTongIts.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
INCLUDES = -I$(KOS_BASE)/addons/include/SDL 

# FLAGS:
KOS_CPPFLAGS += $(INCLUDES) -Wno-sign-compare -Wno-return-type -Wno-reorder -Wno-char-subscripts \
-Wno-write-strings -Wno-parentheses -Wno-maybe-uninitialized \
-DDREAMCAST 

include $(KOS_BASE)/Makefile.rules

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

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

$(TARGET): $(OBJS) $(PROBJS) romdisk.o
	$(KOS_CCPLUS) $(KOS_CPPFLAGS) $(KOS_LDFLAGS) -o $(TARGET) $(KOS_START) \
		$(OBJS) $(PROBJS) romdisk.o $(OBJEXTRA) -L$(KOS_BASE)/lib -lstdc++ -lgcc -lSDL_1213 $(KOS_LIBS)

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

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