#
# Makefile.cfg for SRB2/Dreamcast
#

#include $(KOS_BASE)/Makefile.rules

#
#hmmm, the Dreamcast
#

	HOSTCC:=$(CC)
	CC=$(KOS_CC)
	PREFIX=$(KOS_CC_BASE)/bin/$(KOS_CC_PREFIX)
	OBJDUMP=$(PREFIX)-objdump
	OBJCOPY=$(PREFIX)-objcopy

	#NOHW=1      #No working MiniGL right now
	NOHS=1      #No HWSound right now
ifndef LWIP
	NONET=1     #No LWIP
endif
	#i_net_o=$(OBJDIR)/i_udp.o #use KOS's UDP
	#NOMIXER=1  #Basic sound only
	NOIPX=1    #No IPX network code
	NOPNG=1    #No Screenshot

	OPTS=$(KOS_CFLAGS) -DUNIXCOMMON -DDC
ifndef NOHW
	OPTS+=-DSTATIC_OPENGL -DMINI_GL_COMPATIBILITY -DKOS_GL_COMPATIBILITY
endif
	SDL_CFLAGS?=-I$(KOS_BASE)/addons/include/SDL
	SDL_LDFLAGS?=-lSDL
	LDFLAGS=$(KOS_LDFLAGS)
	LIBS:=$(KOS_LIBS) -lconio -lm
ifndef NOMIXER
	LIBS:=-loggvorbisplay -lSDL $(LIBS)
endif

ifdef LWIP
	OPTS+=-I$(KOS_BASE)/../kos-ports/lwip/kos/include -I$(KOS_BASE)/../kos-ports/lwip/lwip/src/include/ipv4 -I$(KOS_BASE)/../kos-ports/lwip/lwip/src/include -DIPv4
	LIBS:=-llwip4 -lkosutils $(LIBS)
	OPTS+=-DHAVE_LWIP
endif
ifndef NOHW
	LIBS+=-lgl
endif

	i_system_o+=$(OBJDIR)/dchelp.o
	i_main_o=$(KOS_START) $(OBJDIR)/i_main.o $(OBJEXTRA)

	# name of the exefile
	EXENAME?=SRB2.elf
	BINNAME?=SRB2.BIN
