# Copyright (C) 2004-2007 Tord Romstad

# This file is part of Glaurung.
#
# Glaurung 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 2 of the License, or
# (at your option) any later version.

# Glaurung 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 Glaurung; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA


# Files

EXE = glaurung

OBJS = bitboard.o color.o pawns.o material.o endgame.o evaluate.o main.o \
	misc.o move.o movegen.o history.o movepick.o search.o piece.o \
	position.o square.o direction.o tt.o value.o uci.o ucioption.o \
	mersenne.o book.o bitbase.o san.o test.o


# Rules

all: $(EXE) .depend

clean: 
	$(RM) *.o .depend glaurung

CXX = g++
CXXFLAGS = -O3 -g -DNDEBUG -funroll-loops -fomit-frame-pointer \
	-fstrict-aliasing -fno-exceptions -fno-rtti -Wall

# Use the following line for compiling a binary in debug mode:
#CXXFLAGS = -O3 -g -funroll-loops -fomit-frame-pointer -fstrict-aliasing \
	-fno-exceptions -fno-rtti -Wall 

# Use the following line for compiling a 32-bit PowerPC binary:
#CXXFLAGS = -O3 -DNDEBUG -funroll-loops -fomit-frame-pointer -fstrict-aliasing \
	-fno-exceptions -fno-rtti -Wall -arch ppc

LDFLAGS = -lm -lpthread

#LDFLAGS = -lm -lpthread -arch ppc


# Dependencies

$(EXE): $(OBJS)
	$(CXX) $(LDFLAGS) -o $@ $(OBJS)

.depend:
	$(CXX) -MM $(OBJS:.o=.cpp) > $@

include .depend
