MAIN_OBJS = main.o gfx.o math.o misc.o miscasm.o pad.o texture.o tinyJpeg.o vu.o mod.o amigamod_rpc.o
EFFECT_OBJS = e_particles.o e_particles_vu.o e_spheremod.o e_spheremod_vu.o e_rotozoom.o e_rotozoom_vu.o
DATA_OBJS = particle.o particle_text.o particle_text2.o e_rotozoom_img.o font2.o font2_alpha.o ss.o

EE_BIN = test.elf
EE_OBJS =  $(MAIN_OBJS) $(EFFECT_OBJS) $(DATA_OBJS)

EE_LIBS = -lpad

.SUFFIXES: .c .s .vsm .o .pcx .jpg .raw .elf .asm

.pcx.s:
	./rawtoasm $< $@ $@
.jpg.s:
	./rawtoasm $< $@ $@
.raw.s:
	./rawtoasm $< $@ $@	
.bin.s:
	./rawtoasm $< $@ $@
.vsm.o:
	ee-dvp-as.exe -g $< -o $@ 2>&1 | Gcc2MS
		
all: $(EE_BIN)
	ee-objcopy -Sx -I elf32-littlemips -O binary e_rotozoom_vu.o e_rotozoom_vu.bin
	ee-objcopy -Sx -I elf32-littlemips -O binary e_spheremod_vu.o e_spheremod_vu.bin

clean:
	if exist *.elf del /q /f *.elf 
	if exist *.o del /q /f *.o 
	if exist *.bin del /q /f *.bin	
	if exist debug\*.* del /s /q /f debug
	if exist debug rmdir debug	

rebuild: clean $(EE_BIN)

include $(PS2LIB)/Makefile.pref
include $(PS2LIB)/Makefile.eeglobal