#
# 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
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
# 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 \
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
init.o: init.c
$(CC) $(CFLAGS) -c $<
+init-common.o: init-common.c
+ $(CC) $(CFLAGS) $(LANGF) -c $<
+
main.o: main.c
$(CC) $(CFLAGS) $(BINBOOK) -c $<
pattern.o: pattern.c
$(CC) $(CFLAGS) -c $<
+pattern-common.o: pattern-common.c
+ $(CC) $(CFLAGS) -c $<
+
rawdsp.o: rawdsp.c
$(CC) $(CFLAGS) -c $<
sizetest.o: sizetest.c
$(CC) $(CFLAGS) -c $<
+pattern.inc: $(PATTERNFILE) pat2inc
+ ./pat2inc
#
# Other targets.
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
+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