CFLAGS = -O3 `sdl-config --cflags` -Iinclude/ -fno-exceptions
#CFLAGS = -g `sdl-config --cflags` -Iinclude/ -fno-exceptions
LIBS = `sdl-config --libs` -lSDL_ttf -lSDL_image
OBJFILES = \
main.o \
connection.o \
connectable.o \
SDL_gfxPrimitives.o \
Game/Bullet.o \
Game/Path.o \
Game/Unit.o \
Game/UnitGroup.o \
Game/Units/Marine.o \
Game/Units/Medic.o \
Game/Player.o \
Game/AStar.o \
Game/Map.o \
Game/Game.o \
Screens/Widget.o \
Screens/GameView/MapView.o \
Screens/GameView/GameView.o \
Screens/GameView/MiniMap.o \
Screens/GameView/Portrait.o \
Screens/GameView/Selection.o \
Screens/GameView/Panel.o \
Screens/GameView/Button.o \
Screens/GameView/FPS.o

all: scv2

scv2: $(OBJFILES)
	g++ -o scv2 $(OBJFILES) $(LIBS) -s
	#g++ -g -o scv2 $(OBJFILES) $(LIBS)

SDL_gfxPrimitives.o: SDL_gfxPrimitives.c
	g++ -o SDL_gfxPrimitives.o -c SDL_gfxPrimitives.c $(CFLAGS)
	#g++ -o -g SDL_gfxPrimitives.o -c SDL_gfxPrimitives.c $(CFLAGS)
	
%.o: %.cpp
	g++ -o $@ -c $< $(CFLAGS)
	
clean:
	rm -f Game/*.o
	rm -f Game/Units/*.o
	rm -f Screens/*.o
	rm -f Screens/GameView/*.o
	rm -f *.o
	rm -f scv2 scv2.exe
