# Makefile pour les exemples du tutoriel d'OpenGL ...

INCPATH = -I /usr/local/include -I /usr/X11R6/include
LIBPATH = -L /usr/local/lib -L /usr/X11R6/lib
LIBRARY = -lglut -lGLU -lGL -lX11 -lXext -lXi -lXmu -lm -ljpeg

CFLAGS = $(INCPATH)
LDFALGS = $(LIBPATH) $(LIBRARY)
GCC=/usr/bin/gcc



%.o:%.cpp
	$(GCC) $(CFLAGS) -o $@ -c $<

%:%.o %.cpp
	$(GCC) $(LDFALGS) -o $@ $<


all: deleteexe exceptions engine items logging math terrains textures MainApp.o main

mrproper: all clean1

exceptions: Exceptions/Exceptions.o

engine: Engine/OpenGLEngine.o Engine/Camera.o Engine/Avatar.o

items: Items/BaseItem.o Items/Crate.o Items/PalmTree.o

logging: Logging/BaseLogger.o Logging/FileLogger.o

math: Math/Math.o

terrains: Terrains/BaseTerrain.o Terrains/DemoTerrain.o Terrains/Tile.o

textures: Textures/BaseTextureManager.o Textures/DemoTextureManager.o Textures/texjpeg.o

main:
	$(GCC) $(LDFALGS) -o $@ *.o Exceptions/*.o Engine/*.o Items/*.o Logging/*.o Math/*.o  Terrains/*.o Textures/*.o

deleteexe:
	rm -f ./main

# cette commande permet de supprimer tous les objets et l'executable
clean1:
	rm -rf ./*.o Exceptions/*.o Engine/*.o Items/*.o Logging/*.o Math/*.o Terrains/*.o Textures/*.o
	rm -rf *~ Exceptions/*~ Engine/*~ Items/*~ Logging/*~ Math/*~  Terrains/*~ Textures/*~

clean: deleteexe clean1
