home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 22 gnu / 22-gnu.zip / gnuch40.zip / gnuchess-4.0.pl79 / src / Makefile.os2 < prev    next >
Makefile  |  1999-01-16  |  14KB  |  344 lines

  1. #
  2. # Makefile for GNU Chess
  3. #
  4. # (Use this makefile when compiling under OS/2 using emx 0.9c + gcc 2.7.2.1)
  5. # (Also use GNU make 3.71 or later)
  6. #
  7. # Copyright (c) 1992, 1995 Free Software Foundation
  8. #
  9. # This file is part of GNU CHESS.
  10. #
  11. # GNU Chess is free software; you can redistribute it and/or modify
  12. # it under the terms of the GNU General Public License as published by
  13. # the Free Software Foundation; either version 2, or (at your option)
  14. # any later version.
  15. #
  16. # GNU Chess is distributed in the hope that it will be useful,
  17. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  19. # GNU General Public License for more details.
  20. #
  21. # You should have received a copy of the GNU General Public License
  22. # along with GNU Chess; see the file COPYING.  If not, write to
  23. # the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  24. #
  25.  
  26. #
  27. # gnuchess  is a curses-based chess.
  28. # gnuchessn is a fancy-display-curses-based chess.
  29. # gnuchessr is a plain dumb-terminal chess (but with full variation output)
  30. #
  31.  
  32. # The version number of this GNU release
  33. VERS=   4.0
  34.  
  35. # Relevant file areas.
  36. DIST=   ../README ../README.lang ../doc ../misc ../src ../test
  37.  
  38. # size of book to make
  39. # Listed below are the book options and the size of the resulting book,
  40. # the default is small. Uncomment/comment the BOOKOPTS corresponding to
  41. # the size you want.
  42. #
  43. BOOKOPTS = -S 188000 -P 26     #huge 1450k
  44. #BOOKOPTS = -S 45000 -P 16      #big 540k
  45. #BOOKOPTS = -S 20000 -P 12      #med 240k
  46. #BOOKOPTS = -S 12000 -P 10       #small 144K
  47. #BOOKOPTS = -S 9000 -P 8        #tiny 78K
  48.  
  49. # Distribution directory
  50. DISTDIR= ../..
  51.  
  52. # Programs being distributed
  53. PROGS=gnuchess-4.0.pl74/src gnuchess-4.0.pl74/misc gnuchess-4.0.pl74/doc
  54.  
  55. LIBS = $(DEFFILE) $(LCURSES)
  56.  
  57. BOOK=../book/gnuchess.bk3.gz
  58. #BOOK=../book/gnuchess.gz
  59.  
  60. # Change these if desired, then compile.
  61. # Where the binaries live.
  62. #BINDIR= /gnuchess
  63. #BINDIR1= \gnuchess
  64. BINDIR= .
  65. BINDIR1= .
  66. # Where language description, our book, and the persistent hash live.
  67. #LIBDIR= /gnuchess
  68. #LIBDIR1= \gnuchess
  69. LIBDIR= .
  70. LIBDIR1= .
  71. # Directory to install
  72. INSTDIR=..        #
  73.  
  74. # Display routines.
  75. #LCURSES=-lcurses -ltermcap    # If you want to work via termcap
  76. LCURSES=            # If you have default ANSI screen support
  77.  
  78. # Definitions for LINK386
  79. DEFFILE=gnuchess.def
  80.  
  81. # Table limits from gnuchess.h. These are given default values if not
  82. # set here. The default values are given below, but you may want to
  83. # check gnuchess.h to make sure.
  84. # -Dttblsz=150001 Transposition table size. Small address space computers
  85. #                 might try 8001. Setting ttblsz to 0 removes the transposition
  86. #                 table
  87. # -DBOOKSIZE=250000 Number of unique position/move combinations allowed.
  88. #                   For MSDOS 10000 is used.
  89.  
  90. TABOPT=-DBOOKSIZE=250000 -Dttblsz=150001
  91.  
  92. #compile options for gnuchess
  93. #    Search options
  94. # -DHISTORY use history killer hueristic 
  95. # -DKILLT use killt killer hueristic 
  96. # -DNULLMOVE include null move heuristic
  97. # -DDEEPNULL include deepnull move heuristic
  98. # -DUNLIMITEDCAPS allow unlimited depth captures
  99. # -DPRUNE enable marginal forward pruning
  100. # -DNOMATERIAL don't call it a draw when no pawns and both sides < rook
  101. # -DNODYNALPHA don't dynamically adjust alpha
  102. # -DOLDTIME use old ply time estimating function
  103. # -DCACHE  Cache static evaluations 
  104. # -DNODITHER no random element to evaluations
  105. #
  106. #    Verbosity options
  107. # -DBAREBONES compile for max speed no statictics etc kept
  108. # -DQUIETBACKGROUND don't print post information in background ( easy OFF)
  109. # -DHASHSTATS keep hash table statistics
  110. # -DMORESTATS print more hash table stats
  111. # -DQUIETBOOKGEN Don't print errors while loading a book or generating a binbook
  112. # -DSEMIQUIETBOOKGEN Print less verbose errors while reading book or generating binbook
  113. #
  114. #    Miscellaneous options
  115. # -DHAVE_TIME_H have <time.h> header
  116. # -DHAVE_STRTOUL if your machine supports strtoul() else strtol()
  117. # -DHAVE_GETTIMEOFDAY use gettimeofday for more accurate timing
  118. # -DHAVE_MEMSET if your machine supports memset
  119. # -DECO if you want support for eco database
  120. # -DCLIENT create client version for use with ICS
  121. # -DLONG64 if you have 64bit longs
  122. #
  123. # -DDOSLIKE_ANSI_DISPLAY if you want not to use termcap,
  124. #             you have no curses library or curses display
  125. #             seems starnge
  126. #
  127. #    Some debug options
  128. # -DDEBUG8 dump board,movelist,input move to /tmp/DEBUG if illegal move
  129. # -DDEBUG9 dump move list from test command
  130. # -DDEBUG10 dump board and move after search before !easy begins
  131. # -DDEBUG11 dump board when the move is output
  132. # -DDEBUG12 dump boards between moves
  133. # -DDEBUG13 dump search control information for each move to /tmp/DEBUG
  134. # -DDEBUG33 dump book moves as read from book
  135. # -DDEBUG40 include extra values of variables for debugging  in game list
  136. # -DDEBUG41 dump post output to /tmp/DEBUG
  137. # the rest of the debug options are tied to the debuglevel command
  138. # -DDEBUG -DDEBUG4 set up code for debuglevel command
  139. #          debuglevel
  140. #               1 always force evaluation in evaluate
  141. #               4 print move list after search
  142. #               8 print move list after book before search
  143. #              16 print move list after each ply of search
  144. #              32 print adds to transposition table
  145. #              64 print returns from transposition table lookups
  146. #             128 print evals
  147. #             256 print search tree as it is generated
  148. #             512 debug trace of search tree
  149. #            1024 interactive tree print
  150. #            2048 non-interactive trace print
  151. #
  152. #
  153. ## normal
  154. OPT=  -DUSEINT -DCACHE -DGDX -DNULLMOVE -DWAY4PL64 -DHISTORY \
  155.   -DAGING -DKILLT -DUNLIMITEDCAPS -DPRUNE -DOLDTIME -DHASHSTATS \
  156.   -DHAVE_STRTOUL -DHAVE_MEMSET  -DHAVE_GETTIMEOFDAY -DDOSLIKE_ANSI_DISPLAY \
  157.   $(TABOPT)
  158.  
  159. # The hashfile is a record of positions seen. It is used by
  160. # GNU Chess to avoid making the same mistakes, a form of learning.
  161. HASH=   -DHASHFILE=\"$(LIBDIR)/gnuchess.hash\"
  162.  
  163. # The "book" is a record of the first few moves, for playing good
  164. # moves easily and quickly, saving time, and irritating the human
  165. # opponent.
  166. BINBOOK = -DBINBOOK=\"$(LIBDIR)/gnuchess.dat\"
  167. BINECO = -DBINECO=\"$(LIBDIR)/gnuchess.eco\"
  168. PGNECO = -DPGNECO=\"$(LIBDIR)/eco.pgn\"
  169.  
  170. # The language file describes capabilities of the program. Perhaps
  171. # it is useful for non-English speaking countries and customizing
  172. # for their convenience and chess happiness.
  173. LANGF= -DLANGFILE=\"$(LIBDIR)/gnuchess.lang\" \
  174.        -DSRCLANGFILE=\"../misc/gnuchess.lang\"
  175.  
  176. INSTALL=copy
  177. #INSTALL=install -s
  178.  
  179. # The compiler used for compiling this software.
  180. # Use this for a plain C compiler 
  181. #CC= cc $(OPT)
  182. # Use this for DEC's ANSI C compiler on Ultrix
  183. #CC= c89 $(OPT)
  184. # Use this if you are lucky enough to have GNU CC.
  185. CC= gcc $(OPT)
  186.  
  187. # Miscellaneous CFLAGS. Uncomment the one you need and comment 
  188. # the other.
  189. CFLAGS= -O3 -fomit-frame-pointer -funroll-all-loops -Zmtd -Zomf -pipe -s
  190. #CFLAGS= -O2 -funroll-loops  # gnu cc  
  191. #CFLAGS=  -O2 -p -Dinline=""     -traditional-cpp
  192. #CFLAGS= -O4 -Qpath .  # SunOS cc using unprotoize
  193. #CFLAGS= -O4 # Sun acc
  194. #CFLAGS= -O2 # DEC ANSI C (c89) on Ultrix.
  195. #CFLAGS= +O3 -Aa -D_HPUX_SOURCE  # HPUX cc 
  196. #CFLAGS= -O   -finline-functions -fstrength-reduce -D__mips -D__LANGUAGE_C # gnu cc 1.40 on DS5000
  197. #CFLAGS= -O   -finline-functions -fstrength-reduce  # gnu cc 1.40 on others
  198. #CFLAGS= -O2 -funroll-loops -D__mips -D__LANGUAGE_C # gnu cc 2.00 on DS5000
  199. #CFLAGS= -O2 -D__alpha -D__LANGUAGE_C # gnu cc 2.00 on Flamingo
  200. #CFLAGS= -O2 -funroll-loops -traditional-cpp  # gnu cc  2.00 on SunOS
  201. #CFLAGS= -O2 -acpp -signed -Wp,-traditional # IRIX 5.1.*?
  202. #CFLAGS= -g -cckr -DNOMACROS -Dhuge=""  #Correct flags for gnuchess 4.0 with IRIX cc.
  203.  
  204. all : gnuchess.exe gnuchesr.exe gnuchesn.exe postprint.exe gnuan.exe game.exe gnuchess.dat
  205.  
  206. gnuchess.exe: mainN.obj bookN.obj genmoveN.obj ataks.obj utilN.obj evalN.obj init.obj searchN.obj dspcomN.obj uxdsp.obj
  207.     $(CC) $(CFLAGS) $(HASH) $(LANGF) -o gnuchess.exe mainN.obj bookN.obj genmoveN.obj ataks.obj utilN.obj evalN.obj init.obj searchN.obj dspcomN.obj uxdsp.obj $(LIBS)
  208.  
  209. gnuan.exe: mainN.obj bookG.obj genmoveN.obj ataks.obj utilN.obj evalN.obj init.obj searchG.obj gnuan.obj
  210.     $(CC) $(CFLAGS) $(HASH) $(LANGF) -DIGNUAN -o gnuan.exe mainN.obj bookG.obj genmoveN.obj ataks.obj utilN.obj evalN.obj init.obj searchG.obj gnuan.obj $(LIBS)
  211.  
  212. Dgnuchesr.exe: mainDR.obj bookN.obj genmoveN.obj ataks.obj utilDR.obj evalDR.obj init.obj searchDR.obj dspcomDR.obj nondspDR.obj
  213.     $(CC) -DDEBUG -DDEBUG4 $(CFLAGS) $(HASH) $(LANGF) -o gnuchesr.exe mainDR.obj bookN.obj genmoveN.obj ataks.obj utilDR.obj evalDR.obj init.obj searchDR.obj dspcomDR.obj nondspDR.obj $(LIBS)
  214.  
  215. ecor.exe: mainN.obj eco.obj genmoveN.obj ataks.obj utilN.obj evalN.obj init.obj searchN.obj dspcomR.obj nondspR.obj
  216.     $(CC) $(CFLAGS) $(HASH) $(LANGF) -o ecor.exe mainN.obj eco.obj genmoveN.obj ataks.obj utilN.obj evalN.obj init.obj searchN.obj dspcomR.obj nondspR.obj $(LIBS)
  217.  
  218. gnuchesr.exe: mainN.obj bookN.obj genmoveN.obj ataks.obj utilN.obj evalN.obj init.obj searchN.obj dspcomR.obj nondspR.obj
  219.     $(CC) $(CFLAGS) $(HASH) $(LANGF) -o gnuchesr.exe mainN.obj bookN.obj genmoveN.obj ataks.obj utilN.obj evalN.obj init.obj searchN.obj dspcomR.obj nondspR.obj $(LIBS)
  220.  
  221. gnuchesn.exe: mainN.obj bookN.obj genmoveN.obj ataks.obj utilN.obj evalN.obj init.obj searchN.obj dspcomN.obj nuxdsp.obj
  222.     $(CC) $(CFLAGS) $(HASH) $(LANGF) -o gnuchesn.exe mainN.obj bookN.obj genmoveN.obj ataks.obj utilN.obj evalN.obj init.obj searchN.obj dspcomN.obj nuxdsp.obj $(LIBS)
  223.  
  224. game.exe: game.c gnuchess.h
  225.     $(CC) $(CFLAGS) -o game.exe game.c $(DEFFILE)
  226.     
  227. postprint.exe: postprint.obj
  228.     $(CC) $(CFLAGS) $(HASH) -o postprint.exe postprint.obj $(DEFFILE)
  229.     
  230. gnuan.obj: gnuan.c gnuchess.h version.h
  231.     $(CC) $(CFLAGS) $(HASH) $(LANGF) -DIGNUAN $(BINBOOK) -c gnuan.c
  232.  
  233. mainN.obj: main.c gnuchess.h version.h ttable.h
  234.     $(CC) $(CFLAGS) $(HASH) $(LANGF) $(BINBOOK) -c -o mainN.obj main.c
  235.  
  236. mainDR.obj: main.c gnuchess.h version.h ttable.h
  237.     $(CC) -DDEBUG -DDEBUG4 $(CFLAGS) $(HASH) $(LANGF) $(BINBOOK) -c -o mainDR.obj main.c
  238.  
  239. genmoveN.obj: genmoves.c gnuchess.h version.h ttable.h
  240.     $(CC) $(CFLAGS) $(HASH) $(LANGF) -o genmoveN.obj -c genmoves.c
  241.  
  242. eco.obj: eco.c gnuchess.h version.h ataks.h ttable.h
  243.     $(CC) $(CFLAGS) $(HASH) $(LANGF) $(BINBOOK) $(BINECO) $(PGNECO) -c eco.c
  244.     
  245. bookN.obj: book.c gnuchess.h version.h ataks.h ttable.h
  246.     $(CC) $(CFLAGS) $(HASH) $(LANGF) $(BINBOOK) $(PGNECO) $(BINECO) -c -o bookN.obj book.c
  247.  
  248. bookG.obj: book.c gnuchess.h version.h ataks.h ttable.h
  249.     $(CC) $(CFLAGS) $(HASH) $(LANGF) $(BINBOOK) $(PGNECO) $(BINECO) -DIGNUAN -c -o bookG.obj book.c
  250.  
  251. ataks.obj: ataks.h ataks.c gnuchess.h version.h ttable.h
  252.     $(CC) $(CFLAGS) $(HASH) $(LANGF) -c ataks.c
  253.     
  254. utilN.obj: util.c gnuchess.h version.h
  255.     $(CC) $(CFLAGS) $(HASH) $(LANGF) -c -o utilN.obj util.c
  256.     
  257. evalN.obj: eval.c gnuchess.h version.h ttable.h
  258.     $(CC) $(CFLAGS) $(HASH) $(LANGF) -c -o evalN.obj eval.c
  259.  
  260. evalDR.obj: eval.c gnuchess.h version.h ttable.h
  261.     $(CC) -DDEBUG -DDEBUG4 $(CFLAGS) $(HASH) $(LANGF) -c -o evalDR.obj eval.c
  262.  
  263. init.obj: init.c gnuchess.h version.h ttable.h
  264.     $(CC) $(CFLAGS) $(HASH) $(LANGF) -c init.c
  265.     
  266. searchN.obj: search.c gnuchess.h version.h debug512.h debug10.h debug13.h debug16.h debug256.h debug4.h debug40.h debug41.h debug64.h debug8.h ttable.h ttable.c
  267.     $(CC) $(CFLAGS) $(HASH) $(LANGF) -c -o searchN.obj search.c
  268.  
  269. searchG.obj: search.c gnuchess.h version.h debug512.h debug10.h debug13.h debug16.h debug256.h debug4.h debug40.h debug41.h debug64.h debug8.h ttable.h ttable.c
  270.     $(CC) $(CFLAGS) $(HASH) $(LANGF) -DIGUAN -c -o searchG.obj search.c
  271.  
  272. searchDR.obj: search.c gnuchess.h version.h debug512.h debug10.h debug13.h debug16.h debug256.h debug4.h debug40.h debug41.h debug64.h debug8.h ttable.h ttable.c
  273.     $(CC) -DDEBUG -DDEBUG4 $(CFLAGS) $(HASH) $(LANGF) -c -o searchDR.obj search.c
  274.  
  275. uxdsp.obj: uxdsp.c gnuchess.h version.h
  276.     $(CC) $(CFLAGS) $(HASH) $(LANGF) -c uxdsp.c
  277.     
  278. nuxdsp.obj: nuxdsp.c gnuchess.h version.h
  279.     $(CC) $(CFLAGS) $(HASH) $(LANGF) -c nuxdsp.c
  280.     
  281. nondspR.obj: nondsp.c gnuchess.h version.h
  282.     $(CC) $(CFLAGS) $(HASH) $(LANGF) -DNONDSP -c -o nondspR.obj nondsp.c
  283.  
  284. nondspDR.obj: nondsp.c gnuchess.h version.h
  285.     $(CC) -DDEBUG -DDEBUG4 $(CFLAGS) $(HASH) $(LANGF) -DNONDSP -c -o nondspDR.obj nondsp.c
  286.  
  287. dspcomN.obj: dspcom.c gnuchess.h version.h
  288.     $(CC) $(CFLAGS) $(HASH) $(LANGF) -c -o dspcomN.obj dspcom.c
  289.  
  290. dspcomR.obj: dspcom.c gnuchess.h version.h
  291.     $(CC) $(CFLAGS) $(HASH) $(LANGF) -DNONDSP -c -o dspcomR.obj dspcom.c
  292.  
  293. dspcomDR.obj: dspcom.c gnuchess.h version.h
  294.     $(CC) -DDEBUG -DDEBUG4 $(CFLAGS) $(HASH) $(LANGF) -DNONDSP -c -o dspcomDR.obj dspcom.c
  295.  
  296. postprint.obj: postprint.c gnuchess.h version.h
  297.     $(CC) $(CFLAGS) $(HASH) -c postprint.c
  298.     
  299. binsort.exe: binsort.c binsort.h
  300.     $(CC) $(CFLAGS) -o binsort.exe binsort.c
  301.     
  302. ecosort.exe: ecosort.c gnuchess.h
  303.     $(CC) $(CFLAGS) -o ecosort.exe ecosort.c
  304.     
  305. ecocvt.exe: ecocvt.c
  306.     $(CC) $(CFLAGS) -o ecocvt.exe ecocvt.c
  307.     
  308. gnuchess.dat: $(BOOK)
  309.     -del input.tmp
  310.     -del textbook.tmp 
  311.     -del gnuchess.dat
  312.     echo 3 0 > input.tmp
  313.     echo quit >> input.tmp
  314.     gzip -d -c $(BOOK) > textbook.tmp
  315.     gnuchesr < input.tmp -b textbook.tmp -B gnuchess.dat $(BOOKOPTS)
  316.     del input.tmp 
  317.     del textbook.tmp
  318.  
  319. # Currently eco support does not work on MSDOS, so this is not built:
  320. gnuchess.eco: ecor.exe binsort.exe ecocvt.exe ecosort.exe
  321.     -del step0.eco
  322.     -del step1.eco
  323.     -del step2.eco
  324.     -del gnuchess.eco
  325.     echo 0 0 > step0.eco
  326.     ecor -b ../book/eco.pgn -B step1.eco < step0.eco
  327.     ecosort
  328.     ecocvt step2.eco gnuchess.eco
  329.     del step0.eco
  330.     del step1.eco
  331.     del step2.eco
  332.  
  333. install:    inst
  334.  
  335. inst:    all
  336.     copy *.exe $(INSTDIR)
  337.     copy *.dat $(INSTDIR)
  338.     copy ..\misc\gnuchess.lang $(INSTDIR)
  339.  
  340. clean:
  341.     -del *.obj
  342.     -del *.exe
  343.  
  344.