# Grande 0.5 by Katsuyoshi Sato
# Original DC port (KallistiOS 1.1.6) by DCGrendel (2002)
# New re-port by Indiket (2012)

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

# List all of your C files here, but change the extension to ".o"
OBJS = boss.o calc.o enemy.o font.o game.o KXL.o KXLimage.o load.o main.o misc.o my.o opening.o pal.o ranking.o text.o

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

all: rm-elf $(TARGET)

include $(KOS_BASE)/Makefile.rules

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

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

# GCC4 warns about signered and unsignered pointer (GCC3 does not). All the code uses Uint8 (instead of Int8) in operations like sprintf.
# I disabled the warnings, so everything should be OK.
KOS_CFLAGS += -Wno-pointer-sign -I. -DBMP_PATH="//rd/bmp" -DDATA_PATH="//rd/data" -DWAV_PATH="//rd/wav" -DTITLE="Grande-KOS_0.5"

$(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 -lz -lm $(KOS_LIBS)

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