acfac5c50a738012765c4e07ac528f33ac05acd1
[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 BUILTHEADERS = \
62         gnushogi-pattern.inc \
63         gnuminishogi-pattern.inc
64
65 noinst_HEADERS = \
66         $(BUILTHEADERS) \
67         book.h \
68         debug.h \
69         eval.h \
70         gnushogi.h \
71         opts.h \
72         pattern.h
73
74 COMMONSOURCES =         \
75         globals.c       \
76         init-common.c   \
77         pattern-common.c
78
79 NOTCOMMONFILES =       \
80         attacks.c      \
81         book.c         \
82         commondsp.c    \
83         eval.c         \
84         genmove.c      \
85         init.c         \
86         pattern.c      \
87         rawdsp.c       \
88         search.c       \
89         tcontrl.c      \
90         util.c
91
92 gnushogi_SOURCES = \
93         main.c \
94         $(NOTCOMMONFILES) \
95         $(COMMONSOURCES)
96 gnuminishogi_SOURCES = \
97         main.c \
98         $(NOTCOMMONFILES) \
99         $(COMMONSOURCES)
100
101 EXTRA_gnushogi_SOURCES = \
102         cursesdsp.c
103 EXTRA_gnuminishogi_SOURCES = \
104         cursesdsp.c
105
106 BUILT_SOURCES = $(BUILTHEADERS)
107
108 gnushogi_DEPENDENCIES = @CURSESDSP@
109 gnushogi_LDADD = @CURSESDSP@ @LIBCURSES@
110 gnuminishogi_DEPENDENCIES = @CURSESDSPMINI@
111 gnuminishogi_LDADD = @CURSESDSPMINI@ @LIBCURSES@
112
113 pat2inc_SOURCES = \
114         pat2inc.c \
115         makepattern.c \
116         $(COMMONSOURCES)
117
118 pat2inc_LDADD = @LIBCURSES@
119
120 gnushogi-pattern.inc: $(top_srcdir)/misc/gnushogi.pat pat2inc$(EXEEXT)
121         ./pat2inc $< $@
122 gnuminishogi-pattern.inc: $(top_srcdir)/misc/gnuminishogi.pat pat2inc$(EXEEXT)
123         ./pat2inc $< $@
124
125 # just get *.inc generated
126 gnushogi_bootstrap: $(BUILTHEADERS)
127         :
128
129 # optional support for prebuilding a bbk
130
131 gnushogi.bbk: $(top_srcdir)/misc/gnushogi.tbk gnushogi$(EXEEXT)
132         rm -f $@
133         cat $< > _tmp_t
134         echo quit | ./gnushogi -R -b _tmp_t -B $@ -S 8000 -P 40 3 0
135         rm _tmp_t
136 gnuminishogi.bbk: $(top_srcdir)/misc/gnuminishogi.tbk gnuminishogi$(EXEEXT)
137         rm -f $@
138         cat $< > _tmp_t
139         echo quit | ./gnuminishogi -R -b _tmp_t -B $@ -S 8000 -P 40 3 0
140         rm _tmp_t