1 # Stockfish, a UCI chess playing engine derived from Glaurung 2.1
2 # Copyright (C) 2004-2007 Tord Romstad
3 # Copyright (C) 2008 Marco Costalba
5 # This file is part of Stockfish.
7 # Stockfish is free software: you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation, either version 3 of the License, or
10 # (at your option) any later version.
12 # Stockfish is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program. If not, see <http://www.gnu.org/licenses/>.
21 ### Executable name. Do not change
25 ### ==========================================================================
26 ### Compiler speed switches for both GCC and ICC. These settings are generally
27 ### fast on a broad range of systems, but may be changed experimentally
28 ### ==========================================================================
33 ### ==========================================================================
34 ### Enable/disable debugging, disabled by default
35 ### ==========================================================================
40 ### ==========================================================================
41 ### Run built-in benchmark for pgo-builds with: 32MB hash 1 thread 10 depth
42 ### These settings are generally fast, but may be changed experimentally
43 ### ==========================================================================
44 PGOBENCH = ./$(EXE) bench 32 1 10 default depth
47 ### General compiler settings. Do not change
48 GCCFLAGS += -g -Wall -fno-exceptions -fno-rtti -fno-strict-aliasing
49 ICCFLAGS += -g -Wall -fno-exceptions -fno-rtti -fno-strict-aliasing -wd383,869,981,10187,10188,11505,11503
52 ### General linker settings. Do not change
56 ### Object files. Do not change
57 OBJS = application.o bitboard.o pawns.o material.o endgame.o evaluate.o main.o \
58 misc.o move.o movegen.o history.o movepick.o search.o piece.o \
59 position.o direction.o tt.o value.o uci.o ucioption.o \
60 mersenne.o book.o bitbase.o san.o benchmark.o
63 ### General rules. Do not change
69 @echo "Makefile options:"
71 @echo "make > Default: Compiler = g++"
72 @echo "make icc > Compiler = icpc"
73 @echo "make icc-profile > Compiler = icpc + automatic pgo-build"
74 @echo "make osx-ppc32 > PPC-Mac OS X 32 bit. Compiler = g++"
75 @echo "make osx-ppc64 > PPC-Mac OS X 64 bit. Compiler = g++"
76 @echo "make osx-x86 > x86-Mac OS X 32 bit. Compiler = g++"
77 @echo "make osx-x86_64 > x86-Mac OS X 64 bit. Compiler = g++"
78 @echo "make strip > Strip executable"
79 @echo "make clean > Clean up"
85 $(RM) *.o .depend *~ $(EXE)
88 ### Possible targets. You may add your own ones here
92 CXXFLAGS="$(GCCFLAGS)" \
98 CXXFLAGS="$(ICCFLAGS)" \
104 CXXFLAGS="$(ICCFLAGS)" \
105 CXXFLAGS+='-prof-gen=srcpos -prof_dir ./profdir' \
111 CXXFLAGS="$(ICCFLAGS)" \
112 CXXFLAGS+='-prof_use -prof_dir ./profdir' \
119 $(MAKE) icc-profile-make
121 @echo "Running benchmark for pgo-build ..."
122 @$(PGOBENCH) > /dev/null
123 @echo "Benchmark finished. Build final executable now ..."
126 $(MAKE) icc-profile-use
127 @rm -rf profdir bench.txt
132 CXXFLAGS="$(GCCFLAGS)" \
133 CXXFLAGS+='-arch ppc' \
134 LDFLAGS+='-arch ppc' \
140 CXXFLAGS="$(GCCFLAGS)" \
141 CXXFLAGS+='-arch ppc64' \
142 LDFLAGS+='-arch ppc64' \
148 CXXFLAGS="$(GCCFLAGS)" \
149 CXXFLAGS+='-arch i386' \
150 LDFLAGS+='-arch i386' \
156 CXXFLAGS="$(GCCFLAGS)" \
157 CXXFLAGS+='-arch x86_64' \
158 LDFLAGS+='-arch x86_64' \
165 ### Compilation. Do not change
167 $(CXX) $(LDFLAGS) -o $@ $(OBJS)
170 ### Dependencies. Do not change
172 $(CXX) -MM $(OBJS:.o=.cpp) > $@