]> git.sesse.net Git - stockfish/blob - src/Makefile
Restore development versioning and LSN filtering
[stockfish] / src / Makefile
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
4
5 # This file is part of Stockfish.
6 #
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.
11 #
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.
16 #
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/>.
19
20
21 ###
22 ### Files
23 ###
24
25 EXE = stockfish
26
27 OBJS = bitboard.o color.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 square.o direction.o tt.o value.o uci.o ucioption.o \
30         mersenne.o book.o bitbase.o san.o benchmark.o
31
32
33 ###
34 ### Rules
35 ###
36
37 all: $(EXE) .depend
38
39 clean:
40         $(RM) *.o .depend glaurung
41
42
43 ###
44 ### Compiler:
45 ###
46
47 # CXX = g++
48 # CXX = g++-4.2
49 CXX = icpc
50
51
52 ###
53 ### Dependencies
54 ###
55
56 $(EXE): $(OBJS)
57         $(CXX) $(LDFLAGS) -o $@ $(OBJS)
58
59 .depend:
60         $(CXX) -MM $(OBJS:.o=.cpp) > $@
61
62 include .depend
63
64
65 ###
66 ### Compiler and linker switches
67 ###
68
69 # Enable/disable debugging:
70
71 CXXFLAGS += -DNDEBUG
72
73
74 # Compile with full warnings, and symbol names
75
76 CXXFLAGS += -Wall -g
77
78
79 # General optimization flags.  Note that -O2 might be faster than -O3 on some
80 # systems; this requires testing.
81
82 CXXFLAGS += -O3 -fno-exceptions -fomit-frame-pointer -fno-rtti -fno-strict-aliasing
83
84 # Disable most annoying warnings for the Intel C++ compiler
85
86 CXXFLAGS += -wd383,869,981
87
88
89 # Compiler optimization flags for the Intel C++ compiler in Mac OS X:
90
91 # CXXFLAGS += -mdynamic-no-pic -no-prec-div -ipo -static -xP
92
93
94 # Profiler guided optimization with the Intel C++ compiler.  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 ./glaurung bench 128 1, and
98 # wait 15 minutes for the benchmark to complete).  Then do a 'make clean', and
99 # recompile with -prof_use.
100
101 # CXXFLAGS += -prof_gen -prof_dir profdata
102 # CXXFLAGS += -prof_use -prof_dir ./profdata
103
104
105 # Profiler guided optimization with GCC.  I've never been able to make this
106 # work.
107
108 # CXXFLAGS += -fprofile-generate
109 # LDFLAGS += -fprofile-generate
110 # CXXFLAGS += -fprofile-use
111 # CXXFLAGS += -fprofile-use
112
113
114 # General linker flags
115
116 LDFLAGS += -lm -lpthread
117
118
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.
122
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
131
132
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.
135
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
141
142
143 # Backwards compatibility with Mac OS X 10.4 when compiling with ICC.  Doesn't
144 # work yet. :-(
145
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