e99fbd283a210d6e2c4e269d56e538cdbec411d1
[gnushogi.git] / gnushogi / Makefile.am
1 #
2 # Makefile for GNU Shogi
3 #
4 # Copyright (c) 2013 Yann Dirson and the Free Software Foundation
5 #
6 # This file is part of GNU Shogi.
7 #
8 # GNU Shogi is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 1, or (at your option)
11 # any later version.
12 #
13 # GNU Shogi is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 # GNU General Public License for more details.
17 #
18 # You should have received a copy of the GNU General Public License
19 # along with GNU Shogi; see the file COPYING.  If not, write to
20 # the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
21 #
22
23 pkgbindatadir = $(pkglibdir)
24
25 bin_PROGRAMS = gnushogi gnuminishogi
26 noinst_PROGRAMS = pat2inc sizetest
27
28 pkgbindata_DATA = $(top_srcdir)/misc/gnushogi.tbk
29 # gnuminishogi.bbk would be empty
30
31 AM_CFLAGS = @CEXTRAFLAGS@ @WARNINGS@
32
33 # The hashfile is a record of positions seen. It is used by
34 # GNU Shogi to avoid making the same mistakes, a form of learning.
35
36 HASH       = -DHASHFILE=\"$(pkglibdir)/$(PROGNAME).hsh\"
37
38
39 # The "book" is a record of the first few moves, for playing good
40 # moves easily and quickly, saving time, and irritating the human
41 # opponent.
42
43 TEXTBOOK   = -DBOOK=\"$(pkglibdir)/$(PROGNAME).tbk\"
44 BINBOOK    = -DBINBOOK=\"$(pkglibdir)/$(PROGNAME).bbk\"
45
46
47 # The pattern file contains various opening patterns. The program tries to
48 # obtain such a pattern in the opening stage. Sequences of opening
49 # patterns may be described in order to support the correct order of moves.
50
51 gnushogi_CPPFLAGS = \
52         -DHASHFILE=\"$(pkglibdir)/gnushogi.hsh\" \
53         -DBOOK=\"$(pkglibdir)/gnushogi.tbk\" \
54         -DBINBOOK=\"$(pkglibdir)/gnushogi.bbk\"
55 gnuminishogi_CPPFLAGS = \
56         -DMINISHOGI \
57         -DHASHFILE=\"$(pkglibdir)/gnuminishogi.hsh\" \
58         -DBOOK=\"$(pkglibdir)/gnuminishogi.tbk\" \
59         -DBINBOOK=\"$(pkglibdir)/gnuminishogi.bbk\"
60
61 noinst_HEADERS = \
62         book.h \
63         debug.h \
64         eval.h \
65         gnushogi.h \
66         opts.h \
67         pattern.h
68
69 COMMONSOURCES =         \
70         globals.c       \
71         init-common.c   \
72         pattern-common.c
73
74 NOTCOMMONFILES =       \
75         attacks.c      \
76         book.c         \
77         commondsp.c    \
78         eval.c         \
79         genmove.c      \
80         init.c         \
81         pattern.c      \
82         rawdsp.c       \
83         search.c       \
84         tcontrl.c      \
85         util.c
86
87 gnushogi_SOURCES = \
88         main.c \
89         $(NOTCOMMONFILES) \
90         $(COMMONSOURCES)
91 gnuminishogi_SOURCES = \
92         main.c \
93         $(NOTCOMMONFILES) \
94         $(COMMONSOURCES)
95
96 EXTRA_gnushogi_SOURCES = \
97         cursesdsp.c
98 EXTRA_gnuminishogi_SOURCES = \
99         cursesdsp.c
100
101 BUILT_SOURCES = \
102         gnushogi-pattern.inc \
103         gnuminishogi-pattern.inc
104
105 gnushogi_DEPENDENCIES = @CURSESDSP@
106 gnushogi_LDADD = @CURSESDSP@ @LIBCURSES@
107 gnuminishogi_DEPENDENCIES = @CURSESDSPMINI@
108 gnuminishogi_LDADD = @CURSESDSPMINI@ @LIBCURSES@
109
110 pat2inc_SOURCES = \
111         pat2inc.c \
112         makepattern.c \
113         $(COMMONSOURCES)
114
115 pat2inc_LDADD = @LIBCURSES@
116
117 gnushogi-pattern.inc: $(top_srcdir)/misc/gnushogi.pat pat2inc$(EXEEXT)
118         ./pat2inc $< $@
119 gnuminishogi-pattern.inc: $(top_srcdir)/misc/gnuminishogi.pat pat2inc$(EXEEXT)
120         ./pat2inc $< $@
121
122 # optional support for prebuilding a bbk
123
124 gnushogi.bbk: $(top_srcdir)/misc/gnushogi.tbk gnushogi$(EXEEXT)
125         rm -f $@
126         cat $< > _tmp_t
127         echo quit | ./gnushogi -R -b _tmp_t -B $@ -S 8000 -P 40 3 0
128         rm _tmp_t
129 gnuminishogi.bbk: $(top_srcdir)/misc/gnuminishogi.tbk gnuminishogi$(EXEEXT)
130         rm -f $@
131         cat $< > _tmp_t
132         echo quit | ./gnuminishogi -R -b _tmp_t -B $@ -S 8000 -P 40 3 0
133         rm _tmp_t