2
# Makefile for GNU Shogi
4
# Copyright (c) 1993, 1994 Matthias Mutz
5
# Copyright (c) 1998, 1999 Michael Vanier and the Free Software Foundation
7
# GNU Shogi is based on GNU Chess
8
# Copyright (c) 1992 Free Software Foundation
10
# This file is part of GNU Shogi.
12
# GNU Shogi is free software; you can redistribute it and/or modify
13
# it under the terms of the GNU General Public License as published by
14
# the Free Software Foundation; either ../version 1, or (at your option)
15
# any later ../version.
17
# GNU Shogi is distributed in the hope that it will be useful,
18
# but WITHOUT ANY WARRANTY; without even the implied warranty of
19
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20
# GNU General Public License for more details.
22
# You should have received a copy of the GNU General Public License
23
# along with GNU Shogi; see the file COPYING. If not, write to
24
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
28
# gnushogi is GNU shogi, for raw text, curses, or x output.
29
# pat2inc converts pattern textfile to "pattern.inc" include file.
30
# sizetest shows the memory usage of the main data structures.
36
INSTALL_DATA = @INSTALL_DATA@
37
INSTALL_PROGRAM = @INSTALL_PROGRAM@
41
# Installation directory.
44
# Where the binaries live.
45
BINDIR = $(prefix)/games
47
# Where the language description, the book, and the
48
# persistent hashtable live.
49
LIBDIR = $(prefix)/lib/games
51
# Where the man page goes.
52
MANDIR = $(prefix)/share/man/man6
54
# Where the info file goes.
55
INFODIR = $(prefix)/share/info
61
LCURSES = -lcurses -ltermcap
65
# C compiler and compiler options.
69
CWARNINGS = @WARNINGS@
70
CEXTRAFLAGS = @CEXTRAFLAGS@
71
CFLAGS = @CFLAGS@ $(CEXTRAFLAGS) $(CWARNINGS) -I..
74
# The hashfile is a record of positions seen. It is used by
75
# GNU Shogi to avoid making the same mistakes, a form of learning.
77
HASH = -DHASHFILE=\"$(LIBDIR)/gnushogi.hsh\"
80
# The "book" is a record of the first few moves, for playing good
81
# moves easily and quickly, saving time, and irritating the human
84
TEXTBOOK = -DBOOK=\"$(LIBDIR)/gnushogi.tbk\"
85
BINBOOK = -DBINBOOK=\"$(LIBDIR)/gnushogi.bbk\"
88
# The language file describes capabilities of the program. It may
89
# be useful for customizing gnushogi for non-English-speaking players.
91
LANGF = -DLANGFILE=\"../misc/gnushogi.lng\"
94
# The pattern file contains various opening patterns. The program tries to
95
# obtain such a pattern in the opening stage. Sequences of opening
96
# patterns may be described in order to support the correct order of moves.
98
PATTERN = -DPATTERNFILE=\"../misc/gnushogi.pat\"
102
@echo No target specified.
126
GNUSHOGI_FILES = $(COMMONFILES) main.o
129
PAT2INCFILES = $(COMMONFILES) makepattern.o pat2inc.o
137
$(CC) $(CFLAGS) -o gnushogi $(GNUSHOGI_FILES) $(LCURSES) $(LIBS)
140
$(CC) $(CFLAGS) -o pat2inc $(PAT2INCFILES) $(LCURSES) $(LIBS)
143
$(CC) $(CFLAGS) -o sizetest sizetest.o $(LIBS)
153
$(CC) $(CFLAGS) -c attacks.c
156
$(CC) $(CFLAGS) $(TEXTBOOK) $(BINBOOK) -c book.c
159
$(CC) $(CFLAGS) -c commondsp.c
162
$(CC) $(CFLAGS) -c cursesdsp.c
165
$(CC) $(CFLAGS) -c dspwrappers.c
168
$(CC) $(CFLAGS) -c genmove.c
171
$(CC) $(CFLAGS) -c globals.c
174
$(CC) $(CFLAGS) -c eval.c
177
$(CC) $(CFLAGS) $(LANGF) -c init.c
180
$(CC) $(CFLAGS) $(BINBOOK) -c main.c
182
# To create "pattern.inc" with "pat2inc", the external
183
# pattern textfile must be used.
186
$(CC) $(CFLAGS) $(PATTERN) -c makepattern.c
189
$(CC) $(CFLAGS) -c pattern.c
192
$(CC) $(CFLAGS) -c rawdsp.c
195
$(CC) $(CFLAGS) -c search.c
198
$(CC) $(CFLAGS) -c sysdeps.c
201
$(CC) $(CFLAGS) -c tcontrl.c
204
$(CC) $(CFLAGS) -c util.c
207
# Files specific to particular targets.
210
$(CC) $(CFLAGS) $(LANGF) $(BINBOOK) $(PATTERN) -c pat2inc.c
213
$(CC) $(CFLAGS) -c sizetest.c
221
@if [ -f ./gnushogi.bbk ]; then rm ./gnushogi.bbk; fi
223
cat ../misc/gnushogi.tbk > _tmp_t
224
cat test | ./gnushogi -R -b _tmp_t -B ./gnushogi.bbk -S 8000 -P 40 3 0
235
$(INSTALL_PROGRAM) -d $(BINDIR)
236
$(INSTALL_PROGRAM) -d $(LIBDIR)
237
$(INSTALL_PROGRAM) -d $(MANDIR)
238
$(INSTALL_PROGRAM) -d $(INFODIR)
239
$(INSTALL_PROGRAM) gnushogi $(BINDIR)
240
$(INSTALL_DATA) $(ROOT)/doc/gnushogi.6 $(MANDIR)
241
$(INSTALL_DATA) $(ROOT)/doc/gnushogi.info* $(INFODIR)
242
$(INSTALL_DATA) gnushogi.bbk $(LIBDIR)/gnushogi.bbk
249
CLEANFILES = *.o gnushogi sizetest pat2inc CLp* *.bbk
252
@for file in $(CLEANFILES); do \
253
if [ -f $$file ]; then rm $$file; fi; \
261
gnushogi: $(GNUSHOGI_FILES)
262
pat2inc: $(PAT2INCFILES)
264
attacks.o: attacks.c gnushogi.h ../version.h
265
book.o: book.c gnushogi.h ../version.h
266
commondsp.o: commondsp.c gnushogi.h ../version.h
267
cursesdsp.o: cursesdsp.c gnushogi.h ../version.h
268
dspwrappers.o: dspwrappers.c gnushogi.h ../version.h
269
genmove.o: genmove.c gnushogi.h ../version.h
270
globals.o: globals.c gnushogi.h ../version.h
271
eval.o: eval.c eval.h gnushogi.h ../version.h pattern.h
272
init.o: init.c gnushogi.h ../version.h pattern.h
273
main.o: main.c gnushogi.h ../version.h
274
makepattern.o: pattern.c gnushogi.h pattern.h
275
pattern.o: pattern.c gnushogi.h pattern.h pattern.inc
276
rawdsp.o: rawdsp.c gnushogi.h ../version.h
277
search.o: search.c gnushogi.h ../version.h
278
sysdeps.o: sysdeps.c gnushogi.h ../version.h
279
tcontrl.o: tcontrl.c gnushogi.h ../version.h
280
util.o: util.c gnushogi.h ../version.h
281
pat2inc.o: pat2inc.c pattern.h gnushogi.h
282
sizetest.o: sizetest.c gnushogi.h eval.h
283
gnushogi.bbk: gnushogi