#DefenderDC
#DC porting by Ron

INC=-DDATA_PREFIX="/rd/" -DFILE_SEPARATOR="/"  -DROM_PATH_PREFIX="/rd/" 

#OPT= -O3 -fstrict-aliasing -fexpensive-optimizations -foptimize-register-move  -freduce-all-givs -frename-registers -frerun-cse-after-loop -frerun-loop-opt -fschedule-insns -fno-sched-interblock -fsched-spec-load -fsingle-precision-constant -fstrength-reduce -fstrict-aliasing -ffast-math -fno-common  -fno-builtin -fno-exceptions -fargument-noalias-global -fomit-frame-pointer# -Wall -g  -ffreestanding

#OPT2 = -O9 -fomit-frame-pointer -fno-ident -freorder-blocks -funsigned-char -funsigned-char -funroll-all-loops -frerun-loop-opt  -falign-loops -fstrict-aliasing

#OPT3 = -Os -mbigtable -mnomacsave -fschedule-insns2 -fexpensive-optimizations -fomit-frame-pointer -fstrict-aliasing -ffast-math
#OPT4 = -DFRAME_POINTER -g3 -O0 -fno-eliminate-unused-debug-types
#KOS_CFLAGS += $(INC) $(OPT2)
KOS_CFLAGS = $(INC) -ml -m4-single-only -D_arch_dreamcast -D_arch_sub_pristine -D_SDL \
$(OPT2) \
-I$(KOS_BASE)/../../sh-elf/sh-elf/include -I$(KOS_BASE)/../kos-ports/include -I$(KOS_BASE)/include -I$(KOS_BASE)/kernel/arch/dreamcast/include -I$(KOS_BASE)/addons/include-I$(KOS_BASE)/include -I$(KOS_BASE)/addons/include -I$(KOS_BASE)/../kos-ports/include  -I$(KOS_BASE)/../kos-ports/include/zlib-1.2.3 -I$(KOS_BASE)/../kos-ports/SDL-1.2.9/include -I$(KOS_BASE)/../kos-ports/SDL_mixer-1.2.6/mikmod -I$(KOS_BASE)/../kos-ports/SDL_mixer-1.2.6 -I$(KOS_BASE)/../kos-ports/SDL_image-1.2.4 -I$(KOS_BASE)/../kos-ports/zlib-1.2.3 -I$(KOS_BASE)/../kos-ports/include/modplug


KOS_CPPFLAGS+= ${KOS_CFLAGS} $(INC)

TARGET = atomdc.elf

.PHONY: all all-before all-after clean clean-custom

all: all-before $(TARGET) all-after

include dreamcast.mak

OBJS = defendguin.o
   
   
include $(KOS_BASE)/Makefile.rules

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

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

$(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 -lmodplug -lSDL_mixer -ltremor -lSDL_image -lz_123  -lm -lSDL_129  -lstdc++ $(KOS_LIBS)
