#
#  xut - button soccer game
#  Copyright (C) 2008 farrer <farrer@coddart.com> and gushm <gushm@coddart.com>
#
#  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/

SUBSYSTEMS = etc sound gui lang physics engine

all: buildparts

standalone: buildparts
		@cd engine; make standalone;

buildparts: 
		@printf "Making XUT...\n"
		@for dir in ${SUBSYSTEMS}; do \
			(echo "Making $$dir";echo " ";cd $$dir; ${MAKE} all;echo " "); \
		done
		@printf "\e[0;32mAll Done.\e[0;0m\n"

clean:
	@printf "Cleaning XUT Bin Files..."	
	@for dir in $(SUBSYSTEMS);do \
	(cd $$dir; ${MAKE} clean); \
	done
	@printf "\e[0;32mDone.\e[0;0m\n"

