Start of a "make dist" target.
[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 VERSION     = 1.3.2
28 GNUSHOGIDIR = ./gnushogi
29 XSHOGIDIR   = ./xshogi
30
31 #
32 # Default targets.
33 #
34
35 all : gnushogi_compile pat2inc gnushogi.bbk @XSHOGI@ 
36
37
38 #
39 # Primary targets.
40 #
41
42 gnushogi_compile:
43         -cd $(GNUSHOGIDIR); $(MAKE) gnushogi
44
45 pat2inc:
46         -cd $(GNUSHOGIDIR); $(MAKE) pat2inc
47
48 sizetest:
49         -cd $(GNUSHOGIDIR); $(MAKE) sizetest
50
51 xshogi_compile:
52         -cd $(XSHOGIDIR); $(MAKE)
53
54 gnushogi.bbk:
55         -cd $(GNUSHOGIDIR); $(MAKE) gnushogi.bbk
56
57
58 #
59 # Installation.
60 #
61
62 install: gnushogi_install @XSHOGIINSTALL@
63
64 gnushogi_install:
65         -cd $(GNUSHOGIDIR); $(MAKE) install
66
67 xshogi_install: $(XSHOGIDIR)/xshogi
68         -cd $(XSHOGIDIR); $(MAKE) install
69
70
71
72 #
73 # Cleanup.
74 #
75
76 clean: gnushogi_clean @XSHOGICLEAN@ doc_clean
77
78 gnushogi_clean:
79         cd $(GNUSHOGIDIR); $(MAKE) clean
80
81 xshogi_clean:
82         cd $(XSHOGIDIR); $(MAKE) clean
83
84 doc_clean:
85         cd doc; $(MAKE) clean
86
87
88 #
89 # Building a distribution.
90 #
91
92 DISTNAME = @PACKAGE_TARNAME@-@PACKAGE_VERSION@
93
94 dist:
95         $(MAKE) maintainerclean
96         rm -rf $(DISTNAME)
97         mkdir $(DISTNAME)
98         tar -cf - --exclude .git . | (cd $(DISTNAME) && tar -xf -)
99         cd $(DISTNAME) && ./autogen.sh && ./configure
100         cd $(DISTNAME)/doc && $(MAKE) info
101         cd $(DISTNAME) && make distclean
102         tar -zcf $(DISTNAME).tar.gz $(DISTNAME)
103
104 #
105 # Return to a pristine pre-configuration state.
106 #
107
108 DISTCLEANFILES = \
109         config.cache config.log config.status config.h Makefile \
110     $(GNUSHOGIDIR)/Makefile $(GNUSHOGIDIR)/Makefile.profile \
111     $(XSHOGIDIR)/Makefile autom4te.cache
112
113 distclean: clean
114         rm -rf $(DISTCLEANFILES)
115         cd doc; $(MAKE) distclean
116
117 #
118 # Extra cleanup, for the maintainer only.
119 #
120
121 MAINTAINERCLEANFILES = configure config.h.in
122
123 maintainerclean: distclean
124         rm -f $(MAINTAINERCLEANFILES)
125         cd doc; $(MAKE) maintainerclean