-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile.cygwin
337 lines (277 loc) · 11.2 KB
/
Makefile.cygwin
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
##### Scid Makefile for Cygwin on Windows systems.
#
# This version of the Scid Makefile was sent to me by a user
# who has used it to compile Scid with Cygwin on Windows.
# I do not use Windows and know nothing about Cygwin so if
# this does not work for you, I doubt I will be able to help.
# -- Shane Hudson, author of Scid
### Compiler: Most Unix systems use g++ for compiling and linking.
#
COMPILE = g++
CC = gcc
LINK = g++
# BINDIR: where the Scid programs are copied for "make install".
#
BINDIR = /usr/local/bin
# SHAREDIR: where scid.eco and spelling.ssp are copied for "make install".
#
SHAREDIR = /usr/local/share/scid
### 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 = 8.3
# TCL_INCLUDE, TCL_LIBRARY, TK_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.
#
# Location of Tcl directories in Windows:
#
TCL_TOP = /cygdrive/c/progra~1/Tcl
TCL_INCLUDE = -I $(TCL_TOP)/include
TCL_LIBRARY = $(TCL_TOP)/lib/tcl83.lib
TK_LIBRARY = $(TCL_LIBRARY) $(TCL_TOP)/lib/tk83.lib
########################################
### 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 = -DSCID_USE_TB
### SCIDFLAGS: Scid customization flags.
# Use -DZLIB if your system does not have zlib and you need
# to include the code in the src/zlib directory.
# The default is to use the system zlib library.
#
SCIDFLAGS = -DZLIB
### OPTIMIZE: Optimization options for C++ compiler.
# -O4 is the most optimization for g++. I have found -O2 to do
# just as well, but someone reported a noticable difference in speed
# between -O4 and -O2 so the default here is -O4.
# On some systems, adding "-fno-rtti" and "-fno-exceptions" produces
# smaller, faster programs since Scid does not use those C++ features.
#
OPTIMIZE = -O4 -fno-rtti -fno-exceptions
### 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 = #-DASSERTIONS
### WARNINGS: I always compile with all warnings on (-Wall), and all the
# files should compile warning-free using g++.
#
WARNINGS = -Wall
### PROFILE: Set this to "-pg" for profiling in g++ and gcc.
#
PROFILE =
### CPP_FLAGS: Flags for C++ compilation.
#
CPP_FLAGS = $(PROFILE) $(OPTIMIZE) $(WARNINGS) $(DEBUG) $(SCIDFLAGS)
### CFLAGS: Flags for C compilation (only used for compiling zlib).
#
CFLAGS = -O2 -Wall $(PROFILE)
### LANGUAGES: List of additional Tcl files to include in Scid for
# multi-language menu support.
# By default, it is all the contributed languages, but you
# can reduce the size of the Scid program by only specifying
# the languages you want supported.
#
LANGUAGES = tcl/lang/deutsch.tcl tcl/lang/francais.tcl tcl/lang/italian.tcl \
tcl/lang/nederlan.tcl tcl/lang/spanish.tcl tcl/lang/portbr.tcl tcl/lang/port.tcl \
tcl/lang/swedish.tcl tcl/lang/norsk.tcl tcl/lang/polish.tcl \
tcl/lang/czech.tcl tcl/lang/serbian.tcl
############################################################
#
# You should not need to edit anything below this line.
#
############################################################
### EXECS: executable programs compiled from C++ files.
# Note: scidt and eco2epd are obsolete and not compiled by default.
#
EXECS= pgnscid.exe tkscid.exe tcscid.exe scmerge.exe scidlet.exe
### SCIDOBJS: not all the .o files that make up Scid, just the standard ones
# that most of the programs include.
#
SCIDOBJS= src/misc.o src/index.o src/date.o src/namebase.o src/position.o \
src/game.o src/gfile.o src/matsig.o src/bytebuf.o src/textbuf.o \
src/myassert.o src/stralloc.o src/mfile.o src/dstring.o src/pgnparse.o \
src/stored.o src/movelist.o
### ZLIBOBJS: object files in the zlib compression library.
#
ZLIBOBJS= src/zlib/adler32.o src/zlib/compress.o src/zlib/crc32.o \
src/zlib/gzio.o src/zlib/uncompr.o src/zlib/deflate.o src/zlib/trees.o \
src/zlib/zutil.o src/zlib/inflate.o src/zlib/infblock.o \
src/zlib/inftrees.o src/zlib/infcodes.o src/zlib/infutil.o \
src/zlib/inffast.o
### ZLIB: Should be "-lz" if your system has zlib, "" otherwise.
#
ZLIB =
### OBJS: Will be "$(SCIDOBJS)", and also "$(ZLIBOBJS)" if they are
# needed on your system.
OBJS= $(SCIDOBJS) $(ZLIBOBJS)
### TCLS: all the .tcl files that make up "scid".
#
TCLS= \
tcl/start.tcl \
tcl/config.tcl \
tcl/bitmaps.tcl \
tcl/language.tcl \
tcl/utils.tcl \
tcl/utils/date.tcl tcl/utils/font.tcl tcl/utils/graph.tcl tcl/utils/history.tcl \
tcl/utils/pane.tcl tcl/utils/sound.tcl tcl/utils/string.tcl tcl/utils/tooltip.tcl \
tcl/utils/validate.tcl tcl/utils/win.tcl \
tcl/misc/misc.tcl tcl/htext.tcl \
tcl/file.tcl \
tcl/file/finder.tcl tcl/file/bookmark.tcl tcl/file/recent.tcl tcl/file/epd.tcl \
tcl/file/spellchk.tcl tcl/file/maint.tcl \
tcl/edit.tcl \
tcl/game.tcl \
tcl/game/browser.tcl \
tcl/windows.tcl \
tcl/windows/gamelist.tcl tcl/windows/pgn.tcl \
tcl/windows/comment.tcl tcl/windows/eco.tcl \
tcl/windows/stats.tcl tcl/windows/tree.tcl tcl/windows/crosstab.tcl \
tcl/windows/pfinder.tcl tcl/windows/tourney.tcl tcl/windows/switcher.tcl \
tcl/search/search.tcl \
tcl/search/board.tcl tcl/search/header.tcl tcl/search/material.tcl \
tcl/contrib/ezsmtp/ezsmtp.tcl \
tcl/tools/email.tcl \
tcl/tools/import.tcl \
tcl/tools/optable.tcl tcl/tools/preport.tcl tcl/tools/pinfo.tcl \
tcl/tools/analysis.tcl tcl/tools/comp.tcl tcl/tools/wbdetect.tcl \
tcl/tools/reper.tcl tcl/tools/graphs.tcl tcl/tools/tablebase.tcl tcl/tools/ptracker.tcl \
tcl/help/help.tcl tcl/help/tips.tcl \
tcl/menus.tcl tcl/board.tcl tcl/move.tcl tcl/main.tcl \
tcl/lang/english.tcl $(LANGUAGES) \
tcl/end.tcl
### SCRIPTS: small extra programs written in Tcl using tcscid.
#
SCRIPTS= sc_addmove sc_epgn sc_spell sc_eco sc_import scidpgn pgnfix wmtest
####################
### Type "make" or "make all" to make all programs:
#
all: scid $(SCRIPTS) $(EXECS)
### To copy all executables to $BINDIR, with read and execute permission
# for all users, and put extra files in $SHAREDIR, type "make install".
#
install: all
chmod 755 scid $(SCRIPTS) $(EXECS)
cp scid $(SCRIPTS) $(EXECS) $(BINDIR)
-mkdir -p $(SHAREDIR)
-chmod a+rx $(SHAREDIR)
-cp ./scid.eco $(SHAREDIR)/scid.eco
-cp ./spelling.ssp $(SHAREDIR)/spelling.ssp
-chmod a+r $(SHAREDIR)/scid.eco $(SHAREDIR)/spelling.ssp
### Make a tar file for distributing binaries for Cygwin.
#
distbin:
strip $(EXECS:%=$(BINDIR)/%)
tar -cvzf binaries.tar.gz $(BINDIR)/scid \
$(SCRIPTS:%=$(BINDIR)/%) $(EXECS:%=$(BINDIR)/%) $(SHAREDIR)
### 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
-rm -f $(SHAREDIR)/spelling.ssp
### To remove object and executable files: type "make clean".
#
clean:
rm -f src/*.o src/zlib/*.o $(EXECS) scid $(SCRIPTS)
### 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
### CYGROOT - used to fix path problems for cygwin-based systems
#
CYGROOT=c:/cygwin
scid: $(TCLS)
rm -f ./scid
cat $(TCLS) | \
sed -e 's|^#!/bin/sh.*|#!$(BINDIR)/tkscid $(CYGROOT)$(BINDIR)/$@|' > $@
chmod +x $@
sc_addmove: scripts/sc_addmove.tcl
cat scripts/sc_addmove.tcl | \
sed -e 's|^#!/bin/sh.*|#!$(BINDIR)/tcscid $(CYGROOT)$(BINDIR)/$@|' > $@
chmod +x $@
sc_epgn: scripts/sc_epgn.tcl
cat scripts/sc_epgn.tcl | \
sed -e 's|^#!/bin/sh.*|#!$(BINDIR)/tcscid $(CYGROOT)$(BINDIR)/$@|' > $@
chmod +x $@
sc_spell: scripts/sc_spell.tcl
cat scripts/sc_spell.tcl | \
sed -e 's|^#!/bin/sh.*|#!$(BINDIR)/tcscid $(CYGROOT)$(BINDIR)/$@|' > $@
chmod +x $@
sc_eco: scripts/sc_eco.tcl
cat scripts/sc_eco.tcl | \
sed -e 's|^#!/bin/sh.*|#!$(BINDIR)/tcscid $(CYGROOT)$(BINDIR)/$@|' > $@
chmod +x $@
sc_import: scripts/sc_import.tcl
cat scripts/sc_import.tcl | \
sed -e 's|^#!/bin/sh.*|#!$(BINDIR)/tcscid $(CYGROOT)$(BINDIR)/$@|' > $@
chmod +x $@
sc_maketree: scripts/sc_maketree.tcl
cat scripts/sc_maketree.tcl | \
sed -e 's|^#!/bin/sh.*|#!$(BINDIR)/tcscid $(CYGROOT)$(BINDIR)/$@|' > $@
chmod +x $@
scidpgn: scripts/scidpgn.tcl
cat scripts/scidpgn.tcl | \
sed -e 's|^#!/bin/sh.*|#!$(BINDIR)/tcscid $(CYGROOT)$(BINDIR)/$@|' > $@
chmod +x $@
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
scmerge.exe: src/scmerge.o src/misc.o src/index.o src/date.o src/namebase.o \
src/gfile.o src/bytebuf.o src/textbuf.o src/myassert.o \
src/stralloc.o
$(LINK) -o $@ src/scmerge.o $(OBJS) $(ZLIB)
pgnscid.exe: src/pgnscid.o $(OBJS)
$(LINK) $(PROFILE) -o $@ src/pgnscid.o $(OBJS) $(ZLIB)
scidlet.exe: src/scidlet.o src/engine.o src/recog.o src/misc.o src/position.o \
src/dstring.o src/movelist.o src/myassert.o
$(LINK) -o $@ src/scidlet.o src/engine.o src/recog.o src/misc.o src/position.o src/movelist.o src/dstring.o src/myassert.o
scidt.exe: src/scidt.o $(OBJS)
$(LINK) -o $@ src/scidt.o $(OBJS) $(ZLIB)
tkscid.exe: src/tkscid.o $(OBJS) src/tree.o src/filter.o \
src/pbook.o src/crosstab.o src/spellchk.o src/probe.o src/optable.o
$(LINK) -o $@ src/tkscid.o $(OBJS) src/tree.o src/filter.o src/pbook.o src/crosstab.o src/spellchk.o src/probe.o src/optable.o src/engine.o src/recog.o $(ZLIB) $(TK_LIBRARY)
tcscid.exe: src/tcscid.o $(OBJS) src/tree.o src/filter.o \
src/pbook.o src/crosstab.o src/spellchk.o src/probe.o src/optable.o
$(LINK) -o tcscid src/tcscid.o $(OBJS) src/tree.o src/filter.o src/pbook.o src/crosstab.o src/spellchk.o src/probe.o src/optable.o src/engine.o src/recog.o $(ZLIB) $(TCL_LIBRARY)
# eco2epd is now optional extra program NOT compiled by default, since
# scid now reads the .eco file format directly.
eco2epd: src/eco2epd.o $(OBJS) src/pbook.o
$(LINK) -o eco2epd src/eco2epd.o $(OBJS) src/pbook.o $(ZLIB)
### Rules to create .o files from .cpp files:
#
src/tcscid.o: src/tkscid.cpp
$(COMPILE) $(CPP_FLAGS) $(TCL_INCLUDE) -DTCL_ONLY -o src/tcscid.o -c src/tkscid.cpp
src/tkscid.o: src/tkscid.cpp
$(COMPILE) $(CPP_FLAGS) $(TCL_INCLUDE) -o src/tkscid.o -c src/tkscid.cpp
### The endgame tablebase code in the egtb/ subdirectory (not written by me)
# gives many warnings, so compile probe.cpp with warnings turned off:
#
src/probe.o: src/probe.cpp src/egtb/tbindex.cpp src/egtb/tbdecode.c
$(COMPILE) $(PROFILE) $(OPTIMIZE) $(DEBUG) $(SCIDFLAGS) $(TB) -o src/probe.o -c src/probe.cpp
### Generic rule for all other .cpp files:
#
%.o: %.cpp
$(COMPILE) $(CPP_FLAGS) -o $@ -c $<
### Rule for compiling zlib source files:
#
src/zlib/%.o: src/zlib/%.c
$(CC) $(CFLAGS) -o $@ -c $<
### End of Makefile