LIBS = -lGL -lGLU -lglut -lm -lXmu -lX11 -lXi -L/usr/X11R6/lib
#knihovny ke slinkovani

EXT_OVERRIDE0 = -DGL_VERSION_1_4 -DGL_ARB_vertex_program -DGL_ARB_fragment_program -DGL_ARB_texture_compression
EXT_OVERRIDE1 = -DGL_VERSION_1_5 -DGL_EXT_bindable_uniform -DGL_APPLE_flush_buffer_range -DGL_NV_transform_feedback
EXT_OVERRIDE2 = -DGL_NV_fence -DGL_EXT_blend_minmax -DGL_ARB_vertex_buffer_object -DGL_EXT_compiled_vertex_array
EXT_OVERRIDE = $(EXT_OVERRIDE0) $(EXT_OVERRIDE1) $(EXT_OVERRIDE2) -DGL_ARB_occlusion_query
# tyhle extensions nejsou v gl.h, ale jsou k programu prilinkovane ... musime je disablovat aby se to nebilo

SRCS0 = BitArray.cpp BitmapFont.cpp CallStack.cpp DCT.cpp Dir.cpp FontTexture.cpp Hash.cpp Jpeg.cpp JpegEnc.cpp Load_3ds.cpp
SRCS1 = Mersene.cpp OpenGL20.cpp OpenGLState.cpp RenderBuffer2.cpp Shader2.cpp ShaderSys.cpp Socket.cpp Texture.cpp Tga.cpp
SRCS = $(SRCS0) $(SRCS1) Timer.cpp Unicode.cpp Vector.cpp VertexBufferObject.cpp
# zdrojove soubory

OBJS0 = BitArray.o BitmapFont.o CallStack.o DCT.o Dir.o FontTexture.o Hash.o Jpeg.o JpegEnc.o Load_3ds.o
OBJS1 = Mersene.o OpenGL20.o OpenGLState.o RenderBuffer2.o Shader2.o ShaderSys.o Socket.o Texture.o Tga.o
OBJS = $(OBJS0) $(OBJS1) Timer.o Unicode.o Vector.o VertexBufferObject.o
# cilove soubory

all: $(OBJS)

OpenGL20.o: OpenGL20.cpp
	g++ -ansi -W -Wall -pedantic $(EXT_OVERRIDE) -o OpenGL20.o -c OpenGL20.cpp

BitArray.o: BitArray.cpp
	g++ -ansi -W -Wall -pedantic -o BitArray.o -c BitArray.cpp

BitmapFont.o: BitmapFont.cpp
	g++ -ansi -W -Wall -pedantic -D__int32=long -o BitmapFont.o -c BitmapFont.cpp

CallStack.o: CallStack.cpp
	g++ -ansi -W -Wall -pedantic -o CallStack.o -c CallStack.cpp

DCT.o: DCT.cpp
	g++ -ansi -W -Wall -pedantic -o DCT.o -c DCT.cpp

Dir.o: Dir.cpp
	g++ -ansi -W -Wall -pedantic -o Dir.o -c Dir.cpp

FontTexture.o: FontTexture.cpp
	g++ -ansi -W -Wall -pedantic -D__int32=long -o FontTexture.o -c FontTexture.cpp

Hash.o: Hash.cpp
	g++ -ansi -W -Wall -pedantic -D__int32=long -o Hash.o -c Hash.cpp

Jpeg.o: Jpeg.cpp
	g++ -ansi -D__int32=long -D__fastcall=  -o Jpeg.o -c Jpeg.cpp

JpegEnc.o: JpegEnc.cpp
	g++ -ansi -W -Wall -pedantic -D__int32=long -D__fastcall=  -o JpegEnc.o -c JpegEnc.cpp

Load_3ds.o: Load_3ds.cpp
	g++ -ansi -pedantic -o Load_3ds.o -c Load_3ds.cpp

Mersene.o: Mersene.cpp
	g++ -ansi -pedantic -o Mersene.o -c Mersene.cpp

OpenGLState.o: OpenGLState.cpp
	g++ -ansi -W -Wall -pedantic -o OpenGLState.o -c OpenGLState.cpp

RenderBuffer2.o: RenderBuffer2.cpp
	g++ -ansi -W -Wall -pedantic -o RenderBuffer2.o -c RenderBuffer2.cpp

Shader2.o: Shader2.cpp
	g++ -ansi -pedantic -o Shader2.o -c Shader2.cpp

ShaderSys.o: ShaderSys.cpp
	g++ -ansi -pedantic -o ShaderSys.o -c ShaderSys.cpp

Socket.o: Socket.cpp
	g++ -ansi -W -Wall -pedantic -o Socket.o -c Socket.cpp

Texture.o: Texture.cpp
	g++ -ansi -W -Wall -pedantic -o Texture.o -c Texture.cpp

Tga.o: Tga.cpp
	g++ -ansi -W -Wall -pedantic -D__int32=long -o Tga.o -c Tga.cpp

Timer.o: Timer.cpp
	g++ -ansi -W -Wall -pedantic -o Timer.o -c Timer.cpp

Unicode.o: Unicode.cpp
	g++ -ansi -W -Wall -pedantic -o Unicode.o -c Unicode.cpp

Vector.o: Vector.cpp
	g++ -ansi -W -Wall -pedantic -o Vector.o -c Vector.cpp

VertexBufferObject.o: VertexBufferObject.cpp
	g++ -ansi -W -Wall -pedantic -o VertexBufferObject.o -c VertexBufferObject.cpp

clean:
	rm -f *.o

archive:
	zip LinuxLame.zip *.cpp *.h *.inl Makefile

