# Super Methane Brothers 1.4.8
# Re-Ported by Indiket

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

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

# Basic methane brothers compilation
# Includes: Main source code + Main data + Dreamcast files + Mikmod sound
OBJS = ../gfxoff.o ../baddie.o ../bitdraw.o ../bitgroup.o ../bititem.o \
	../boss.o ../game.o ../gasobj.o ../global.o ../goodie.o ../maps.o \
	../misc.o ../objlist.o ../player.o ../power.o ../target.o \
	../suck.o ../weapon.o ../sound.o ../data/snddata.o \
	../data/gfxdata.o ../data/gfxdata2.o ../data/gfxdata3.o ../data/mapdata.o \
	../dreamcast/doc.o ../dreamcast/SDL_framerate.o ../mikmod/audiodrv.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: message $(TARGET)

# Methane brothers with sound
message:
	@echo "Compiling Super Methane Brothers."
	@echo "================================="

# -fexceptions is needed. Also, compile with sound!
# Hide lots of warning when compiling with GCC4
KOS_CPPFLAGS += -Wno-write-strings -fexceptions -I../ -I$(KOS_BASE)/../kosports/libmikmod-3.2.0-beta2/include  -I../dreamcast -DDREAMCAST -DMETHANE_MIKMOD

include $(KOS_BASE)/Makefile.rules

clean:
	-rm -f $(TARGET) *.o ../*.o ../data/*.o ../mikmod/*.o *.bin

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

$(TARGET): $(OBJS) $(PROBJS)
	$(KOS_CC) $(KOS_CPPFLAGS) $(KOS_LDFLAGS) -o $(TARGET) $(KOS_START) \
		$(OBJS)  $(PROBJS) $(OBJEXTRA) -L$(KOS_BASE)/lib -lgcc -lmikmod_320b2 -lSDL_1213 -lm -lz_123 -lstdc++ $(KOS_LIBS)

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

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