-
Notifications
You must be signed in to change notification settings - Fork 14
/
makefile.unx
374 lines (282 loc) · 11.6 KB
/
makefile.unx
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
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
# -*- Makefile -*-
#
# This is the Makefile for py4.x, tested mainly under Linux with GNU
# make.
# It is expected to work pretty portably on Unix-ish platforms with
# GNU make.
# Revision info:
# CVS: $Id: makefile.unx,v 1.203 2015/05/03 17:32:24 thomasmaeder Exp $
# +++++ Warning +++++++
# This Makefile you are reading now, will not do it with:
# Microsoft C on DOS
# Turbo C on DOS
# TopSpeed C on DOS
# Turbo C on ATARI
# MPW on Macintosh
# They are all great, but the options of the commands are totally
# different to UNIX ones.
# GRRRHHH !!!
# ++++ End Warning ++++
include makefile.defaults
# don't put this into the same include as makefile.defaults!
# makefile.defaults defines TOOLCHAIN
include toolchains/$(TOOLCHAIN)/make.incl
include makefile.options
MAKEFILES = \
makefile.defaults \
toolchains/$(TOOLCHAIN)/make.incl \
makefile.options \
#
# ===========================================================
# default target: build executable
default: all
# stem of distributed files
DISTFILESTEM = popeye-$(VERSION)
# name of tar file containing sources to be distributed
SOURCESTARFILE = $(DISTFILESTEM)-sources.tar
# name of directory used for creating archives (gz, zip, ...)
# containing source files
SOURCEDISTDIR = $(VERSION)
# ===========================================================
# gzip archive of sources
GZIPDISTFILE = $(SOURCESTARFILE).gz
UUGZIPDISTFILE = $(GZIPDISTFILE).uu
gzipdist: $(GZIPDISTFILE) $(UUGZIPDISTFILE)
$(GZIPDISTFILE): ./sourcedist
tar cfv $(SOURCESTARFILE) $(SOURCEDISTDIR)
gzip $(SOURCESTARFILE)
rm -rf $(SOURCEDISTDIR)
$(UUGZIPDISTFILE): $(GZIPDISTFILE)
uuencode $^ $^ > $@
# ===========================================================
# zip archive of sources
SOURCESZIPFILE = $(DISTFILESTEM)-sources.zip
zipdist: $(SOURCESZIPFILE)
$(SOURCESZIPFILE): ./sourcedist
zip -r $(SOURCESZIPFILE) $(SOURCEDISTDIR)
rm -rf $(SOURCEDISTDIR)
# ===========================================================
# .Z (compress) archive of sources
COMPRESSDISTFILE = $(SOURCESTARFILE).Z
compressdist: $(COMPRESSDISTFILE)
$(COMPRESSDISTFILE): ./sourcedist
tar cfv $(SOURCESTARFILE) $(SOURCEDISTDIR)
$(COMPRESS) $(SOURCESTARFILE)
rm -rf $(SOURCEDISTDIR)
# ===========================================================
# Target for creating a tar archive containing all sources
# System V
DEVFLOPPY=/dev/rfd0
# Linux
#DEVFLOPPY=/dev/fd0
tardist: /tmp/$(DISTFILESTEM).tar
/tmp/$(DISTFILESTEM).tar: ./sourcedist
tar cfv $(DEVFLOPPY) $(SOURCEDISTDIR)
rm -rf $(SOURCEDISTDIR)
# ===========================================================
# Target for creating a sequence of shell archive (shar) files
# containing the complete sources; each generated file
# fits on a floppy disk
shardist: /tmp/$(DISTFILESTEM).shar
/tmp/$(DISTFILESTEM).shar: ./sourcedist
find $(SOURCEDISTDIR) -type f -print | shar -S -l40 -o$@
rm -rf $(SOURCEDISTDIR)
# ===========================================================
# Target for creating various archive files containing the example
# input files
BEISPIELTARFILE = $(DISTFILESTEM)-beispiel.tar
BEISPIELGZIPFILE = $(BEISPIELTARFILE).gz
BEISPIELCOMPRESSFILE = $(BEISPIELTARFILE).Z
BEISPIELZIPFILE = $(DISTFILESTEM)-beispiel.zip
EXAMPLESTARFILE = $(DISTFILESTEM)-examples.tar
EXAMPLESGZIPFILE = $(EXAMPLESTARFILE).gz
EXAMPLESCOMPRESSFILE = $(EXAMPLESTARFILE).Z
EXAMPLESZIPFILE = $(DISTFILESTEM)-examples.zip
$(BEISPIELTARFILE): BEISPIEL/*.inp
tar cf $@ $^
$(BEISPIELGZIPFILE): $(BEISPIELTARFILE)
gzip < $^ > $@
$(BEISPIELCOMPRESSFILE): $(BEISPIELTARFILE)
$(COMPRESS) $^
$(BEISPIELZIPFILE): BEISPIEL/*.inp
zip -r $@ $^
$(EXAMPLESTARFILE): EXAMPLES/*.inp
tar cf $@ $^
$(EXAMPLESGZIPFILE): $(EXAMPLESTARFILE)
gzip < $^ > $@
$(EXAMPLESCOMPRESSFILE): $(EXAMPLESTARFILE)
$(COMPRESS) $^
$(EXAMPLESZIPFILE): EXAMPLES/*.inp
zip -r $@ $^
.INTERMEDIATE: $(BEISPIELTARFILE) $(EXAMPLESTARFILE)
EXAMPLESdist: $(BEISPIELGZIPFILE) $(BEISPIELCOMPRESSFILE) $(BEISPIELZIPFILE)\
$(EXAMPLESGZIPFILE) $(EXAMPLESCOMPRESSFILE) $(EXAMPLESZIPFILE)
# ===========================================================
# Target for creating various archive files containing the LaTeX
# utility files
LATEXTARFILE = $(DISTFILESTEM)-latex.tar
LATEXGZIPFILE = $(LATEXTARFILE).gz
LATEXCOMPRESSFILE = $(LATEXTARFILE).Z
LATEXZIPFILE = $(DISTFILESTEM)-latex.zip
$(LATEXTARFILE): $(TEXFILES)
tar cf $@ $^
$(LATEXGZIPFILE): $(LATEXTARFILE)
gzip < $^ > $@
$(LATEXCOMPRESSFILE): $(LATEXTARFILE)
$(COMPRESS) $^
$(LATEXZIPFILE): $(TEXFILES)
zip -r $@ $^
.INTERMEDIATE: $(LATEXTARFILE)
LATEXdist: $(LATEXGZIPFILE) $(LATEXCOMPRESSFILE) $(LATEXZIPFILE)
PLATFORMS = platform/other platform/windows32 platform/dos \
platform/unix platform/windows64
NESTEDSRCDIRS = . platform $(PLATFORMS) $(TOOLCHAINS) scripts \
conditions conditions/amu conditions/ultraschachzwang conditions/marscirce \
conditions/circe conditions/anticirce \
conditions/owu conditions/maff conditions/singlebox conditions/einstein \
conditions/transmuting_kings conditions/koeko \
optimisations DHT \
stipulation stipulation/boolean \
stipulation/battle_play stipulation/help_play \
stipulation/goals \
stipulation/goals/mate \
stipulation/goals/stalemate stipulation/goals/doublestalemate \
stipulation/goals/autostalemate stipulation/goals/automate stipulation/goals/any \
stipulation/goals/circuit stipulation/goals/circuit_by_rebirth \
stipulation/goals/exchange stipulation/goals/exchange_by_rebirth \
stipulation/goals/target stipulation/goals/check \
stipulation/goals/doublemate stipulation/goals/countermate \
stipulation/goals/capture stipulation/goals/steingewinn \
stipulation/goals/enpassant stipulation/goals/castling \
stipulation/goals/proofgame stipulation/goals/atob \
stipulation/goals/chess81 stipulation/goals/kiss \
stipulation/goals/king_capture \
stipulation/goals/immobile stipulation/goals/notcheck \
solving solving/battle_play solving/help_play solving/boolean solving/machinery solving/goals \
retro \
position position/effects \
pieces pieces/walks pieces/walks/pawns pieces/walks/angle \
pieces/walks/chinese pieces/walks/argentinian \
pieces/attributes pieces/attributes/neutral \
pieces/attributes/paralysing pieces/attributes/kamikaze \
pieces/attributes/total_invisible \
optimisations/orthodox_mating_moves \
optimisations/intelligent \
optimisations/intelligent/mate optimisations/intelligent/stalemate \
optimisations/goals \
optimisations/goals/castling optimisations/goals/enpassant \
optimisations/goals/chess81 optimisations/goals/capture \
optimisations/goals/target \
optimisations/killer_move optimisations/count_nr_opponent_moves \
optimisations/ohneschach \
options options/no_short_variations \
options/maxsolutions \
options/stoponshortsolutions \
options/movenumbers \
input input/plaintext input/plaintext/geometry \
output \
output/latex output/latex/tree output/latex/line \
output/plaintext output/plaintext/tree output/plaintext/line \
utilities debugging
NESTEDLIBDIRS = \
solving/machinery \
input input/plaintext input/plaintext/geometry \
conditions conditions/amu conditions/ultraschachzwang conditions/marscirce \
conditions/circe conditions/anticirce \
conditions/owu conditions/maff conditions/singlebox conditions/einstein \
conditions/transmuting_kings conditions/koeko \
optimisations/orthodox_mating_moves \
optimisations/killer_move optimisations/count_nr_opponent_moves \
options options/no_short_variations \
options/maxsolutions \
options/stoponshortsolutions \
options/movenumbers \
optimisations/intelligent \
optimisations/intelligent/mate optimisations/intelligent/stalemate \
optimisations \
optimisations/ohneschach \
retro \
solving solving/battle_play solving/help_play solving/boolean solving/goals \
pieces \
pieces/walks pieces/walks/pawns pieces/walks/angle \
pieces/walks/chinese pieces/walks/argentinian \
pieces/attributes pieces/attributes/neutral \
pieces/attributes/paralysing pieces/attributes/kamikaze \
pieces/attributes/total_invisible \
DHT \
stipulation/battle_play stipulation/help_play \
stipulation/goals \
stipulation/goals/mate \
stipulation/goals/stalemate stipulation/goals/doublestalemate \
stipulation/goals/autostalemate stipulation/goals/automate stipulation/goals/any \
stipulation/goals/circuit stipulation/goals/circuit_by_rebirth \
stipulation/goals/exchange stipulation/goals/exchange_by_rebirth \
stipulation/goals/target stipulation/goals/check \
stipulation/goals/doublemate stipulation/goals/countermate \
stipulation/goals/capture stipulation/goals/steingewinn \
stipulation/goals/enpassant stipulation/goals/castling \
stipulation/goals/proofgame stipulation/goals/atob \
stipulation/goals/chess81 stipulation/goals/kiss \
stipulation/goals/king_capture \
stipulation/goals/immobile stipulation/goals/notcheck \
stipulation \
stipulation/boolean \
optimisations/goals \
optimisations/goals/castling optimisations/goals/enpassant \
optimisations/goals/chess81 optimisations/goals/capture \
optimisations/goals/target \
output \
output/latex output/latex/line output/latex/tree output/latex \
output/plaintext output/plaintext/tree output/plaintext/line \
position position/effects \
platform platform/$(PLATFORM) \
utilities debugging \
.
STRFILES= py-fran.str py-deut.str py-engl.str
TEXFILES= pie-fran.txt pie-deut.txt pie-engl.txt piecenam.txt \
LATEX/diagram.* LATEX/FSELCH/* LATEX/PKELCH/*
EXAMPLES = BEISPIEL/*.inp EXAMPLES/*.inp
TOOLCHAINS = $(filter-out toolchains/CVS,$(wildcard toolchains/*))
# enumerate libraries to link
OURLIBS = $(NESTEDLIBDIRS:%=%/library.$(LIB_SUFFIX))
# ===========================================================
# default target: build executable
all: py$(EXE_PLATFORM_MARK)$(EXE_SUFFIX)
# ===========================================================
# Target for creating the popeye executable with full dynamic hashing
py$(EXE_PLATFORM_MARK)$(EXE_SUFFIX): pymain$(OBJ_SUFFIX) $(OURLIBS)
$(LDTARGET) $(EXEFILE)$@ pymain$(OBJ_SUFFIX) $(OBJECTS) $(OURLIBS) $(LDFLAGS) $(TARGETLIBS) $(LIBRARIES)
$(STRIPTARGET) $@
# ===========================================================
# Target for generating the purify-ed popeye exectable
# TODO does this still work?
purify-py: $(OBJECTS) $(OURLIBS)
purify $(CCTARGET) -o purify-py $(LDFLAGS) $^
# ===========================================================
# targets built using recursive makes
# ===========================================================
# ===========================================================
# Build dependency information
ifdef DEPEND
depend: $(NESTEDLIBDIRS:%=%/nesteddepend)
$(NESTEDLIBDIRS:%=%/nesteddepend): FORCE
$(MAKE) CURRPWD=$(dir $@) -f $(dir $@)makefile.local depend
endif
# ===========================================================
# Build in a nested directory
%$(OBJ_SUFFIX) %$(LIB_SUFFIX) %.enum.h %/clean: FORCE
$(MAKE) CURRPWD=$(dir $@) -f $(dir $@)makefile.local $@
# ===========================================================
# create hard links to files to be distributed
sourcedist: $(NESTEDSRCDIRS:%=%/nestedsourcedist)
$(NESTEDSRCDIRS:%=%/nestedsourcedist): FORCE
$(MAKE) CURRPWD=$(dir $@) -f $(dir $@)makefile.local $(dir $@)sourcedist
# ===========================================================
# clean up after ourselves
clean: $(NESTEDLIBDIRS:%=%/clean)
$(MAKE) CURRPWD=./ -f makefile.local $@
rm -f pymain$(OBJ_SUFFIX)
clobber: clean
rm -f py$(EXE_SUFFIX) gengmarr$(EXE_SUFFIX) $(STRFILES)
FORCE:
.SUFFIXES: