#
# GNU Shogi is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either ../version 3 of the License, or (at your option)
-# any later ../version.
+# the Free Software Foundation; either version 3 of the License, or (at your option)
+# any later version.
#
# GNU Shogi is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
LIBS = -lm
# Display routines.
-LCURSES = -lcurses -ltermcap
+LCURSES = @LIBCURSES@
#
CC = @CC@
CWARNINGS = @WARNINGS@
CEXTRAFLAGS = @CEXTRAFLAGS@
-CFLAGS = @CFLAGS@ $(CEXTRAFLAGS) $(CWARNINGS) -I$(ROOT) -I@top_builddir@
+CFLAGS = @CFLAGS@ $(CEXTRAFLAGS) $(CWARNINGS) -I$(ROOT) -I@top_builddir@ -I.
LDFLAGS = @LDFLAGS@
# The hashfile is a record of positions seen. It is used by
BINBOOK = -DBINBOOK=\"$(LIBDIR)/gnushogi.bbk\"
-# The language file describes capabilities of the program. It may
-# be useful for customizing gnushogi for non-English-speaking players.
-
-LANGF = -DLANGFILE=\"../misc/gnushogi.lng\"
-
-
# The pattern file contains various opening patterns. The program tries to
# obtain such a pattern in the opening stage. Sequences of opening
# patterns may be described in order to support the correct order of moves.
-PATTERN = -DPATTERNFILE=\"../misc/gnushogi.pat\"
+PATTERNFILE=$(ROOT)/misc/gnushogi.pat
+PATTERN = -DPATTERNFILE=\"$(PATTERNFILE)\"
all:
#
COMMONFILES = \
+ globals.o \
+ init-common.o \
+ pattern-common.o
+
+NOTCOMMONFILES = \
attacks.o \
book.o \
commondsp.o \
- cursesdsp.o \
+ @CURSESDSP@ \
dspwrappers.o \
eval.o \
genmove.o \
- globals.o \
init.o \
pattern.o \
rawdsp.o \
tcontrl.o \
util.o
-GNUSHOGI_FILES = $(COMMONFILES) main.o
+GNUSHOGI_FILES = $(COMMONFILES) $(NOTCOMMONFILES) main.o
PAT2INCFILES = $(COMMONFILES) makepattern.o pat2inc.o
$(CC) $(CFLAGS) -c $<
init.o: init.c
+ $(CC) $(CFLAGS) -c $<
+
+init-common.o: init-common.c
$(CC) $(CFLAGS) $(LANGF) -c $<
main.o: main.c
pattern.o: pattern.c
$(CC) $(CFLAGS) -c $<
+pattern-common.o: pattern-common.c
+ $(CC) $(CFLAGS) -c $<
+
rawdsp.o: rawdsp.c
$(CC) $(CFLAGS) -c $<
# Files specific to particular targets.
pat2inc.o: pat2inc.c
- $(CC) $(CFLAGS) $(LANGF) $(BINBOOK) $(PATTERN) -c $<
+ $(CC) $(CFLAGS) $(BINBOOK) $(PATTERN) -c $<
sizetest.o: sizetest.c
$(CC) $(CFLAGS) -c $<
+pattern.inc: $(PATTERNFILE) pat2inc
+ ./pat2inc
#
# Other targets.
gnushogi: $(GNUSHOGI_FILES)
pat2inc: $(PAT2INCFILES)
sizetest: sizetest.o
-attacks.o: attacks.c gnushogi.h $(ROOT)/version.h
-book.o: book.c gnushogi.h $(ROOT)/version.h
-commondsp.o: commondsp.c gnushogi.h $(ROOT)/version.h
-cursesdsp.o: cursesdsp.c gnushogi.h $(ROOT)/version.h
-dspwrappers.o: dspwrappers.c gnushogi.h $(ROOT)/version.h
-genmove.o: genmove.c gnushogi.h $(ROOT)/version.h
-globals.o: globals.c gnushogi.h $(ROOT)/version.h
-eval.o: eval.c eval.h gnushogi.h $(ROOT)/version.h $(SRCDIR)/pattern.h
-init.o: init.c gnushogi.h $(ROOT)/version.h $(SRCDIR)/pattern.h
-main.o: main.c gnushogi.h $(ROOT)/version.h
+attacks.o: attacks.c gnushogi.h
+book.o: book.c gnushogi.h
+commondsp.o: commondsp.c gnushogi.h
+cursesdsp.o: cursesdsp.c gnushogi.h
+dspwrappers.o: dspwrappers.c gnushogi.h
+genmove.o: genmove.c gnushogi.h
+globals.o: globals.c gnushogi.h
+eval.o: eval.c eval.h gnushogi.h $(SRCDIR)/pattern.h
+init.o: init.c gnushogi.h $(SRCDIR)/pattern.h
+main.o: main.c gnushogi.h
makepattern.o: pattern.c gnushogi.h $(SRCDIR)/pattern.h
-pattern.o: pattern.c gnushogi.h $(SRCDIR)/pattern.h $(SRCDIR)/pattern.inc
-rawdsp.o: rawdsp.c gnushogi.h $(ROOT)/version.h
-search.o: search.c gnushogi.h $(ROOT)/version.h
-tcontrl.o: tcontrl.c gnushogi.h $(ROOT)/version.h
-util.o: util.c gnushogi.h $(ROOT)/version.h
+pattern.o: pattern.c gnushogi.h $(SRCDIR)/pattern.h pattern.inc
+rawdsp.o: rawdsp.c gnushogi.h
+search.o: search.c gnushogi.h
+tcontrl.o: tcontrl.c gnushogi.h
+util.o: util.c gnushogi.h
pat2inc.o: pat2inc.c $(SRCDIR)/pattern.h $(SRCDIR)/gnushogi.h
sizetest.o: sizetest.c $(SRCDIR)/gnushogi.h $(SRCDIR)/eval.h
gnushogi.bbk: gnushogi