1 # Glaurung, a UCI chess playing engine.
2 # Copyright (C) 2004-2007 Tord Romstad
4 # This file is part of Glaurung.
6 # Glaurung is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation, either version 3 of the License, or
9 # (at your option) any later version.
11 # Glaurung is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program. If not, see <http://www.gnu.org/licenses/>.
26 OBJS = bitboard.o color.o pawns.o material.o endgame.o evaluate.o main.o \
27 misc.o move.o movegen.o history.o movepick.o search.o piece.o \
28 position.o square.o direction.o tt.o value.o uci.o ucioption.o \
29 mersenne.o book.o bitbase.o san.o benchmark.o
39 $(RM) *.o .depend glaurung
56 $(CXX) $(LDFLAGS) -o $@ $(OBJS)
59 $(CXX) -MM $(OBJS:.o=.cpp) > $@
65 ### Compiler and linker switches
68 # Enable/disable debugging:
73 # Compile with full warnings, and symbol names
78 # General optimization flags. Note that -O2 might be faster than -O3 on some
79 # systems; this requires testing.
81 CXXFLAGS += -O3 -fno-exceptions -fomit-frame-pointer -fno-rtti -fno-strict-aliasing
83 # Disable most annoying warnings for the Intel C++ compiler
85 CXXFLAGS += -wd383,869,981
88 # Compiler optimization flags for the Intel C++ compiler in Mac OS X:
90 # CXXFLAGS += -mdynamic-no-pic -no-prec-div -ipo -static -xP
93 # Profiler guided optimization with the Intel C++ compiler. To use it, first
94 # create the directory ./profdata if it does not already exist, and delete its
95 # contents if it does exist. Then compile with -prof_gen, and run the
96 # resulting binary for a while (for instance, do ./glaurung bench 128 1, and
97 # wait 15 minutes for the benchmark to complete). Then do a 'make clean', and
98 # recompile with -prof_use.
100 # CXXFLAGS += -prof_gen -prof_dir profdata
101 # CXXFLAGS += -prof_use -prof_dir ./profdata
104 # Profiler guided optimization with GCC. I've never been able to make this
107 # CXXFLAGS += -fprofile-generate
108 # LDFLAGS += -fprofile-generate
109 # CXXFLAGS += -fprofile-use
110 # CXXFLAGS += -fprofile-use
113 # General linker flags
115 LDFLAGS += -lm -lpthread
118 # Compiler switches for generating binaries for various CPUs in Mac OS X.
119 # Note that 'arch ppc' and 'arch ppc64' only works with g++, and not with
120 # the intel compiler.
122 # CXXFLAGS += -arch ppc
123 # CXXFLAGS += -arch ppc64
124 # CXXFLAGS += -arch i386
125 # CXXFLAGS += -arch x86_64
126 # LDFLAGS += -arch ppc
127 # LDFLAGS += -arch ppc64
128 # LDFLAGS += -arch i386
129 # LDFLAGS += -arch x86_64
132 # Backwards compatibility with Mac OS X 10.4 when compiling under 10.5 with
133 # GCC 4.0. I haven't found a way to make it work with GCC 4.2.
135 # CXXFLAGS += -isysroot /Developer/SDKs/MacOSX10.4u.sdk
136 # CXXFLAGS += -mmacosx-version-min=10.4
137 # LDFLAGS += -isysroot /Developer/SDKs/MacOSX10.4u.sdk
138 # LDFLAGS += -Wl,-syslibroot /Developer/SDKs/MacOSX10.4u.sdk
139 # LDFLAGS += -mmacosx-version-min=10.4
142 # Backwards compatibility with Mac OS X 10.4 when compiling with ICC. Doesn't
145 # CXXFLAGS += -DMAC_OS_X_VERSION_MIN_REQUIRED=1040
146 # CXXFLAGS += -DMAC_OS_X_VERSION_MAX_ALLOWED=1040
147 # CXXFLAGS += -D__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__=1040
148 # CXXFLAGS += -F/Developer/SDKs/MacOSX10.4u.sdk/
149 # LDFLAGS += -Wl,-syslibroot -Wl,/Developer/SDKs/MacOSX10.4u.sdk