2 # Makefile for GNU Shogi and xshogi
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
8 # GNU Shogi is based on GNU Chess
9 # Copyright (c) 1992 Free Software Foundation
11 # This file is part of GNU Shogi.
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)
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.
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.
29 BUILDROOT = @top_builddir@
30 GNUSHOGIDIR = $(BUILDROOT)/gnushogi
31 XSHOGIDIR = $(BUILDROOT)/xshogi
39 all : gnushogi_compile pat2inc bbk @XSHOGI@
47 -cd $(GNUSHOGIDIR) && $(MAKE) $(PROGNAME)
50 -cd $(GNUSHOGIDIR) && $(MAKE) pat2inc
53 -cd $(GNUSHOGIDIR) && $(MAKE) sizetest
56 -cd $(XSHOGIDIR) && $(MAKE)
59 -cd $(GNUSHOGIDIR) && $(MAKE) $(PROGNAME).bbk
63 # Alien target architectures
66 win32/Makefile: misc/mkmakefile.mingw-on-cygwin
73 install: gnushogi_install @XSHOGIINSTALL@
76 -cd $(GNUSHOGIDIR) && $(MAKE) install
78 xshogi_install: $(XSHOGIDIR)/xshogi
79 -cd $(XSHOGIDIR) && $(MAKE) install
87 clean: gnushogi_clean @XSHOGICLEAN@ doc_clean
90 cd $(GNUSHOGIDIR) && $(MAKE) clean
93 cd $(XSHOGIDIR) && $(MAKE) clean
96 cd $(BUILDROOT)/doc && $(MAKE) clean
100 # Building a distribution.
103 DISTNAME = @PACKAGE_TARNAME@-@PACKAGE_VERSION@
106 $(MAKE) maintainerclean
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)
117 # Return to a pristine pre-configuration state.
121 config.cache config.log config.status config.h Makefile \
122 $(GNUSHOGIDIR)/Makefile $(GNUSHOGIDIR)/Makefile.profile \
123 $(XSHOGIDIR)/Makefile autom4te.cache
126 rm -rf $(DISTCLEANFILES)
127 find -name '*~' | xargs rm -f
128 cd $(BUILDROOT)/doc && $(MAKE) distclean
131 # Extra cleanup, for the maintainer only.
134 MAINTAINERCLEANFILES = configure config.h.in win32/Makefile
136 maintainerclean: distclean
137 rm -f $(MAINTAINERCLEANFILES)
138 cd $(BUILDROOT)/doc && $(MAKE) maintainerclean