XBoard: split printing of the features line for clarity.
[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 EXTRA_PROGRAMS = pat2inc
28
29 pkgbindata_DATA = $(top_srcdir)/misc/gnushogi.tbk
30 # gnuminishogi.bbk would be empty
31
32 AM_CFLAGS = @CEXTRAFLAGS@ @WARNINGS@
33
34 # The hashfile is a record of positions seen. It is used by
35 # GNU Shogi to avoid making the same mistakes, a form of learning.
36
37 HASH       = -DHASHFILE=\"$(pkglibdir)/$(PROGNAME).hsh\"
38
39
40 # The "book" is a record of the first few moves, for playing good
41 # moves easily and quickly, saving time, and irritating the human
42 # opponent.
43
44 TEXTBOOK   = -DBOOK=\"$(pkglibdir)/$(PROGNAME).tbk\"
45 BINBOOK    = -DBINBOOK=\"$(pkglibdir)/$(PROGNAME).bbk\"
46
47
48 # The pattern file contains various opening patterns. The program tries to
49 # obtain such a pattern in the opening stage. Sequences of opening
50 # patterns may be described in order to support the correct order of moves.
51
52 gnushogi_CPPFLAGS = \
53         -DHASHFILE=\"$(pkglibdir)/gnushogi.hsh\" \
54         -DBOOK=\"$(pkglibdir)/gnushogi.tbk\" \
55         -DBINBOOK=\"$(pkglibdir)/gnushogi.bbk\"
56 gnuminishogi_CPPFLAGS = \
57         -DMINISHOGI \
58         -DHASHFILE=\"$(pkglibdir)/gnuminishogi.hsh\" \
59         -DBOOK=\"$(pkglibdir)/gnuminishogi.tbk\" \
60         -DBINBOOK=\"$(pkglibdir)/gnuminishogi.bbk\"
61
62 BUILTHEADERS = \
63         gnushogi-pattern.inc \
64         gnuminishogi-pattern.inc
65
66 noinst_HEADERS = \
67         $(BUILTHEADERS) \
68         book.h \
69         debug.h \
70         eval.h \
71         gnushogi.h \
72         opts.h \
73         pattern.h
74
75 COMMONSOURCES =         \
76         globals.c       \
77         init-common.c   \
78         pattern-common.c
79
80 NOTCOMMONFILES =       \
81         attacks.c      \
82         book.c         \
83         commondsp.c    \
84         eval.c         \
85         genmove.c      \
86         init.c         \
87         pattern.c      \
88         rawdsp.c       \
89         search.c       \
90         tcontrl.c      \
91         util.c
92
93 gnushogi_SOURCES = \
94         main.c \
95         $(NOTCOMMONFILES) \
96         $(COMMONSOURCES)
97 gnuminishogi_SOURCES = \
98         main.c \
99         $(NOTCOMMONFILES) \
100         $(COMMONSOURCES)
101
102 EXTRA_gnushogi_SOURCES = \
103         cursesdsp.c
104 EXTRA_gnuminishogi_SOURCES = \
105         cursesdsp.c
106
107 BUILT_SOURCES = $(BUILTHEADERS)
108
109 gnushogi_DEPENDENCIES = @CURSESDSP@
110 gnushogi_LDADD = @CURSESDSP@ @LIBCURSES@
111 gnuminishogi_DEPENDENCIES = @CURSESDSPMINI@
112 gnuminishogi_LDADD = @CURSESDSPMINI@ @LIBCURSES@
113
114 pat2inc_SOURCES = \
115         pat2inc.c \
116         makepattern.c \
117         $(COMMONSOURCES)
118
119 pat2inc_LDADD = @LIBCURSES@
120
121 gnushogi-pattern.inc: $(top_srcdir)/misc/gnushogi.pat @PAT2INCEXE@
122         ./pat2inc $< $@
123 gnuminishogi-pattern.inc: $(top_srcdir)/misc/gnuminishogi.pat @PAT2INCEXE@
124         ./pat2inc $< $@
125
126 # just get *.inc generated
127 gnushogi_bootstrap: $(BUILTHEADERS)
128         :
129
130 # optional support for prebuilding a bbk
131
132 gnushogi.bbk: $(top_srcdir)/misc/gnushogi.tbk gnushogi$(EXEEXT)
133         rm -f $@
134         cat $< > _tmp_t
135         echo quit | ./gnushogi -R -b _tmp_t -B $@ -S 8000 -P 40 3 0
136         rm _tmp_t
137 gnuminishogi.bbk: $(top_srcdir)/misc/gnuminishogi.tbk gnuminishogi$(EXEEXT)
138         rm -f $@
139         cat $< > _tmp_t
140         echo quit | ./gnuminishogi -R -b _tmp_t -B $@ -S 8000 -P 40 3 0
141         rm _tmp_t