2 # Makefile for XShogi, part of GNU shogi.
4 # Copyright (c) 1993 Matthias Mutz
5 # Copyright (c) 1998, 1999 Michael C. Vanier and the Free Software Foundation
7 # XShogi 1.1 is based on XBoard 2.0
8 # Copyright (c) 1992 Free Software Foundation
10 # This file is part of XShogi.
12 # XShogi 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)
17 # XShogi 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.
22 # You should have received a copy of the GNU General Public License
23 # along with XShogi; see the file COPYING. If not, write to
24 # the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
28 # xshogi is the X Windows-based user interface for GNU Shogi.
34 INSTALL_DATA = @INSTALL_DATA@
35 INSTALL_PROGRAM = @INSTALL_PROGRAM@
43 # Installation directories.
47 BINDIR = $(prefix)/bin
48 MANDIR = $(prefix)/man/man6
60 # C compiler and compiler options.
64 XINCLUDES = @X_CFLAGS@
65 CWARNINGS = @WARNINGS@
66 CEXTRAFLAGS = @CEXTRAFLAGS@
67 CFLAGS = @CFLAGS@ $(CEXTRAFLAGS) $(XINCLUDES) -I$(ROOT) -I@top_builddir@
69 XLIBS = @X_LIBS@ -lXaw -lXmu -lXt -lXext -lX11
70 LDFLAGS = @LDFLAGS@ $(XLIBS) $(LIBS)
74 FIRST_SHOGI_PROGRAM = -DFIRST_SHOGI_PROGRAM=\"@FIRST_SHOGI_PROGRAM@\"
75 SECOND_SHOGI_PROGRAM = -DSECOND_SHOGI_PROGRAM=\"@SECOND_SHOGI_PROGRAM@\"
76 FIRST_HOST = -DFIRST_HOST=\"@FIRST_HOST@\"
77 SECOND_HOST = -DSECOND_HOST=\"@SECOND_HOST@\"
87 $(CC) -o xshogi xshogi.o parser.o $(CFLAGS) $(LDFLAGS)
90 $(CC) -c $< $(CWARNINGS) $(CFLAGS) \
91 $(OPT) $(FIRST_SHOGI_PROGRAM) $(SECOND_SHOGI_PROGRAM) \
92 $(FIRST_HOST) $(SECOND_HOST)
96 # Regenerate the parser. NOTE: scanner.c is never compiled; it
97 # is #included into parser.y.
101 $(CC) $(CFLAGS) -I$(SRCDIR) -c $<
109 mv lex.yy.c scanner.c
125 $(INSTALL_PROGRAM) -d $(BINDIR)
126 $(INSTALL_PROGRAM) -d $(MANDIR)
127 $(INSTALL_PROGRAM) xshogi $(BINDIR)
128 $(INSTALL_DATA) $(ROOT)/doc/xshogi.6 $(MANDIR)
135 CLEANFILES = xshogi *.o parser.c y.tab.c scanner.c lex.yy.c
138 for file in $(CLEANFILES); do \
139 if [ -f $$file ]; then rm $$file; fi; \
147 xshogi: xshogi.o parser.o
148 xshogi.o: xshogi.c $(SRCDIR)/sysdeps.h $(SRCDIR)/xshogi.h $(SRCDIR)/bitmaps.h $(ROOT)/version.h ../config.h
149 parser.o: parser.c $(SRCDIR)/xshogi.h
150 parser.c: parser.y scanner.c