#
# $Id: Makefile,v 1.4 2009-08-25 18:36:26 raimund Exp $
#
# Call 'make dep' first in order to create a dependencies file.
#
# Then call 'make protector' or simply 'make' in order to create
# the protector chess program.
#
# Rerun 'make dep' after adding new source files.
#
MAKEFILE_DEPEND = depend
MAKE = make
MAKEDEP = ccmakedep
COMPILER=ICC
#COMPILER=GCC
ifeq ($(COMPILER),ICC)
CC=icc
CPPC=icc -w0
LN=icc
CFLAGS = -ansi -O3 -mcpu=pentium4 -DNDEBUG -DTARGET_LINUX
CDFLAGS = -DICC
else
CC=gcc
CPPC=g++
LN=g++
CFLAGS = -O3 -Wall -Wunused -Wuninitialized -Wimplicit-function-declaration \
-Wmissing-prototypes -Wmissing-declarations -ansi -pedantic \
-Wno-long-long -DNDEBUG -DTARGET_LINUX
CDFLAGS =
endif
protectorobjects = protector.o bitboard.o position.o fen.o io.o \
movegeneration.o matesearch.o keytable.o hash.o test.o \
pgn.o tools.o search.o evaluation.o coordination.o \
xboard.o book.o tablebase.o
protectorsources = $(protectorobjects:.o=.c) egtb.cpp
.c.o:
$(CC) $(CFLAGS) $(CDFLAGS) -c $*.c
.cpp.o:
$(CPPC) -O3 -c $*.cpp
protector: $(protectorobjects) egtb.o
$(LN) -lstdc++ -lpthread -o protector $(protectorobjects) egtb.o -lm
sudo install ./protector /usr/games
install:
$(MAKE) clean
$(MAKE)
debug:
$(MAKE) clean
$(MAKE) protector CFLAGS='-DTRACE_EVAL'
test:
$(MAKE) clean
$(MAKE) protector CFLAGS='-DCHECK_EVAL'
time protector -m -e /home/heid/egtb
alltests:
$(MAKE) debug
time protector -m -t problems.pgn
easytests:
$(MAKE) debug
time protector -t easy.pgn -e /home/heid/egtb
hamming: hamming.o
$(CC) -O3 -Wall -ansi -o hamming hamming.o
.PHONY: dep
dep:
touch $(MAKEFILE_DEPEND)
$(MAKEDEP) $(CFLAGS) $(CDFLAGS) -cc $(CC) -f $(MAKEFILE_DEPEND) $(protectorsources)
rm depend.bak
.PHONY: clean
clean:
@rm -f *.o *.bak *.bin *.lrn game.* log.* *~ .#*
.PHONY: pretty
pretty:
indent -bad -bap -sob -npsl -npcs -bl -bli0 -i3 -ci3 -nut *.c *.h
DEPEND = $(shell test -r $(MAKEFILE_DEPEND) && echo "true")
ifeq ($(DEPEND),true)
include $(MAKEFILE_DEPEND)
endif