Fix various regression for building out of tree.
[gnushogi.git] / gnushogi / Makefile.in
index 47f5b6c..1596717 100644 (file)
@@ -11,8 +11,8 @@
 #
 # 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
@@ -60,7 +60,7 @@ INFODIR = $(prefix)/info
 LIBS    = -lm
 
 # Display routines.
-LCURSES =   -lcurses -ltermcap
+LCURSES = @LIBCURSES@
 
 
 #
@@ -71,7 +71,7 @@ CC          = @CC@
 CWARNINGS   = @WARNINGS@
 CEXTRAFLAGS = @CEXTRAFLAGS@
 CFLAGS      = @CFLAGS@ $(CEXTRAFLAGS) $(CWARNINGS) -I$(ROOT) -I@top_builddir@
-
+LDFLAGS     = @LDFLAGS@
 
 # The hashfile is a record of positions seen. It is used by
 # GNU Shogi to avoid making the same mistakes, a form of learning.
@@ -87,17 +87,11 @@ TEXTBOOK   = -DBOOK=\"$(LIBDIR)/gnushogi.tbk\"
 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\"
+PATTERN    = -DPATTERNFILE=\"$(ROOT)/misc/gnushogi.pat\"
 
 
 all:
@@ -112,7 +106,7 @@ COMMONFILES = \
                 attacks.o      \
                 book.o         \
                 commondsp.o    \
-                cursesdsp.o    \
+                @CURSESDSP@    \
                 dspwrappers.o  \
                 eval.o         \
                 genmove.o      \
@@ -121,7 +115,6 @@ COMMONFILES = \
                 pattern.o      \
                 rawdsp.o       \
                 search.o       \
-                sysdeps.o      \
                 tcontrl.o      \
                 util.o
 
@@ -136,13 +129,13 @@ PAT2INCFILES    = $(COMMONFILES) makepattern.o pat2inc.o
 #
 
 gnushogi:
-       $(CC) $(CFLAGS) -o gnushogi $(GNUSHOGI_FILES) $(LCURSES) $(LIBS)
+       $(CC) $(CFLAGS) -o gnushogi $(GNUSHOGI_FILES) $(LDFLAGS) $(LCURSES) $(LIBS)
 
 pat2inc:
-       $(CC) $(CFLAGS) -o pat2inc $(PAT2INCFILES) $(LCURSES) $(LIBS)
+       $(CC) $(CFLAGS) -o pat2inc $(PAT2INCFILES) $(LDFLAGS) $(LCURSES) $(LIBS)
 
 sizetest:
-       $(CC) $(CFLAGS) -o sizetest sizetest.o $(LIBS)
+       $(CC) $(CFLAGS) -o sizetest sizetest.o $(LDFLAGS) $(LIBS)
 
 profile:
        $(MAKE) -f Makefile.profile gnushogi
@@ -178,7 +171,7 @@ eval.o: eval.c
        $(CC) $(CFLAGS) -c $<
 
 init.o: init.c
-       $(CC)  $(CFLAGS) $(LANGF) -c $<
+       $(CC)  $(CFLAGS) -c $<
 
 main.o: main.c
        $(CC) $(CFLAGS) $(BINBOOK) -c $<
@@ -198,9 +191,6 @@ rawdsp.o: rawdsp.c
 search.o: search.c
        $(CC) $(CFLAGS) -c $<
 
-sysdeps.o: sysdeps.c
-       $(CC) $(CFLAGS) -c $<
-
 tcontrl.o: tcontrl.c
        $(CC) $(CFLAGS) -c $<
 
@@ -211,7 +201,7 @@ util.o: util.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 $<
@@ -265,23 +255,22 @@ clean:
 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
-sysdeps.o:     sysdeps.c gnushogi.h $(ROOT)/version.h
-tcontrl.o:     tcontrl.c gnushogi.h $(ROOT)/version.h
-util.o:        util.c gnushogi.h $(ROOT)/version.h
+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