#Makefile GRAPHIC
#CXX  		=g++ -O3 -mpentium -Wall -DEMU64_DEBUG
CC		=gcc -O3 -fomit-frame-pointer -funroll-loops -ffast-math -fPIC -mcpu=pentium -pipe
#CC		=gcc -O3 -mpentium -Wall -g -pg
#CC 		=gcc -I/usr/X11R6/include -fPIC -pipe -g

OBJ		=Driver.o \
		crc_ucode.o \
		wingl.o \
		rdp.o \
		Combine.o \
		Texture.o \
		rdp_gl.o \
		lighting.o \
		Render.o \
		3dmath.o \
		hleGetMatrix.o \
		debug.o


all:	tr64.so


tr64.so:	$(OBJ)
		$(CXX) $(OBJ) -Wl,-Bsymbolic -nostart -lGL -lSDL -o tr64.so
		strip --strip-all tr64.so

hleGetMatrix.o:	hleGetMatrix.asm
		nasm -f elf -o hleGetMatrix.o hleGetMatrix.asm

clean:
	find . -name '*.o' -print0 | xargs -0r rm -f
	rm tr64.so
	
clean_jed:
	find . -name '*~' -print0 | xargs -0r rm -f
