Fix funny search-and-replace copyright typo.
[gnushogi.git] / gnushogi / Makefile.profile.in
1 #
2 # Makefile for GNU Shogi
3 #
4 # Copyright (c) 1993, 1994 Matthias Mutz
5 # Copyright (c) 1998, 1999 Michael Vanier and the Free Software Foundation
6 #
7 # GNU Shogi is based on GNU Chess
8 # Copyright (c) 1992 Free Software Foundation
9 #
10 # This file is part of GNU Shogi.
11 #
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 3 of the License, or (at your option)
15 # any later version.
16 #
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.
21 #
22 # You should have received a copy of the GNU General Public License
23 # along with GNU Shogi; see the file COPYING.
24 # If not, see <http://www.gnu.org/licenses/>.
25 #
26
27 #
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.
31 #
32
33 SHELL           = /bin/sh
34 VERS            = 1.3
35 INSTALL         = @INSTALL@
36 INSTALL_DATA    = @INSTALL_DATA@
37 INSTALL_PROGRAM = @INSTALL_PROGRAM@
38 ROOT            = ..
39
40
41 # Installation directory.
42 prefix  =   @prefix@
43
44 # Where the binaries live.
45 BINDIR  =   $(prefix)/bin
46
47 # Where the language description, the book, and the 
48 # persistent hashtable live.
49 LIBDIR  =   $(prefix)/lib/gnushogi
50
51 # Where the man page goes.
52 MANDIR  = $(prefix)/man/man6
53
54 # Where the info file goes.
55 INFODIR = $(prefix)/info
56
57 # For _pow external 
58 LIBS    = -lm
59
60 # Display routines.
61 LCURSES =   -lcurses -ltermcap
62
63
64 #
65 # C compiler and compiler options.
66 #
67
68 CC          = @CC@
69 CWARNINGS   = @WARNINGS@
70 CEXTRAFLAGS = @CEXTRAFLAGS2@
71 CFLAGS      = -g $(CEXTRAFLAGS) $(CWARNINGS) -I..
72
73
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.
76
77 HASH       = -DHASHFILE=\"$(LIBDIR)/gnushogi.hsh\"
78
79
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
82 # opponent.
83
84 TEXTBOOK   = -DBOOK=\"$(LIBDIR)/gnushogi.tbk\"
85 BINBOOK    = -DBINBOOK=\"$(LIBDIR)/gnushogi.bbk\"
86
87
88 # The language file describes capabilities of the program.  It may
89 # be useful for customizing gnushogi for non-English-speaking players.
90
91 LANGF      = -DLANGFILE=\"../misc/gnushogi.lng\"
92
93
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.
97
98 PATTERN    = -DPATTERNFILE=\"../misc/gnushogi.pat\"
99
100
101 all:
102         @echo No target specified.
103
104
105 #
106 # Source files.
107 #
108
109 COMMONFILES = \
110                 attacks.o      \
111                 book.o         \
112                 commondsp.o    \
113                 cursesdsp.o    \
114                 dspwrappers.o  \
115                 eval.o         \
116                 genmove.o      \
117                 globals.o      \
118                 init.o         \
119                 pattern.o      \
120                 rawdsp.o       \
121                 search.o       \
122                 tcontrl.o      \
123                 util.o
124
125 GNUSHOGI_FILES  = $(COMMONFILES) main.o      
126
127
128 PAT2INCFILES    = $(COMMONFILES) makepattern.o pat2inc.o
129
130
131 #
132 # Primary targets.
133 #
134
135 gnushogi:
136         $(CC) $(CFLAGS) -o gnushogi $(GNUSHOGI_FILES) $(LCURSES) $(LIBS)
137
138 pat2inc:
139         $(CC) $(CFLAGS) -o pat2inc $(PAT2INCFILES) $(LCURSES) $(LIBS)
140
141 sizetest:
142         $(CC) $(CFLAGS) -o sizetest sizetest.o $(LIBS)
143
144
145 #
146 # Object files.
147 #
148
149 # Common files.
150
151 attacks.o:
152         $(CC) $(CFLAGS) -c attacks.c
153
154 book.o:
155         $(CC) $(CFLAGS) $(TEXTBOOK) $(BINBOOK) -c book.c 
156
157 commondsp.o:
158         $(CC) $(CFLAGS) -c commondsp.c 
159
160 cursesdsp.o:
161         $(CC) $(CFLAGS) -c cursesdsp.c
162
163 dspwrappers.o:
164         $(CC) $(CFLAGS) -c dspwrappers.c
165
166 genmove.o:
167         $(CC) $(CFLAGS) -c genmove.c
168
169 globals.o:
170         $(CC) $(CFLAGS) -c globals.c
171
172 eval.o:
173         $(CC) $(CFLAGS) -c eval.c
174
175 init.o:
176         $(CC)  $(CFLAGS) $(LANGF) -c init.c
177
178 main.o:
179         $(CC) $(CFLAGS) $(BINBOOK) -c main.c
180
181 # To create "pattern.inc" with "pat2inc", the external
182 # pattern textfile must be used.
183
184 makepattern.o:
185         $(CC) $(CFLAGS) $(PATTERN) -c makepattern.c
186
187 pattern.o:
188         $(CC)  $(CFLAGS) -c pattern.c
189
190 rawdsp.o:
191         $(CC) $(CFLAGS) -c rawdsp.c 
192
193 search.o:
194         $(CC) $(CFLAGS) -c search.c
195
196 tcontrl.o:
197         $(CC) $(CFLAGS) -c tcontrl.c
198
199 util.o:
200         $(CC) $(CFLAGS) -c util.c
201
202
203 # Files specific to particular targets.
204
205 pat2inc.o:
206         $(CC) $(CFLAGS) $(LANGF) $(BINBOOK) $(PATTERN) -c pat2inc.c
207
208 sizetest.o:
209         $(CC) $(CFLAGS) -c sizetest.c
210
211
212 #
213 # Other targets.
214 #
215
216 gnushogi.bbk: 
217         @if [ -f ./gnushogi.bbk ]; then rm ./gnushogi.bbk; fi
218         echo quit > test
219         cat ../misc/gnushogi.tbk > _tmp_t
220         cat test | ./gnushogi -R -b _tmp_t -B ./gnushogi.bbk -S 8000 -P 40 3 0
221         rm test _tmp_t
222         @echo
223
224
225 #
226 # Installation.
227 #
228
229 install: gnushogi
230         strip gnushogi
231         $(INSTALL_PROGRAM) -d $(BINDIR)
232         $(INSTALL_PROGRAM) -d $(LIBDIR)
233         $(INSTALL_PROGRAM) -d $(MANDIR)
234         $(INSTALL_PROGRAM) -d $(INFODIR)
235         $(INSTALL_PROGRAM) gnushogi $(BINDIR)
236         $(INSTALL_DATA)    $(ROOT)/doc/gnushogi.6     $(MANDIR)
237         $(INSTALL_DATA)    $(ROOT)/doc/gnushogi.info* $(INFODIR)
238         $(INSTALL_DATA)    gnushogi.bbk $(LIBDIR)/gnushogi.bbk
239
240
241 #
242 # Cleanup.
243 #
244
245 CLEANFILES = *.o gnushogi sizetest pat2inc CLp* *.bbk
246
247 clean: 
248         @for file in $(CLEANFILES); do \
249         if [ -f $$file ]; then rm $$file; fi; \
250         done
251         @-find . -name gmon.out  -exec rm {} \;
252         @-find . -name '*.bb'    -exec rm {} \;
253         @-find . -name '*.bbg'   -exec rm {} \;
254         @-find . -name '*.da'    -exec rm {} \;
255         @-find . -name '*.gcov'  -exec rm {} \;
256
257
258 #
259 # Dependencies.
260 #
261
262 gnushogi:   $(GNUSHOGI_FILES)
263 pat2inc:       $(PAT2INCFILES)
264 sizetest:      sizetest.o 
265 attacks.o:     attacks.c gnushogi.h ../version.h
266 book.o:        book.c gnushogi.h ../version.h 
267 commondsp.o:   commondsp.c gnushogi.h ../version.h
268 cursesdsp.o:   cursesdsp.c gnushogi.h ../version.h
269 dspwrappers.o: dspwrappers.c gnushogi.h ../version.h
270 genmove.o:     genmove.c gnushogi.h ../version.h
271 globals.o:     globals.c gnushogi.h ../version.h
272 eval.o:        eval.c eval.h gnushogi.h ../version.h pattern.h
273 init.o:        init.c gnushogi.h ../version.h pattern.h
274 main.o:        main.c gnushogi.h ../version.h
275 makepattern.o: pattern.c gnushogi.h pattern.h
276 pattern.o:     pattern.c gnushogi.h pattern.h pattern.inc
277 rawdsp.o:      rawdsp.c gnushogi.h ../version.h
278 search.o:      search.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
284