forked from GuardianOfKnowledge/scid
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.conf
346 lines (282 loc) · 11.6 KB
/
Makefile.conf
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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
! Makefile.conf
! Makefile template for Scid for Unix operating systems.
!
! This file is NOT an actual Makefile; it is a template file used by
! the configure program to produce the actual Makefile for Scid with
! approriate settings for your system. Just type "./configure" in the
! current directory to run the configuration program.
!
! All lines starting with "!" (such as these) are removed, and certain
! variables enclosed in "@" symbols (such as @TCL_VERSION@) are set.
!
##### Makefile for Scid for Unix operating systems.
### Compiler: Most Unix systems use g++ for compiling and linking.
#
COMPILE = @COMPILE@
LINK = @LINK@
INSTALL = @INSTALL@
# BINDIR: where the Scid programs are copied for "make install".
#
BINDIR = @BINDIR@
# SHAREDIR: where scid.eco is copied for "make install".
#
SHAREDIR = @SHAREDIR@
### TCL_VERSION: Set this according to the version of Tcl/Tk you have
# installed that you want Scid to use: 8.0, 8.1, 8.2, 8.3, etc.
#
TCL_VERSION = @TCL_VERSION@
# TCL_INCLUDE, TCL_LIBRARY: these are the compiler options
# needed for linking Scid with Tcl/Tk. The program "./configure"
# will try to determine them automatically, but if it cannot, you
# can use the examples below for help in setting these variables.
#
# @CONFIG_RESULT@
#
TCL_INCLUDE = @TCL_INCLUDE@
TCL_LIBRARY = @TCL_LIBRARY@
########################################
### Compiler options:
### TB: Using Nalimov tablebases with Scid. Use "TB = -DSCID_USE_TB" for
# tablebase support, or just "TB = " for no tablebase capability.
# Use "TB = -DSCID_USE_TB -DT41_INCLUDE" to include use of 4-1
# (King + 3 pieces vs lone king) tablebases.
#
TB = @TB@
### SCIDFLAGS: Scid customization flags.
# Use -DZLIB if your system have zlib
# The default is to not use the system zlib library.
#
SCIDFLAGS = @SCIDFLAGS@
### OPTIMIZE: Optimization options for C++ compiler.
# -O3 is the most optimization for g++. I have found -O2 to do
# just as well, but someone reported a noticeable difference in speed
# between -O3 and -O2 so the default here is -O3.
# On some systems, adding "-fno-rtti" and "-fno-exceptions" produces
# smaller, faster programs since Scid does not use those C++ features.
#
OPTIMIZE = @OPTIMIZE@ @THREADS@
### DEBUG: Defining the macro ASSERTIONS will turn on assertions, which
# helps to track bugs after modifications, but the programs will run
# a little faster with assertions turned off.
#
DEBUG = @DEBUG@
### WARNINGS: I always compile with all warnings on (-Wall), and all the
# files should compile warning-free using g++.
#
WARNINGS = @WARNINGS@
### PROFILE: Set this to "-pg" for profiling in g++ and gcc.
#
PROFILE = @PROFILE@
### CPP_FLAGS: Flags for C++ compilation.
#
CPP_FLAGS = -MMD $(PROFILE) $(OPTIMIZE) $(WARNINGS) $(DEBUG) $(SCIDFLAGS) $(TB)
ifeq ($(INSTALL),install_mac)
### SCID_VERSION: Set this to the release version or it will find it by itself.
SCID_VERSION = `grep 'set scidVersion ' tcl/start.tcl | sed -E -e 's/^set scidVersion \"(.+)\"/\1/'`
### SCID_APP_BIN: This will find the correct path to tkscid.
SCID_APP_BIN = $$(cd "$$(dirname "$$0")/$$(dirname $$(readlink "$$0"))"; pwd)/
endif
############################################################
#
# You should not need to edit anything below this line.
#
############################################################
### EXECS: executable programs compiled from C++ files.
#
EXECS= tkscid
### SCIDOBJS:
SCIDCPP= $(wildcard src/*.cpp)
SCIDOBJS= $(SCIDCPP:.cpp=.o)
POLYGLOT= $(wildcard src/polyglot/*.cpp)
XOBJS= $(POLYGLOT:.cpp=.o)
DEPENDS = ${SCIDOBJS:.o=.d} ${XOBJS:.o=.d}
### ZLIB: Should be "-lz" if your system has zlib, "" otherwise.
#
ZLIB = @ZLIB@
### OBJS: Will be "$(SCIDOBJS)", "$(POLYGLOTOBJS)"
OBJS= @OBJS@
### TCLS: all the .tcl files that make up "scid".
#
TCLS= tcl/start.tcl
### SCRIPTS:
# Small extra programs. Most are written in Tcl using tkscid, but
# a few contributed ones may be in Python or other languages.
#
SCRIPTS= sc_epgn sc_spell sc_eco sc_import sc_remote scidpgn pgnfix spliteco spf2spi
####################
### Type "make" or "make all" to make all programs:
#
all: all_scid all_engines
all_scid: scid $(SCRIPTS) $(EXECS)
all_engines: scidlet phalanx-scid toga
scidlet: src/engine.o src/recog.o src/misc.o src/position.o src/dstring.o
$(COMPILE) $(CPP_FLAGS) -o scidlet engines/scidlet/scidlet.cpp src/engine.o src/recog.o src/misc.o src/position.o src/dstring.o
phalanx-scid:
cd engines/phalanx-scid/ && $(MAKE) && cd ../../
toga:
cd engines/togaII1.2.1a/src/ && $(MAKE) && cd ../../
test: all_scid
cd gtest && \
CXX=$(COMPILE) cmake CMakeLists.txt && \
make && ./runAll && \
cd ../
### To copy all executables to $BINDIR, with read and execute permission
# for all users, and put extra files in $SHAREDIR, type "make install".
#
install: $(INSTALL)
install_scid: all_scid
install -m 755 -d "$(DESTDIR)$(SHAREDIR)"
install -m 755 -d "$(DESTDIR)$(BINDIR)"
install -m 755 $(SCRIPTS) $(EXECS) "$(DESTDIR)$(BINDIR)"
rm -f "$(DESTDIR)$(BINDIR)/scid"
@echo "#!/bin/sh" > "$(DESTDIR)$(BINDIR)/scid"
@echo 'exec "$(BINDIR)/tkscid" "$(SHAREDIR)/tcl/start.tcl" "$$@"' >> "$(DESTDIR)$(BINDIR)/scid"
chmod 755 "$(DESTDIR)$(BINDIR)/scid"
chmod +x "$(DESTDIR)$(BINDIR)/scid"
install -m 644 -p scid.eco "$(DESTDIR)$(SHAREDIR)"
install -m 755 -d "$(DESTDIR)$(SHAREDIR)/books"
install -m 666 ./books/*.* "$(DESTDIR)$(SHAREDIR)/books/"
install -m 755 -d "$(DESTDIR)$(SHAREDIR)/bases"
if test -d ./bases; then install -m 666 ./bases/*.* "$(DESTDIR)$(SHAREDIR)/bases/" ; fi
install -m 755 -d "$(DESTDIR)$(SHAREDIR)/html"
cp -r ./html/* "$(DESTDIR)$(SHAREDIR)/html/"
install -m 755 -d "$(DESTDIR)$(SHAREDIR)/img/"
cp -r ./img/* "$(DESTDIR)$(SHAREDIR)/img/"
install -m 755 -d "$(DESTDIR)$(SHAREDIR)/tcl/"
cp -r ./tcl/* "$(DESTDIR)$(SHAREDIR)/tcl/"
install_engines: all_engines
install -m 755 -d "$(DESTDIR)$(SHAREDIR)/engines"
install -m 755 -d "$(DESTDIR)$(SHAREDIR)/engines/phalanx-scid"
install ./engines/phalanx-scid/phalanx-scid "$(DESTDIR)$(SHAREDIR)/engines/phalanx-scid"
install -m 755 -d "$(DESTDIR)$(SHAREDIR)/engines/togaII1.2.1a"
install ./engines/togaII1.2.1a/src/togaII "$(DESTDIR)$(SHAREDIR)/engines/togaII1.2.1a/"
install_mac: all
install -m 755 -d dist/Scid.app/Contents/MacOS
install -m 755 -d dist/Scid.app/Contents/Resources/bin
install -m 755 -d dist/Scid.app/Contents/Resources/share/scid/data
install -m 755 -d dist/Scid.app/Contents/Resources/share/scid/books
install -m 755 -d dist/Scid.app/Contents/Resources/share/scid/html
install -m 755 -d dist/Scid.app/Contents/Resources/share/scid/sounds
#install -m 755 -d dist/Scid.app/Contents/Resources/share/scid/engines
install -m 755 -d dist/Scid.app/Contents/Resources/Scripts
#install -m 755 $(SCRIPTS) $(EXECS) dist/Scid.app/Contents/Resources/bin/
install -m 755 $(EXECS) dist/Scid.app/Contents/Resources/bin/
install -m 644 -p scid.eco dist/Scid.app/Contents/Resources/share/scid/data/
install -m 666 -p ./books/* dist/Scid.app/Contents/Resources/share/scid/books/
install -m 644 -p ./sounds/* dist/Scid.app/Contents/Resources/share/scid/sounds/
install -m 755 -p ./engines/togaII1.2.1a/src/togaII dist/Scid.app/Contents/Resources/bin/
install -m 755 -p ./engines/phalanx-scid/phalanx-scid dist/Scid.app/Contents/Resources/bin/
install -m 644 -p ./mac_icons/Scid*.icns dist/Scid.app/Contents/Resources/
install -m 755 -d dist/Scid.app/Contents/Resources/share/scid/img/
install -m 755 -d dist/Scid.app/Contents/Resources/share/scid/tcl/
ditto ./tcl dist/Scid.app/Contents/Resources/share/scid/tcl
ditto ./img dist/Scid.app/Contents/Resources/share/scid/img
ditto ./html dist/Scid.app/Contents/Resources/share/scid/html
install -m 666 Info.plist dist/Scid.app/Contents/
perl -pi -e "s|x\.x\</string\>|$(SCID_VERSION)</string\>|" dist/Scid.app/Contents/Info.plist
cd dist/Scid.app/Contents/Resources/bin/ && ln -sf ../share/scid/sounds
cd dist/Scid.app/Contents/Resources/bin/ && ln -sf ../share/scid/html
LANG=C sed -e 's|exec .*tkscid|exec "$(SCID_APP_BIN)tkscid"|' < scid > dist/Scid.app/Contents/Resources/bin/scid
for script in $(SCRIPTS); do sed -e 's|exec .*tkscid|exec "$(SCID_APP_BIN)tkscid"|' < $${script} > dist/Scid.app/Contents/Resources/bin/$${script};done
chmod +x dist/Scid.app/Contents/Resources/bin/*
cd dist/Scid.app/Contents/MacOS && ln -sf ../Resources/bin/scid
#cd dist/Scid.app/Contents/MacOS && ln -sf ../Resources/bin/tkscid scid
#cd dist/Scid.app/Contents/Resources/Scripts && ln -sf ../bin/scid AppMain.tcl
scid_dmg: install_mac
install -m 755 -d dist/bitmaps
install -m 755 -d dist/bitmaps2
install -m 755 -d dist/Scripts
install -m 755 -d dist/Scripts/CB-MEGA
install -m 644 -p ChangeLog ./dist/Change\ Log.txt
install -m 644 -p CHANGES ./dist/Changes.txt
install -m 644 -p COPYING ./dist/Copying.txt
install -m 644 -p TODO ./dist/To\ Do.txt
install -m 644 -p ./bitmaps/* ./dist/bitmaps/
install -m 644 -p ./bitmaps2/* ./dist/bitmaps2/
#install -m 755 -p ./scripts/* ./dist/Scripts/
install -m 755 -p ./scripts/eco2pgn.py ./dist/Scripts/
install -m 755 -p ./scripts/pgnfix.py ./dist/Scripts/
install -m 755 -p ./scripts/twic2scid.py ./dist/Scripts/
install -p ./scripts/CB-Mega/* ./dist/Scripts/CB-Mega/
hdiutil create -fs "HFS+" -volname Scid -srcfolder dist "Scid $(SCID_VERSION) (`sw_vers -productName` `sw_vers -productVersion` `uname -p`).dmg"
uninstall:
rm -rf $(SHAREDIR)
rm -f $(BINDIR)/scid $(BINDIR)/sc_addmove $(BINDIR)/sc_epgn
rm -f $(BINDIR)/sc_spell $(BINDIR)/sc_eco $(BINDIR)/sc_import
rm -f $(BINDIR)/sc_remote $(BINDIR)/sc_tree $(BINDIR)/scidpgn
rm -f $(BINDIR)/pgnfix $(BINDIR)/spliteco
rm -f $(BINDIR)/tkscid
rm -f $(BINDIR)/scidlet
### To remove Scid files placed in the BINDIR and SHAREDIR directories,
# type "make distclean".
#
distclean:
cd $(BINDIR) && rm -f $(EXECS) $(SCRIPTS)
-rm -f $(SHAREDIR)/scid.eco
### To remove object and executable files: type "make clean".
#
clean:
rm -f scidlet scidlet.d src/*.o src/polyglot/*.o $(EXECS) scid $(SCRIPTS)
rm -f src/*.d src/polyglot/*.d
cd engines/phalanx-scid/ && make clean && cd ../../
cd engines/togaII1.2.1a/src/ && make clean && cd ../../../
rm -Rf dist
### To make the executable files smaller: type "make strip".
#
strip:
strip $(EXECS)
### To compress scid and executables with gzexe: type "make gzexe".
#
gzexe:
gzexe $(EXECS) scid
scid: $(TCLS)
rm -f ./scid
cat $(TCLS) > ./scid
chmod +x scid
sc_epgn: scripts/sc_epgn.tcl
cp scripts/sc_epgn.tcl ./sc_epgn
chmod +x sc_epgn
sc_spell: scripts/sc_spell.tcl
cp scripts/sc_spell.tcl ./sc_spell
chmod +x sc_spell
sc_eco: scripts/sc_eco.tcl
cp scripts/sc_eco.tcl ./sc_eco
chmod +x sc_eco
sc_import: scripts/sc_import.tcl
cp scripts/sc_import.tcl ./sc_import
chmod +x sc_import
sc_remote: scripts/sc_remote.tk
cp scripts/sc_remote.tk ./sc_remote
chmod +x sc_remote
scidpgn: scripts/scidpgn.tcl
cp scripts/scidpgn.tcl ./scidpgn
chmod +x scidpgn
spliteco: scripts/spliteco.tcl
cp scripts/spliteco.tcl ./spliteco
chmod +x spliteco
tbstats: scripts/tbstats.tcl
cp scripts/tbstats.tcl ./tbstats
chmod +x tbstats
wmtest: scripts/wmtest.tk
cp scripts/wmtest.tk ./wmtest
chmod +x wmtest
pgnfix: scripts/pgnfix.py
cp scripts/pgnfix.py ./pgnfix
chmod +x pgnfix
eco2pgn: scripts/eco2pgn.py
cp scripts/eco2pgn.py ./eco2pgn
chmod +x eco2pgn
twic2pgn: scripts/twic2pgn.py
cp scripts/twic2pgn.py ./twic2pgn
chmod +x twic2pgn
spf2spi: scripts/spf2spi.tcl
cp scripts/spf2spi.tcl ./spf2spi
chmod +x spf2spi
tkscid: $(OBJS) $(XOBJS)
$(LINK) $(CPP_FLAGS) $(XOBJS) $(OBJS) $(TCL_LIBRARY) $(ZLIB) -o tkscid
### Generic rule for .cpp files:
#
src/%.o: src/%.cpp
$(COMPILE) $(CPP_FLAGS) $(TCL_INCLUDE) -o $@ -c $<
-include ${DEPENDS}
### End of Makefile