-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile.mingwx
233 lines (186 loc) · 9.2 KB
/
Makefile.mingwx
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
### Windows Makefile for Scid vs. PC
### Using Linux-hosted MinGW cross compiler.
### Change MINGW_TARGET and TCL_DIR to meet your setup
### To build for Win64 using MinGW-w64:
### make -f Makefile.mingwx W64=1
### To build for Fed14
### make -f Makefile.mingwx FED=1
### Copyright (C) 2013-2015, O. Sezer (sezero@users.sourceforge.net)
ifeq ($(W64),1)
WIN_TARGET=win64
else
WIN_TARGET=win32
endif
# Tcl/Tk version: it should be "85" for Tcl/Tk 8.5, etc.
TCL_VERSION=85
ifeq ($(WIN_TARGET),win64)
TCL_DIR=/opt/cross_tcl64
MINGW_TARGET=x86_64-w64-mingw32
else
TCL_DIR=/usr/local/cross-tcl
ifeq ($(FED),1)
MINGW_TARGET=i686-pc-mingw32
else
MINGW_TARGET=i686-w64-mingw32
endif
endif
### Compiler and linker
CXX=$(MINGW_TARGET)-g++
CC=$(MINGW_TARGET)-gcc
RC=$(MINGW_TARGET)-windres
LINK=$(CXX)
### 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 -DT41_INCLUDE
### 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
WARNINGS = -Wall
CFLAGS = -DWIN32 -O2 $(WARNINGS) $(DEBUG)
CXXFLAGS = -fno-rtti $(CFLAGS) $(SCIDFLAGS)
LDFLAGS =
RCFLAGS = --output-format=coff
ifeq ($(WIN_TARGET),win64)
CFLAGS += -m64
#CXXFLAGS+= -m64
LDFLAGS+= -m64
RCFLAGS+= --target=pe-x86-64
else
CFLAGS += -m32
#CXXFLAGS+= -m32
LDFLAGS+= -m32
RCFLAGS+= --target=pe-i386
endif
### EXECS: all the evecutable programs compiled from C++ files.
EXECS= pgnscid.exe scidt.exe scid.exe tcscid.exe scmerge.exe eco2epd.exe scidlet.exe
### SCIDOBJS: not all the .o files that make up scid, just the standard
### files that most of the scid programs use.
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 \
src/polyglot/attack.o src/polyglot/board.o src/polyglot/book.o \
src/polyglot/book_make.o src/polyglot/book_merge.o src/polyglot/colour.o \
src/polyglot/fen.o src/polyglot/game.o src/polyglot/hash.o \
src/polyglot/io.o src/polyglot/line.o src/polyglot/list.o src/polyglot/main.o src/polyglot/move.o \
src/polyglot/move_do.o src/polyglot/move_gen.o src/polyglot/move_legal.o src/polyglot/option.o \
src/polyglot/parse.o src/polyglot/pgn.o src/polyglot/piece.o src/polyglot/random.o \
src/polyglot/san.o src/polyglot/search.o src/polyglot/square.o src/polyglot/util.o
CHARSETCONVOBJS= src/charsetdetector.o src/charsetconverter.o \
src/universalchardet/CharDistribution.o src/universalchardet/JpCntx.o \
src/universalchardet/LangBulgarianModel.o src/universalchardet/LangCyrillicModel.o \
src/universalchardet/LangGreekModel.o src/universalchardet/LangHebrewModel.o \
src/universalchardet/LangHungarianModel.o src/universalchardet/LangThaiModel.o \
src/universalchardet/nsBig5Prober.o src/universalchardet/nsCharSetProber.o \
src/universalchardet/nsEscCharsetProber.o src/universalchardet/nsEscSM.o \
src/universalchardet/nsEUCJPProber.o src/universalchardet/nsEUCKRProber.o \
src/universalchardet/nsEUCTWProber.o src/universalchardet/nsGB2312Prober.o \
src/universalchardet/nsHebrewProber.o src/universalchardet/nsLatin1Prober.o \
src/universalchardet/nsMBCSGroupProber.o src/universalchardet/nsMBCSSM.o \
src/universalchardet/nsSBCharSetProber.o src/universalchardet/nsSBCSGroupProber.o \
src/universalchardet/nsSJISProber.o src/universalchardet/nsUniversalDetector.o \
src/universalchardet/nsUTF8Prober.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
### OBJS: all standard object files for scid.
OBJS= $(SCIDOBJS) $(ZLIBOBJS)
## LANGUAGES are now source from scidShareDir/lang
### 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/book.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/tools/correspondence.tcl \
tcl/lang/english.tcl tcl/dnd/tkdnd.tcl tcl/dnd/tkdnd_windows.tcl \
tcl/tools/fics.tcl tcl/tools/uci.tcl tcl/end.tcl tcl/tools/tacgame.tcl tcl/tools/sergame.tcl tcl/tools/calvar.tcl tcl/tools/tactics.tcl tcl/tools/novag.tcl tcl/misc/flags.tcl tcl/tools/inputengine.tcl
########################################
all: $(EXECS) scid.gui
scid.gui: $(TCLS)
rm -f ./scid.gui
cat $(TCLS) > ./scid.gui
scmerge.exe: src/scmerge.o $(OBJS)
$(LINK) -o scmerge.exe src/scmerge.o $(OBJS) $(CHARSETCONVOBJS) -L$(TCL_DIR)/lib -ltcl$(TCL_VERSION)
pgnscid.exe: src/pgnscid.o $(OBJS) $(CHARSETCONVOBJS)
$(LINK) -o pgnscid.exe src/pgnscid.o $(OBJS) $(CHARSETCONVOBJS) -L$(TCL_DIR)/lib -ltcl$(TCL_VERSION)
scidt.exe: src/scidt.o $(OBJS) $(CHARSETCONVOBJS)
$(LINK) -o scidt.exe src/scidt.o $(OBJS) $(CHARSETCONVOBJS) -L$(TCL_DIR)/lib -ltcl$(TCL_VERSION)
scidlet.exe: src/scidlet.o src/engine.o src/recog.o $(OBJS)
$(LINK) $(LDFLAGS) -o scidlet.exe src/scidlet.o src/engine.o src/recog.o \
src/misc.o src/position.o src/movelist.o src/dstring.o src/myassert.o
scid.exe: src/scid.o $(OBJS) $(CHARSETCONVOBJS) 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 src/tkdnd/TkDND_OleDND.o src/tk_selection.o scid.res
$(LINK) $(LDFLAGS) -o scid.exe src/scid.o $(OBJS) $(CHARSETCONVOBJS) \
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 src/tkdnd/TkDND_OleDND.o src/tk_selection.o scid.res \
-mwindows -lole32 -luuid -L$(TCL_DIR)/lib -ltk$(TCL_VERSION) -ltcl$(TCL_VERSION)
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 src/engine.o src/recog.o $(CHARSETCONVOBJS)
$(LINK) $(LDFLAGS) -o tcscid.exe src/tcscid.o $(OBJS) $(CHARSETCONVOBJS) -ltcl$(TCL_VERSION) \
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 \
-L$(TCL_DIR)/lib -ltcl$(TCL_VERSION)
eco2epd.exe: src/eco2epd.o src/pbook.o $(OBJS) $(CHARSETCONVOBJS)
$(LINK) -o eco2epd.exe src/eco2epd.o src/pbook.o $(OBJS) $(CHARSETCONVOBJS) -L$(TCL_DIR)/lib -ltcl$(TCL_VERSION)
scid.res: scid.rc
$(RC) $(RCFLAGS) -o scid.res scid.rc
clean:
rm -f src/*.o src/zlib/*.o src/polyglot/*.o src/universalchardet/*.o $(EXECS) scid.gui scid.res
$(MAKE) -C src/tkdnd/ -f Makefile.mingwx clean
strip:
$(MINGW_TARGET)-strip $(EXECS)
src/tcscid.o: src/tkscid.cpp
$(CXX) $(CXXFLAGS) -std=c++0x -I$(TCL_DIR)/include -DTCL_ONLY -c src/tkscid.cpp \
-o ./src/tcscid.o
src/tkscid.o: src/tkscid.cpp
$(CXX) $(CXXFLAGS) -std=c++0x -I$(TCL_DIR)/include -c src/tkscid.cpp \
-o ./src/tkscid.o
src/scid.o: src/tkscid.cpp
$(CXX) $(CXXFLAGS) -std=c++0x -I$(TCL_DIR)/include -DSOURCE_TCL_FILE="\"scid.gui\"" \
-c src/tkscid.cpp -o ./src/scid.o
src/probe.o: src/probe.cpp src/egtb/tbindex.cpp src/egtb/tbdecode.c
$(CXX) $(CXXFLAGS) -Wno-missing-braces $(TB) -c src/probe.cpp -o ./src/probe.o
%.o: %.cpp
$(CXX) $(CXXFLAGS) -I$(TCL_DIR)/include -c $< -o ./$@
%.o: %.c
$(CC) $(CFLAGS) -c $< -o ./$@
src/tkdnd/TkDND_OleDND.o: src/tkdnd/win/TkDND_OleDND.cpp
$(MAKE) -C src/tkdnd/ -f Makefile.mingwx CC="$(CC)" LINK="$(LINK)" CXXFLAGS="$(CXXFLAGS)" \
WIN_TARGET="$(WIN_TARGET)" TCL_VERSION="$(TCL_VERSION)" TCL_DIR="$(TCL_DIR)"