File: Makefile

package info (click to toggle)
glaurung 2.2-3
  • links: PTS
  • area: main
  • in suites: bullseye, sid
  • size: 864 kB
  • sloc: cpp: 10,271; makefile: 62
file content (145 lines) | stat: -rw-r--r-- 3,729 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# Glaurung, a UCI chess playing engine.
# Copyright (C) 2004-2007 Tord Romstad

# This file is part of Glaurung.
#
# Glaurung is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Glaurung is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.


###
### Files
###

EXE = glaurung

OBJS = bitboard.o color.o pawns.o material.o endgame.o evaluate.o main.o \
	misc.o move.o movegen.o history.o movepick.o search.o piece.o \
	position.o square.o direction.o tt.o value.o uci.o ucioption.o \
	mersenne.o book.o bitbase.o san.o benchmark.o


###
### Rules
###

all: $(EXE) .depend

clean: 
	$(RM) *.o .depend glaurung


###
### Compiler:
###

CXX = g++
# CXX = g++-4.2
# CXX = icpc


###
### Dependencies
###

$(EXE): $(OBJS)
	$(CXX) $(LDFLAGS) -o $@ $(OBJS) -pthread

.depend:
	$(CXX) -MM $(OBJS:.o=.cpp) > $@

include .depend


###
### Compiler and linker switches
###

# Enable/disable debugging:

CXXFLAGS += -DNDEBUG


# Compile with full warnings, and symbol names

CXXFLAGS += -Wall -g


# General optimization flags.  Note that -O2 might be faster than -O3 on some
# systems; this requires testing.

CXXFLAGS += -O3 -fno-exceptions -fomit-frame-pointer -fno-rtti -fstrict-aliasing


# Compiler optimization flags for the Intel C++ compiler in Mac OS X:

# CXXFLAGS += -mdynamic-no-pic -no-prec-div -ipo -static -xP


# Profiler guided optimization with the Intel C++ compiler.  To use it, first
# create the directory ./profdata if it does not already exist, and delete its
# contents if it does exist.  Then compile with -prof_gen, and run the 
# resulting binary for a while (for instance, do ./glaurung bench 128 1, and
# wait 15 minutes for the benchmark to complete).  Then do a 'make clean', and 
# recompile with -prof_use.

# CXXFLAGS += -prof_gen -prof_dir ./profdata
# CXXFLAGS += -prof_use -prof_dir ./profdata


# Profiler guided optimization with GCC.  I've never been able to make this 
# work.

# CXXFLAGS += -fprofile-generate
# LDFLAGS += -fprofile-generate
# CXXFLAGS += -fprofile-use
# CXXFLAGS += -fprofile-use


# General linker flags

LDFLAGS += -lm -lpthread


# Compiler switches for generating binaries for various CPUs in Mac OS X.
# Note that 'arch ppc' and 'arch ppc64' only works with g++, and not with
# the intel compiler.

# CXXFLAGS += -arch ppc
# CXXFLAGS += -arch ppc64
# CXXFLAGS += -arch i386
# CXXFLAGS += -arch x86_64
# LDFLAGS += -arch ppc
# LDFLAGS += -arch ppc64
# LDFLAGS += -arch i386
# LDFLAGS += -arch x86_64


# Backwards compatibility with Mac OS X 10.4 when compiling under 10.5 with 
# GCC 4.0.  I haven't found a way to make it work with GCC 4.2.

# CXXFLAGS += -isysroot /Developer/SDKs/MacOSX10.4u.sdk
# CXXFLAGS += -mmacosx-version-min=10.4
# LDFLAGS += -isysroot /Developer/SDKs/MacOSX10.4u.sdk
# LDFLAGS += -Wl,-syslibroot /Developer/SDKs/MacOSX10.4u.sdk
# LDFLAGS += -mmacosx-version-min=10.4


# Backwards compatibility with Mac OS X 10.4 when compiling with ICC.  Doesn't
# work yet. :-(

# CXXFLAGS += -DMAC_OS_X_VERSION_MIN_REQUIRED=1040
# CXXFLAGS += -DMAC_OS_X_VERSION_MAX_ALLOWED=1040
# CXXFLAGS += -D__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__=1040
# CXXFLAGS += -F/Developer/SDKs/MacOSX10.4u.sdk/
# LDFLAGS += -Wl,-syslibroot -Wl,/Developer/SDKs/MacOSX10.4u.sdk