# _____     ___ ____     ___ ____
#  ____|   |    ____|   |        | |____|
# |     ___|   |____ ___|    ____| |    \    PS2DEV Open Source Project.
#-----------------------------------------------------------------------
# Copyright 2001-2004, ps2dev - http://www.ps2dev.org
# Licenced under Academic Free License version 2.0
# Review ps2sdk README & LICENSE files for further details.
#


# ROMFS needed stuff !
# ----------------------------------------------------------------------


EE_INCS   += -I$(PS2SDK)/ports/include/

EE_LIBS   += -L$(PS2SDK)/ports/lib -lromfs

# ROMFS substitutions... :)
EE_CFLAGS += -Dfopen=ropen
EE_CFLAGS += -Dfclose=rclose
EE_CFLAGS += -Dfread=rread
EE_CFLAGS += -Dfwrite=rwrite
EE_CFLAGS += -Dfseek=rseek
EE_CFLAGS += -Dftell=rtell
EE_CFLAGS += -Dfgetc=rgetc
EE_CFLAGS += -Dfgets=rgets
EE_CFLAGS += -Dmmap=rmmap

GENROMFS_PATH = $(PS2SDK)/bin
GENROMFS = $(GENROMFS_PATH)/genromfs

#
# Defs
#

EE_OBJS += romdisk.o
	
romdisk.img:
	@echo Creating romdisk..
	@$(GENROMFS) -f $@ -d romdisk

romdisk.o: romdisk.img
	@$(PS2SDK)/bin/bin2o -a 16 -n romdisk.img romdisk.o romdisk

