4293c578381123377e031f9e6aa9b42b72bc8167
[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 # Copyright (c) 2008, 2013, 2014 Yann Dirson and the Free Software Foundation
7 #
8 # GNU Shogi is based on GNU Chess
9 # Copyright (c) 1992 Free Software Foundation
10 #
11 # This file is part of GNU Shogi.
12 #
13 # GNU Shogi is free software; you can redistribute it and/or modify
14 # it under the terms of the GNU General Public License as published by
15 # the Free Software Foundation; either version 1, or (at your option)
16 # any later version.
17 #
18 # GNU Shogi is distributed in the hope that it will be useful,
19 # but WITHOUT ANY WARRANTY; without even the implied warranty of
20 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21 # GNU General Public License for more details.
22 #
23 # You should have received a copy of the GNU General Public License
24 # along with GNU Shogi; see the file COPYING.  If not, write to
25 # the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
26 #
27
28 ROOT        = @top_srcdir@
29 BUILDROOT   = @top_builddir@
30 GNUSHOGIDIR = $(BUILDROOT)/gnushogi
31 XSHOGIDIR   = $(BUILDROOT)/xshogi
32
33 PROGNAME = @PROGNAME@
34
35 #
36 # Default targets.
37 #
38
39 all : gnushogi_compile pat2inc bbk @XSHOGI@
40
41
42 #
43 # Primary targets.
44 #
45
46 gnushogi_compile:
47         -cd $(GNUSHOGIDIR) && $(MAKE) $(PROGNAME)
48
49 pat2inc:
50         -cd $(GNUSHOGIDIR) && $(MAKE) pat2inc
51
52 sizetest:
53         -cd $(GNUSHOGIDIR) && $(MAKE) sizetest
54
55 xshogi_compile:
56         -cd $(XSHOGIDIR) && $(MAKE)
57
58 bbk:
59         -cd $(GNUSHOGIDIR) && $(MAKE) $(PROGNAME).bbk
60
61
62 #
63 # Alien target architectures
64 #
65
66 win32/Makefile: misc/mkmakefile.mingw-on-cygwin
67         $<
68
69 #
70 # Installation.
71 #
72
73 install: gnushogi_install @XSHOGIINSTALL@
74
75 gnushogi_install:
76         -cd $(GNUSHOGIDIR) && $(MAKE) install
77
78 xshogi_install: $(XSHOGIDIR)/xshogi
79         -cd $(XSHOGIDIR) && $(MAKE) install
80
81
82
83 #
84 # Cleanup.
85 #
86
87 clean: gnushogi_clean @XSHOGICLEAN@ doc_clean
88
89 gnushogi_clean:
90         cd $(GNUSHOGIDIR) && $(MAKE) clean
91
92 xshogi_clean:
93         cd $(XSHOGIDIR) && $(MAKE) clean
94
95 doc_clean:
96         cd $(BUILDROOT)/doc && $(MAKE) clean
97
98
99 #
100 # Building a distribution.
101 #
102
103 DISTNAME = @PACKAGE_TARNAME@-@PACKAGE_VERSION@
104
105 dist:
106         $(MAKE) maintainerclean
107         rm -rf $(DISTNAME)
108         mkdir $(DISTNAME)
109         tar -cf - --exclude .git --exclude $(DISTNAME) $(ROOT) | (cd $(DISTNAME) && tar -xf -)
110         cd $(DISTNAME) && $(ROOT)/autogen.sh && $(ROOT)/configure
111         cd $(DISTNAME)/doc && $(MAKE) info
112         cd $(DISTNAME) && $(MAKE) win32/Makefile
113         cd $(DISTNAME) && $(MAKE) distclean
114         tar -zcf $(DISTNAME).tar.gz $(DISTNAME)
115
116 #
117 # Return to a pristine pre-configuration state.
118 #
119
120 DISTCLEANFILES = \
121         config.cache config.log config.status config.h Makefile \
122     $(GNUSHOGIDIR)/Makefile $(GNUSHOGIDIR)/Makefile.profile \
123     $(XSHOGIDIR)/Makefile autom4te.cache
124
125 distclean: clean
126         rm -rf $(DISTCLEANFILES)
127         find -name '*~' | xargs rm -f
128         cd $(BUILDROOT)/doc && $(MAKE) distclean
129
130 #
131 # Extra cleanup, for the maintainer only.
132 #
133
134 MAINTAINERCLEANFILES = configure config.h.in win32/Makefile
135
136 maintainerclean: distclean
137         rm -f $(MAINTAINERCLEANFILES)
138         cd $(BUILDROOT)/doc && $(MAKE) maintainerclean