Stop hardcoding filenames inside pat2inc, use commandline parameters.
[gnushogi.git] / Makefile.in
1 #
2 # Makefile for GNU Shogi and xshogi
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 1, 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.  If not, write to
24 # the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
25 #
26
27 ROOT        = @top_srcdir@
28 BUILDROOT   = @top_builddir@
29 GNUSHOGIDIR = $(BUILDROOT)/gnushogi
30 XSHOGIDIR   = $(BUILDROOT)/xshogi
31
32 PROGNAME = @PROGNAME@
33
34 #
35 # Default targets.
36 #
37
38 all : gnushogi_compile pat2inc bbk @XSHOGI@
39
40
41 #
42 # Primary targets.
43 #
44
45 gnushogi_compile:
46         -cd $(GNUSHOGIDIR) && $(MAKE) $(PROGNAME)
47
48 pat2inc:
49         -cd $(GNUSHOGIDIR) && $(MAKE) pat2inc
50
51 sizetest:
52         -cd $(GNUSHOGIDIR) && $(MAKE) sizetest
53
54 xshogi_compile:
55         -cd $(XSHOGIDIR) && $(MAKE)
56
57 bbk:
58         -cd $(GNUSHOGIDIR) && $(MAKE) $(PROGNAME).bbk
59
60
61 #
62 # Alien target architectures
63 #
64
65 win32/Makefile: misc/mkmakefile.mingw-on-cygwin
66         $<
67
68 #
69 # Installation.
70 #
71
72 install: gnushogi_install @XSHOGIINSTALL@
73
74 gnushogi_install:
75         -cd $(GNUSHOGIDIR) && $(MAKE) install
76
77 xshogi_install: $(XSHOGIDIR)/xshogi
78         -cd $(XSHOGIDIR) && $(MAKE) install
79
80
81
82 #
83 # Cleanup.
84 #
85
86 clean: gnushogi_clean @XSHOGICLEAN@ doc_clean
87
88 gnushogi_clean:
89         cd $(GNUSHOGIDIR) && $(MAKE) clean
90
91 xshogi_clean:
92         cd $(XSHOGIDIR) && $(MAKE) clean
93
94 doc_clean:
95         cd $(BUILDROOT)/doc && $(MAKE) clean
96
97
98 #
99 # Building a distribution.
100 #
101
102 DISTNAME = @PACKAGE_TARNAME@-@PACKAGE_VERSION@
103
104 dist:
105         $(MAKE) maintainerclean
106         rm -rf $(DISTNAME)
107         mkdir $(DISTNAME)
108         tar -cf - --exclude .git --exclude $(DISTNAME) $(ROOT) | (cd $(DISTNAME) && tar -xf -)
109         cd $(DISTNAME) && $(ROOT)/autogen.sh && $(ROOT)/configure
110         cd $(DISTNAME)/doc && $(MAKE) info
111         cd $(DISTNAME) && $(MAKE) win32/Makefile
112         cd $(DISTNAME) && $(MAKE) distclean
113         tar -zcf $(DISTNAME).tar.gz $(DISTNAME)
114
115 #
116 # Return to a pristine pre-configuration state.
117 #
118
119 DISTCLEANFILES = \
120         config.cache config.log config.status config.h Makefile \
121     $(GNUSHOGIDIR)/Makefile $(GNUSHOGIDIR)/Makefile.profile \
122     $(XSHOGIDIR)/Makefile autom4te.cache
123
124 distclean: clean
125         rm -rf $(DISTCLEANFILES)
126         find -name '*~' | xargs rm -f
127         cd $(BUILDROOT)/doc && $(MAKE) distclean
128
129 #
130 # Extra cleanup, for the maintainer only.
131 #
132
133 MAINTAINERCLEANFILES = configure config.h.in win32/Makefile
134
135 maintainerclean: distclean
136         rm -f $(MAINTAINERCLEANFILES)
137         cd $(BUILDROOT)/doc && $(MAKE) maintainerclean