#
#  xut - button soccer game
#  Copyright (C) 2008 farrer <farrer@dnteam.org> and gushm <gushm@dnteam.org>
#
#  This file is part of xut.
#
#  xut is free software: you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation, either version 3 of the License, or
#  (at your option) any later version.
#
#  xut is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with xut.  If not, see <http://www.gnu.org/licenses/>.
#
#

prefix = /usr/local
datadir = ${prefix}/share
localedir = $(datadir)/locale
DEFS = -DLOCALEDIR=\"$(localedir)\"

CFLAGS =  -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT $(DEFS) -g -c -Wall -O2
CC = g++
EFLAGS =  -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT
LDFLAGS = 
LIBS = -lvorbisfile -lvorbis -lopenal -logg -lcal3d -lm -lSDL_ttf -lSDL_image -lSDL -lGLU -lGL  -lSDL -lpthread -L$(prefix)/lib/ 

BIN = ../bin/

all: animodel.o cursor.o defparser.o dirs.o draw.o options.o overlaps.o userinfo.o util.o

animodel.o: animodel.cpp animodel.h defparser.h draw.h
	@printf "Making animodel.o... "
	@$(CC) $(CFLAGS) animodel.cpp -o animodel.o
	@printf "\e[0;32mDone.\e[0;0m\n"

cursor.o: cursor.cpp cursor.h options.h
	@printf "Making cursor.o... "
	@$(CC) $(CFLAGS) cursor.cpp -o cursor.o
	@printf "\e[0;32mDone.\e[0;0m\n"

defparser.o: defparser.cpp defparser.h
	@printf "Making defparser.o... "
	@$(CC) $(CFLAGS) defparser.cpp -o defparser.o
	@printf "\e[0;32mDone.\e[0;0m\n"

dirs.o: dirs.cpp dirs.h
	@printf "Making dirs.o... "
	@$(CC) $(CFLAGS) dirs.cpp -o dirs.o
	@printf "\e[0;32mDone.\e[0;0m\n"

draw.o: draw.cpp draw.h options.h
	@printf "Making draw.o... "
	@$(CC) $(CFLAGS) draw.cpp -o draw.o
	@printf "\e[0;32mDone.\e[0;0m\n"

options.o: options.cpp options.h $(ENDETC)defparser.h $(ENDETC)userinfo.h
	@printf "Making options.o... "
	@$(CC) $(CFLAGS) options.cpp -o options.o
	@printf "\e[0;32mDone.\e[0;0m\n"

overlaps.o: overlaps.cpp overlaps.h
	@printf "Making overlaps.o... "
	@$(CC) $(CFLAGS) overlaps.cpp -o overlaps.o
	@printf "\e[0;32mDone.\e[0;0m\n"

userinfo.o: userinfo.cpp userinfo.h
	@printf "Making userinfo.o... "
	@$(CC) $(CFLAGS) userinfo.cpp -o userinfo.o
	@printf "\e[0;32mDone.\e[0;0m\n"

util.o: util.cpp util.h
	@printf "Making util.o... "
	@$(CC) $(CFLAGS) util.cpp -o util.o
	@printf "\e[0;32mDone.\e[0;0m\n"

clean:
	@printf "Cleaning XUT etc Files..."	
	@\rm -rf *.o *.e
	@printf "\e[0;32mDone.\e[0;0m\n"

