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/>.
27 OBJS = application.o bitboard.o pawns.o material.o endgame.o evaluate.o main.o \
28 misc.o move.o movegen.o history.o movepick.o search.o piece.o \
29 position.o direction.o tt.o value.o uci.o ucioption.o \
30 mersenne.o book.o bitbase.o san.o benchmark.o
40 $(RM) *.o .depend stockfish
56 $(CXX) $(LDFLAGS) -o $@ $(OBJS)
59 $(CXX) -MM $(OBJS:.o=.cpp) > $@
65 ### Compiler and linker switches
68 # Enable/disable debugging, disabled by default
73 # Compile with full warnings, and symbol names stripped, you can use
74 # -g instead of -s to compile symbol's table in, useful for debugging.
79 # General optimization flags. Note that -O2 might be faster than -O3 on some
80 # systems; this requires testing.
82 CXXFLAGS += -O3 -fno-exceptions -fno-rtti -fno-strict-aliasing
84 # Disable most annoying warnings for the Intel C++ compiler
86 # CXXFLAGS += -wd383,869,981
89 # Compiler optimization flags for the Intel C++ compiler in Mac OS X:
91 # CXXFLAGS += -mdynamic-no-pic -no-prec-div -ipo -static -xP
94 # Profiler guided optimization with the Intel C++ compiler v11. To use it, first
95 # create the directory ./profdata if it does not already exist, and delete its
96 # contents if it does exist. Then compile with -prof_gen, and run the
97 # resulting binary for a while (for instance, do ./stockfish bench 128 1, and
98 # wait 15 minutes for the benchmark to complete). Then do a 'make clean', and
99 # recompile with -prof_use.
101 # CXXFLAGS += -prof-gen -prof-dir./profdata
102 # CXXFLAGS += -prof-use -ipo -prof_dir./profdata
105 # Profiler guided optimization with GCC. I've never been able to make this
108 # CXXFLAGS += -fprofile-generate
109 # LDFLAGS += -fprofile-generate
110 # CXXFLAGS += -fprofile-use
111 # CXXFLAGS += -fprofile-use
114 # General linker flags
116 LDFLAGS += -lm -lpthread
119 # Compiler switches for generating binaries for various CPUs in Mac OS X.
120 # Note that 'arch ppc' and 'arch ppc64' only works with g++, and not with
121 # the intel compiler.
123 # CXXFLAGS += -arch ppc
124 # CXXFLAGS += -arch ppc64
125 # CXXFLAGS += -arch i386
126 # CXXFLAGS += -arch x86_64
127 # LDFLAGS += -arch ppc
128 # LDFLAGS += -arch ppc64
129 # LDFLAGS += -arch i386
130 # LDFLAGS += -arch x86_64
133 # Backwards compatibility with Mac OS X 10.4 when compiling under 10.5 with
134 # GCC 4.0. I haven't found a way to make it work with GCC 4.2.
136 # CXXFLAGS += -isysroot /Developer/SDKs/MacOSX10.4u.sdk
137 # CXXFLAGS += -mmacosx-version-min=10.4
138 # LDFLAGS += -isysroot /Developer/SDKs/MacOSX10.4u.sdk
139 # LDFLAGS += -Wl,-syslibroot /Developer/SDKs/MacOSX10.4u.sdk
140 # LDFLAGS += -mmacosx-version-min=10.4
143 # Backwards compatibility with Mac OS X 10.4 when compiling with ICC. Doesn't
146 # CXXFLAGS += -DMAC_OS_X_VERSION_MIN_REQUIRED=1040
147 # CXXFLAGS += -DMAC_OS_X_VERSION_MAX_ALLOWED=1040
148 # CXXFLAGS += -D__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__=1040
149 # CXXFLAGS += -F/Developer/SDKs/MacOSX10.4u.sdk/
150 # LDFLAGS += -Wl,-syslibroot -Wl,/Developer/SDKs/MacOSX10.4u.sdk