################################################################################
#
#
#

objext = .o
dllext = .dll

AS = nasm -f gnuwin32
CC = gcc
SHARED = dllwrap --def ../def/plugin.Windows.def

CFLAGS = -O1 -fomit-frame-pointer -Wall

#
################################################################################
#
#
#

OBJDIR = obj

OBJ_PLUGIN =	$(OBJDIR)/rbpse_cpu$(objext)		\
				$(OBJDIR)/hardware$(objext)			\
				$(OBJDIR)/memory$(objext)

#
#				dyn$(objext) dyn_2$(objext) dma$(objext) bios$(objext) \
#				rcnt$(objext) irq$(objext) timing$(objext) hlecore$(objext) \
#				event$(objext) jmp$(objext) cop0$(objext) libetc_psx$(objext) \
#				libetc_hle$(objext) libetc_hle_main$(objext)
#
################################################################################
#
#
#

all: rbpse_cpu$(dllext)

rbpse_cpu$(dllext): $(OBJ_PLUGIN)
	$(SHARED) -o $@ $(OBJ_PLUGIN)

$(OBJDIR)/%$(objext): %.c
	$(CC) $(CFLAGS) -S -I../include -o $@.S $<
	$(CC) $(CFLAGS) -c -I../include -o $@ $<

$(OBJDIR)/%$(objext): %.asm
	$(AS) -o $@ $<

clean:
	rm -f rbpse_cpu$(dllext)
	rm -f $(OBJ_PLUGIN)

#
################################################################################
