home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 22 gnu / 22-gnu.zip / gnuch40.zip / gnuchess-4.0.pl79 / src / Makefile.nt < prev    next >
Makefile  |  1998-09-28  |  14KB  |  363 lines

  1. #
  2. # Makefile for GNU Chess
  3. #
  4. # Copyright (c) 1992, 1994 Free Software Foundation
  5. #
  6. # This file is part of GNU CHESS.
  7. #
  8. # GNU Chess is free software; you can redistribute it and/or modify
  9. # it under the terms of the GNU General Public License as published by
  10. # the Free Software Foundation; either version 2, or (at your option)
  11. # any later version.
  12. #
  13. # GNU Chess is distributed in the hope that it will be useful,
  14. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16. # GNU General Public License for more details.
  17. #
  18. # You should have received a copy of the GNU General Public License
  19. # along with GNU Chess; see the file COPYING.  If not, write to
  20. # the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  21. #
  22.  
  23. # ************************************************************************
  24. # *** This makefile is for use with "nmake" and Visual C++ 2.0 or later.
  25. # *** It has not been tried with other C compilers.  It builds a version of
  26. # *** GNU Chess that runs under Windows 95 or Windows NT, and works with
  27. # *** the WinBoard front end (version 3.4.pl1 and later ONLY).
  28. # *** Use the command "nmake /f Makefile.nt" to build.
  29. # ************************************************************************
  30. #
  31. # gnuchesr is a plain dumb-terminal chess (but with full variation output)
  32. # gnuchesx is the same, but suitable for use with WinBoard
  33. # The other versions of gnuchess have not been ported.
  34. # The other gnuchess tools (such as gnuan) have not been ported.
  35. # The gnuchess book is built, but the eco database is not.
  36.  
  37. # The version number of this GNU release
  38. VERS=    4.0
  39.  
  40. # size of book to make
  41. # Listed below are the book options and the size of the resulting book,
  42. # the default is small. Uncomment/comment the BOOKOPTS corresponding to
  43. # the size you want.
  44. #
  45. #huge         1,450K
  46. #BOOKOPTS=-S 188000 -P 26
  47. #big            540K
  48. #BOOKOPTS=-S 45000 -P 16
  49. #med            240K
  50. #BOOKOPTS=-S 20000 -P 12
  51. #small          144K
  52. BOOKOPTS=-S 12000 -P 10
  53. #tiny            78K
  54. #BOOKOPTS=-S 9000 -P 8
  55.  
  56. BOOK=..\book\gnuchess.bk3.gz
  57.  
  58. # Where the binaries live.
  59. BINDIR= .
  60.  
  61. # Where language description, our book, and the persistent hash live.
  62. LIBDIR= .
  63.  
  64. # Table limits from gnuchess.h. These are given default values if not
  65. # set here. The default values are given below, but you may want to
  66. # check gnuchess.h to make sure.
  67. # -Dttblsz=150001 Transposition table size. Small address space computers
  68. #                 might try 8001. Setting ttblsz to 0 removes the transposition
  69. #                 table
  70. # -DBOOKSIZE=250000 Number of unique position/move combinations allowed.
  71. #                   For MSDOS 10000 is used.
  72.  
  73. #compile options for gnuchess
  74. # -DBAREBONES compile for max speed no statistics etc kept
  75. # -DECO if you want support for eco database
  76. # -DQUIETBACKGROUND don't print post information in background ( easy OFF)
  77. # -DHAVE_MEMSET if your machine have memset
  78. # -DNOMATERIAL don't call it a draw when no pawns and both sides < rook
  79. # -DNODYNALPHA don't dynamically adjust alpha
  80. # -DHASHSTATS keep hash table statistics
  81. # -DMORESTATS print more hash table stats
  82. # -DHISTORY use history killer hueristic 
  83. # -DKILLT use killt killer hueristic 
  84. # -DHAVE_GETTIMEOFDAY use gettimeofday for more accurate timing
  85. # -DHAVE_TIME_H have <time.h> header
  86. # -DHAVE_STRTOUL if your machine supports strtoul() else strtol()
  87. # -DOLDTIME use old ply time estimating function
  88. # -DCLIENT create client version for use with ICS
  89. # -DOLDXBOARD don't generate underpromote moves
  90. # -DLONG64 if you have 64bit longs
  91. # -DSYSV   if you are using SYSV
  92. # -DCACHE  Cache static evaluations 
  93. # -DQUIETBOOKGEN Don't print errors while loading a book or generating a binbook
  94. # -DSEMIQUIETBOOKGEN Print less verbose errors while reading book or generating binbook
  95. # -DNULLMOVE include null move heuristic
  96. # -DDEEPNULL include deepnull move heuristic
  97. # -DNODITHER no random element to evalustions
  98. # some debug options
  99. # -DDEBUG8 dump board,movelist,input move to /tmp/DEBUG if illegal move
  100. # -DDEBUG9 dump move list from test command
  101. # -DDEBUG10 dump board and move after search before !easy begins
  102. # -DDEBUG11 dump board when the move is output
  103. # -DDEBUG12 dump boards between moves
  104. # -DDEBUG13 dump search control information for each move to /tmp/DEBUG
  105. # -DDEBUG33 dump book moves as read from book
  106. # -DDEBUG40 include extra values of variables for debugging  in game list
  107. # -DDEBUG41 dump post output to /tmp/DEBUG
  108. # the rest of the debug options are tied to the debuglevel command
  109. # -DDEBUG sets up code for debuglevel command
  110. #          debuglevel
  111. #               1 always force evaluation in evaluate
  112. #               4 print move list after search
  113. #               8 print move list after book before search
  114. #              16 print move list after each ply of search
  115. #              32 print adds to transposition table
  116. #              64 print returns from transposition table lookups
  117. #          128 print evals
  118. #          256 print search tree as it is generated
  119. #          512 debug trace of search tree
  120. #         1024 interactive tree print
  121. #     prints:
  122. # move goal-depth depth ply tree-index flags node-score score alpha beta best movegen-score
  123. #
  124. #example:
  125. #
  126. #debug?p3
  127. #debug?e2e3
  128. #debug?g2e3
  129. #debug?
  130. #
  131. #Move# 1    Target= 0    Clock: 0
  132. #        f2e3 S2 d0 p3 71 200 n->s176 s-179 a343 b512 best-179 x369
  133. #        a6h6 S2 d0 p3 72 200 n->s-802 s-179 a343 b512 best176 x369
  134. #    g2e3 S2 d1 p2 34 200 n->s-176 s-410 a-512 b-343 best-12000 x369
  135. #e2e3 S2 d2 p1 17 0 n->s175 s422 a343 b512 best343 x369
  136. #
  137. #        debug? p#  where # is no. of plys to print 
  138. #                from top of tree (default all plys)
  139. #               XXXX moves specifying branch of tree to print 
  140. #                (default all branches)
  141. #                   return terminates input
  142. #         2048 non-interactive trace print
  143.  
  144. OPT=  -DUSEINT -DCACHE -DGDX -DNULLMOVE -DWAY4PL64 -DHISTORY \
  145.     -DAGING -DKILLT -DUNLIMITEDCAPS -DPRUNE -DOLDTIME -DHASHSTATS \
  146.     -DHAVE_MEMSET -DBOOKSIZE=30000 -Dttblsz=8001
  147.  
  148. # The compiler used for compiling this software.
  149. CC= cl -DWIN32 -D_POSIX_ -D__STDC__ -Dinline= -c -W3 -D_X86=1 -Zi -Od $(OPT)
  150. LINK= link -debug:full -debugtype:cv -align:0x1000 -subsystem:console
  151. LIBS= libc.lib kernel32.lib
  152.  
  153. all: gnuchess.lan gnuchesx.exe gnuchesr.exe gnuchess.dat
  154.  
  155. gnuchess.lan:
  156.     copy ..\misc\gnuchess.lang gnuchess.lan
  157.  
  158. gnuan.exe: mainN.obj bookG.obj genmovesN.obj ataks.obj utilN.obj evalN.obj init.obj searchG.obj gnuan.obj
  159.     $(LINK) -out:gnuan.exe mainN.obj bookG.obj genmovesN.obj ataks.obj utilN.obj evalN.obj init.obj searchG.obj gnuan.obj $(LIBS)
  160.  
  161. gnuchesx.exe: mainX.obj bookX.obj genmovesX.obj ataks.obj utilX.obj evalX.obj init.obj searchX.obj dspcomX.obj nondspX.obj
  162.     $(LINK) -out:gnuchesx.exe mainX.obj bookX.obj genmovesX.obj ataks.obj utilX.obj evalX.obj init.obj searchX.obj dspcomX.obj nondspX.obj $(LIBS)
  163.  
  164. ecor.exe: mainN.obj eco.obj genmovesN.obj ataks.obj utilN.obj evalN.obj init.obj searchN.obj dspcomR.obj nondspR.obj
  165.     $(LINK) -out:ecor.exe mainN.obj eco.obj genmovesN.obj ataks.obj utilN.obj evalN.obj init.obj searchN.obj dspcomR.obj nondspR.obj $(LIBS)
  166.  
  167. gnuchesr.exe: mainN.obj bookN.obj genmovesN.obj ataks.obj utilN.obj evalN.obj init.obj searchN.obj dspcomR.obj nondspR.obj
  168.     $(LINK) -out:gnuchesr.exe mainN.obj bookN.obj genmovesN.obj ataks.obj utilN.obj evalN.obj init.obj searchN.obj dspcomR.obj nondspR.obj $(LIBS)
  169.  
  170. gnuan.obj: gnuan.c gnuchess.h version.h
  171.     $(CC) $(CFLAGS) $(HASH) $(LANGF) -DIGNUAN $(BINBOOK) -c gnuan.c
  172.  
  173. mainN.obj: main.c gnuchess.h version.h ttable.h
  174.     $(CC) $(CFLAGS) $(HASH) $(LANGF)  $(BINBOOK) -c main.c
  175.     move /y main.obj mainN.obj
  176. mainC.obj: main.c gnuchess.h version.h ttable.h
  177.     $(CC) $(CFLAGS) $(HASH) $(LANGF)  $(BINBOOK) -DNONDSP -DCHESSTOOL \
  178.         -c main.c
  179.     move /y main.obj mainC.obj
  180. mainX.obj: main.c gnuchess.h version.h ttable.h
  181.     $(CC) $(CFLAGS) $(HASH) $(LANGF)  $(BINBOOK) -DXBOARD  -c main.c
  182.     move /y main.obj mainX.obj
  183. mainDR.obj: main.c gnuchess.h version.h ttable.h
  184.     $(CC)  -DDEBUG -DDEBUG4 $(CFLAGS) $(HASH) $(LANGF)  $(BINBOOK) \
  185.         -c main.c
  186.     move /y main.obj mainDR.obj
  187.  
  188. genmovesN.obj: genmoves.c gnuchess.h version.h ttable.h
  189.     $(CC) $(CFLAGS) $(HASH) $(LANGF)  -c genmoves.c
  190.     move /y genmoves.obj genmovesN.obj
  191. genmovesC.obj: genmoves.c gnuchess.h version.h ttable.h
  192.     $(CC) $(CFLAGS) $(HASH) $(LANGF)  -DNONDSP -DCHESSTOOL \
  193.         -c genmoves.c 
  194.     move /y genmoves.obj genmovesC.obj
  195. genmovesX.obj: genmoves.c gnuchess.h version.h ttable.h
  196.     $(CC) $(CFLAGS) $(HASH) $(LANGF)  -DXBOARD \
  197.         -c genmoves.c
  198.     move /y genmoves.obj  genmovesX.obj
  199.  
  200. eco.obj: eco.c gnuchess.h version.h ataks.h ttable.h
  201.     $(CC) $(CFLAGS) $(HASH) $(LANGF)  $(BINBOOK) $(BINECO)  $(PGNECO) -c eco.c 
  202.  
  203. bookN.obj: book.c gnuchess.h version.h ataks.h ttable.h
  204.     $(CC) $(CFLAGS) $(HASH) $(LANGF)  $(BINBOOK) $(PGNECO) $(BINECO) -c book.c 
  205.     move /y book.obj bookN.obj
  206. bookG.obj: book.c gnuchess.h version.h ataks.h ttable.h
  207.     $(CC) $(CFLAGS) $(HASH) $(LANGF)  $(BINBOOK) $(PGNECO) $(BINECO) -DIGNUAN  -c book.c 
  208.     move /y book.obj bookG.obj
  209. bookC.obj: book.c gnuchess.h version.h ataks.h ttable.h
  210.     $(CC) $(CFLAGS) $(HASH) $(LANGF)  -DNONDSP -DCHESSTOOL \
  211.           $(BINBOOK) \
  212.         $(PGNECO) $(BINECO) -c book.c 
  213.     move /y book.obj bookC.obj
  214. bookX.obj: book.c gnuchess.h version.h ataks.h ttable.h
  215.     $(CC) $(CFLAGS) $(HASH) $(LANGF)  -DXBOARD  $(BINBOOK) \
  216.         $(PGNECO) $(BINECO) -c book.c
  217.     move /y book.obj  bookX.obj
  218.  
  219. ataks.obj: ataks.h ataks.c gnuchess.h version.h ttable.h
  220.     $(CC) $(CFLAGS) $(HASH) $(LANGF)  -c ataks.c
  221.  
  222. utilN.obj: util.c gnuchess.h version.h
  223.     $(CC) $(CFLAGS) $(HASH) $(LANGF)  -c util.c
  224.     move /y util.obj utilN.obj
  225.  
  226. utilX.obj: util.c gnuchess.h version.h
  227.     $(CC) $(CFLAGS) $(HASH) $(LANGF)   \
  228.          -c util.c
  229.     move /y util.obj  utilX.obj
  230.  
  231. utilC.obj: util.c gnuchess.h version.h
  232.     $(CC) $(CFLAGS) $(HASH) $(LANGF)   \
  233.          -c util.c
  234.     move /y util.obj  utilC.obj
  235.  
  236. evalC.obj: eval.c gnuchess.h version.h ttable.h
  237.     $(CC) $(CFLAGS) $(HASH) $(LANGF)   -c eval.c
  238.     move /y eval.obj evalC.obj
  239.  
  240. evalX.obj: eval.c gnuchess.h version.h ttable.h
  241.     $(CC) $(CFLAGS) $(HASH) $(LANGF)   -c eval.c
  242.     move /y eval.obj evalX.obj
  243.  
  244. evalN.obj: eval.c gnuchess.h version.h ttable.h
  245.     $(CC) $(CFLAGS) $(HASH) $(LANGF)  -c eval.c
  246.     move /y eval.obj evalN.obj
  247.  
  248. evalDR.obj: eval.c gnuchess.h version.h ttable.h
  249.     $(CC)  -DDEBUG4 -DDEBUG $(CFLAGS) $(HASH) $(LANGF)  \
  250.         -c eval.c 
  251.     move /y eval.obj evalDR.obj
  252. utilDR.obj: util.c gnuchess.h version.h
  253.     $(CC)  -DDEBUG4 -DDEBUG $(CFLAGS) $(HASH) $(LANGF)  \
  254.         -c util.c 
  255.     move /y util.obj utilDR.obj
  256.  
  257. init.obj: init.c gnuchess.h version.h ttable.h
  258.     $(CC) $(CFLAGS) $(HASH) $(LANGF)  -c init.c
  259.  
  260. 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
  261.     $(CC) $(CFLAGS) $(HASH) $(LANGF)  -c search.c
  262.     move /y search.obj searchN.obj
  263. 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
  264.     $(CC) $(CFLAGS) $(HASH) $(LANGF) -DIGNUAN  -c search.c
  265.     move /y search.obj searchG.obj
  266. searchC.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)  -DNONDSP -DCHESSTOOL \
  268.         -c search.c 
  269.     move /y search.obj searchC.obj
  270. searchX.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
  271.     $(CC) $(CFLAGS) $(HASH) $(LANGF)  -DXBOARD \
  272.         -c search.c 
  273.     move /y search.obj searchX.obj
  274. 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
  275.     $(CC)  -DDEBUG4 -DDEBUG $(CFLAGS) $(HASH) $(LANGF)  \
  276.         -c search.c 
  277.     move /y search.obj searchDR.obj
  278.  
  279. uxdsp.obj: uxdsp.c gnuchess.h version.h
  280.     $(CC) $(CFLAGS) $(HASH) $(LANGF)  -c uxdsp.c
  281.  
  282. nuxdsp.obj: nuxdsp.c gnuchess.h version.h
  283.     $(CC) $(CFLAGS) $(HASH) $(LANGF)  -c nuxdsp.c
  284.  
  285. nondspC.obj: nondsp.c gnuchess.h version.h
  286.     $(CC) $(CFLAGS) $(HASH) $(LANGF)  -DNONDSP -DCHESSTOOL \
  287.         -c nondsp.c 
  288.     move /y nondsp.obj nondspC.obj
  289. nondspX.obj: nondsp.c gnuchess.h version.h
  290.     $(CC) $(CFLAGS) $(HASH) $(LANGF)  -DNONDSP -DXBOARD \
  291.         -c nondsp.c 
  292.     move /y nondsp.obj nondspX.obj
  293. nondspR.obj: nondsp.c gnuchess.h version.h
  294.     $(CC) $(CFLAGS) $(HASH) $(LANGF)  -DNONDSP \
  295.         -c nondsp.c 
  296.     move /y nondsp.obj nondspR.obj
  297. nondspDR.obj: nondsp.c gnuchess.h version.h
  298.     $(CC)  -DDEBUG4 -DDEBUG $(CFLAGS) $(HASH) $(LANGF)  -DNONDSP \
  299.          -c nondsp.c 
  300.     move /y nondsp.obj nondspDR.obj
  301.  
  302. dspcomN.obj: dspcom.c gnuchess.h version.h
  303.     $(CC) $(CFLAGS) $(HASH) $(LANGF)  -c dspcom.c
  304.     move /y dspcom.obj dspcomN.obj
  305. dspcomC.obj: dspcom.c gnuchess.h version.h
  306.     $(CC) $(CFLAGS) $(HASH) $(LANGF)  -DNONDSP -DCHESSTOOL \
  307.         -c dspcom.c 
  308.     move /y dspcom.obj dspcomC.obj
  309. dspcomX.obj: dspcom.c gnuchess.h version.h
  310.     $(CC) $(CFLAGS) $(HASH) $(LANGF)  -DNONDSP -DXBOARD \
  311.         -c dspcom.c 
  312.     move /y dspcom.obj dspcomX.obj
  313. dspcomR.obj: dspcom.c gnuchess.h version.h
  314.     $(CC) $(CFLAGS) $(HASH) $(LANGF)  -DNONDSP \
  315.         -c dspcom.c 
  316.     move /y dspcom.obj dspcomR.obj
  317. dspcomDR.obj: dspcom.c gnuchess.h version.h
  318.     $(CC)  -DDEBUG -DDEBUG4 $(CFLAGS) $(HASH) $(LANGF)  -DNONDSP \
  319.         -c dspcom.c 
  320.     move /y dspcom.obj dspcomDR.obj
  321.  
  322. postprint.obj: postprint.c gnuchess.h version.h
  323.     $(CC) $(CFLAGS) $(HASH) -c postprint.c
  324.  
  325. binsort.exe: binsort.obj
  326.     $(LINK) -out:binsort.exe binsort.obj $(LIBS)
  327.  
  328. binsort.obj: binsort.c binsort.h
  329.     $(CC) $(CFLAGS) -c binsort.c
  330.  
  331. ecosort.exe: ecosort.obj
  332.     $(LINK) -out:ecosort.exe ecosort.obj $(LIBS)
  333.  
  334. ecosort.obj: ecosort.c gnuchess.h
  335.     $(CC) $(CFLAGS) -c ecosort.c
  336.  
  337. ecocvt.exe: ecocvt.obj
  338.     $(LINK) -out:ecocvt.exe ecocvt.obj $(LIBS)
  339.  
  340. ecocvt.obj: ecocvt.c
  341.     $(CC) $(CFLAGS) -c ecocvt.c
  342.  
  343. gnuchess.dat: $(BOOK)
  344.     del input.tmp
  345.     del textbook.tmp
  346.     del gnuchess.dat
  347.     echo 3 0 > input.tmp
  348.     echo quit >> input.tmp
  349.     gzip -d -c $(BOOK) > textbook.tmp
  350.      gnuchesr -b textbook.tmp -B gnuchess.dat $(BOOKOPTS) < input.tmp
  351.     del input.tmp
  352.     del textbook.tmp
  353.  
  354. # The following doesn't work because binsort isn't ported
  355. gnuchess.eco: ecor.exe binsort.exe ecocvt.exe ecosort.exe
  356.     del gnuchess.eco step0.eco step1.eco step2.eco
  357.     echo 0 0 > step0.eco
  358.     ecor -b ..\book\eco.pgn -B step1.eco < step0.eco
  359.     ecosort 
  360.     ecocvt step2.eco gnuchess.eco
  361.     del step0.eco step1.eco step2.eco
  362.  
  363.