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

  1. #
  2. # Makefile for GNU Chess
  3. #
  4. # (Use this makefile when compiling under DOS using DJGPP 2.6.0)
  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 = -lm
  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.  
  72. # Display routines.
  73. LCURSES=-lcurses -ltermcap
  74.  
  75. # Table limits from gnuchess.h. These are given default values if not
  76. # set here. The default values are given below, but you may want to
  77. # check gnuchess.h to make sure.
  78. # -Dttblsz=150001 Transposition table size. Small address space computers
  79. #                 might try 8001. Setting ttblsz to 0 removes the transposition
  80. #                 table
  81. # -DBOOKSIZE=250000 Number of unique position/move combinations allowed.
  82. #                   For MSDOS 10000 is used.
  83.  
  84. #compile options for gnuchess
  85. #    Search options
  86. # -DHISTORY use history killer hueristic 
  87. # -DKILLT use killt killer hueristic 
  88. # -DNULLMOVE include null move heuristic
  89. # -DDEEPNULL include deepnull move heuristic
  90. # -DUNLIMITEDCAPS allow unlimited depth captures
  91. # -DPRUNE enable marginal forward pruning
  92. # -DNOMATERIAL don't call it a draw when no pawns and both sides < rook
  93. # -DNODYNALPHA don't dynamically adjust alpha
  94. # -DOLDTIME use old ply time estimating function
  95. # -DCACHE  Cache static evaluations 
  96. # -DNODITHER no random element to evaluations
  97. #
  98. #    Verbosity options
  99. # -DBAREBONES compile for max speed no statictics etc kept
  100. # -DQUIETBACKGROUND don't print post information in background ( easy OFF)
  101. # -DHASHSTATS keep hash table statistics
  102. # -DMORESTATS print more hash table stats
  103. # -DQUIETBOOKGEN Don't print errors while loading a book or generating a binbook
  104. # -DSEMIQUIETBOOKGEN Print less verbose errors while reading book or generating binbook
  105. #
  106. #    Miscellaneous options
  107. # -DHAVE_TIME_H have <time.h> header
  108. # -DHAVE_STRTOUL if your machine supports strtoul() else strtol()
  109. # -DHAVE_GETTIMEOFDAY use gettimeofday for more accurate timing
  110. # -DHAVE_MEMSET if your machine supports memset
  111. # -DECO if you want support for eco database
  112. # -DCLIENT create client version for use with ICS
  113. # -DLONG64 if you have 64bit longs
  114. #
  115. #    Some debug options
  116. # -DDEBUG8 dump board,movelist,input move to /tmp/DEBUG if illegal move
  117. # -DDEBUG9 dump move list from test command
  118. # -DDEBUG10 dump board and move after search before !easy begins
  119. # -DDEBUG11 dump board when the move is output
  120. # -DDEBUG12 dump boards between moves
  121. # -DDEBUG13 dump search control information for each move to /tmp/DEBUG
  122. # -DDEBUG33 dump book moves as read from book
  123. # -DDEBUG40 include extra values of variables for debugging  in game list
  124. # -DDEBUG41 dump post output to /tmp/DEBUG
  125. # the rest of the debug options are tied to the debuglevel command
  126. # -DDEBUG -DDEBUG4 set up code for debuglevel command
  127. #          debuglevel
  128. #               1 always force evaluation in evaluate
  129. #               4 print move list after search
  130. #               8 print move list after book before search
  131. #              16 print move list after each ply of search
  132. #              32 print adds to transposition table
  133. #              64 print returns from transposition table lookups
  134. #             128 print evals
  135. #             256 print search tree as it is generated
  136. #             512 debug trace of search tree
  137. #            1024 interactive tree print
  138. #            2048 non-interactive trace print
  139. #
  140. #
  141. ## normal
  142. OPT=  -DUSEINT -DCACHE -DGDX -DNULLMOVE -DWAY4PL64 -DHISTORY \
  143.   -DAGING -DKILLT -DUNLIMITEDCAPS -DPRUNE -DOLDTIME -DHASHSTATS \
  144.   -DHAVE_GETTIMEOFDAY -DHAVE_STRTOUL -DHAVE_MEMSET
  145.  
  146. # The hashfile is a record of positions seen. It is used by
  147. # GNU Chess to avoid making the same mistakes, a form of learning.
  148. HASH=   -DHASHFILE=\"$(LIBDIR)/gnuchess.has\"
  149.  
  150. # The "book" is a record of the first few moves, for playing good
  151. # moves easily and quickly, saving time, and irritating the human
  152. # opponent.
  153. BINBOOK = -DBINBOOK=\"$(LIBDIR)/gnuchess.dat\"
  154. BINECO = -DBINECO=\"$(LIBDIR)/gnuchess.eco\"
  155. PGNECO = -DPGNECO=\"$(LIBDIR)/eco.pgn\"
  156.  
  157. # The language file describes capabilities of the program. Perhaps
  158. # it is useful for non-English speaking countries and customizing
  159. # for their convenience and chess happiness.
  160. LANGF= -DLANGFILE=\"$(LIBDIR)/gnuchess.lan\" \
  161.        -DSRCLANGFILE=\"../misc/gnuchess.lan\"
  162.  
  163. INSTALL=copy
  164. #INSTALL=install -s
  165.  
  166. # The compiler used for compiling this software.
  167. # Use this for a plain C compiler 
  168. #CC= cc $(OPT)
  169. # Use this for DEC's ANSI C compiler on Ultrix
  170. #CC= c89 $(OPT)
  171. # Use this if you are lucky enough to have GNU CC.
  172. CC= gcc $(OPT)
  173.  
  174. # Miscellaneous CFLAGS. Uncomment the one you need and comment 
  175. # the other.
  176. CFLAGS= -O2 -funroll-loops  # gnu cc  
  177. #CFLAGS=  -O2 -p -Dinline=""     -traditional-cpp
  178. #CFLAGS= -O4 -Qpath .  # SunOS cc using unprotoize
  179. #CFLAGS= -O4 # Sun acc
  180. #CFLAGS= -O2 # DEC ANSI C (c89) on Ultrix.
  181. #CFLAGS= +O3 -Aa -D_HPUX_SOURCE  # HPUX cc 
  182. #CFLAGS= -O   -finline-functions -fstrength-reduce -D__mips -D__LANGUAGE_C # gnu cc 1.40 on DS5000
  183. #CFLAGS= -O   -finline-functions -fstrength-reduce  # gnu cc 1.40 on others
  184. #CFLAGS= -O2 -funroll-loops -D__mips -D__LANGUAGE_C # gnu cc 2.00 on DS5000
  185. #CFLAGS= -O2 -D__alpha -D__LANGUAGE_C # gnu cc 2.00 on Flamingo
  186. #CFLAGS= -O2 -funroll-loops -traditional-cpp  # gnu cc  2.00 on SunOS
  187. #CFLAGS= -O2 -acpp -signed -Wp,-traditional # IRIX 5.1.*?
  188. #CFLAGS= -g -cckr -DNOMACROS -Dhuge=""  #Correct flags for gnuchess 4.0 with IRIX cc.
  189.  
  190. all : gnuchess.exe gnuchesr.exe gnuchesn.exe postprint.exe gnuan.exe game.exe gnuchess.dat
  191.  
  192. gnuchess.exe: mainN.o bookN.o genmoveN.o ataks.o utilN.o evalN.o init.o searchN.o dspcomN.o uxdsp.o
  193.     $(CC) $(CFLAGS) $(HASH) $(LANGF) -o gnuchess mainN.o bookN.o genmoveN.o ataks.o utilN.o evalN.o init.o searchN.o dspcomN.o uxdsp.o $(LIBS)
  194.     coff2exe -s go32.exe gnuchess
  195.     del gnuchess
  196.  
  197. gnuan.exe: mainN.o bookG.o genmoveN.o ataks.o utilN.o evalN.o init.o searchG.o gnuan.o
  198.     $(CC) $(CFLAGS) $(HASH) $(LANGF) -DIGNUAN -o gnuan mainN.o bookG.o genmoveN.o ataks.o utilN.o evalN.o init.o searchG.o gnuan.o $(LIBS)
  199.     coff2exe -s go32.exe gnuan
  200.     del gnuan
  201.  
  202. Dgnuchesr.exe: mainDR.o bookN.o genmoveN.o ataks.o utilDR.o evalDR.o init.o searchDR.o dspcomDR.o nondspDR.o
  203.     $(CC) -DDEBUG -DDEBUG4 $(CFLAGS) $(HASH) $(LANGF) -o gnuchesr mainDR.o bookN.o genmoveN.o ataks.o utilDR.o evalDR.o init.o searchDR.o dspcomDR.o nondspDR.o $(LIBS)
  204.     coff2exe -s go32.exe gnuchesr
  205.     del gnuchesr
  206.  
  207. ecor.exe: mainN.o eco.o genmoveN.o ataks.o utilN.o evalN.o init.o searchN.o dspcomR.o nondspR.o
  208.     $(CC) $(CFLAGS) $(HASH) $(LANGF) -o ecor mainN.o eco.o genmoveN.o ataks.o utilN.o evalN.o init.o searchN.o dspcomR.o nondspR.o $(LIBS)
  209.     coff2exe -s go32.exe ecor
  210.     del ecor
  211.  
  212. gnuchesr.exe: mainN.o bookN.o genmoveN.o ataks.o utilN.o evalN.o init.o searchN.o dspcomR.o nondspR.o
  213.     $(CC) $(CFLAGS) $(HASH) $(LANGF) -o gnuchesr mainN.o bookN.o genmoveN.o ataks.o utilN.o evalN.o init.o searchN.o dspcomR.o nondspR.o $(LIBS)
  214.     coff2exe -s go32.exe gnuchesr
  215.     del gnuchesr
  216.  
  217. gnuchesn.exe: mainN.o bookN.o genmoveN.o ataks.o utilN.o evalN.o init.o searchN.o dspcomN.o nuxdsp.o
  218.     $(CC) $(CFLAGS) $(HASH) $(LANGF) -o gnuchesn mainN.o bookN.o genmoveN.o ataks.o utilN.o evalN.o init.o searchN.o dspcomN.o nuxdsp.o $(LIBS)
  219.     coff2exe -s go32.exe gnuchesn
  220.     del gnuchesn
  221.  
  222. game.exe: game.c gnuchess.h
  223.     $(CC) $(CFLAGS) -o game game.c
  224.     coff2exe -s go32.exe game
  225.     del game
  226.     
  227. postprint.exe: postprint.o
  228.     $(CC) $(CFLAGS) $(HASH) -o postprint postprint.o
  229.     coff2exe -s go32.exe postprint
  230.     del postprint
  231.     
  232. gnuan.o: gnuan.c gnuchess.h version.h
  233.     $(CC) $(CFLAGS) $(HASH) $(LANGF) -DIGNUAN $(BINBOOK) -c gnuan.c
  234.  
  235. mainN.o: main.c gnuchess.h version.h ttable.h
  236.     $(CC) $(CFLAGS) $(HASH) $(LANGF) $(BINBOOK) -c main.c
  237.     del mainN.o
  238.     rename main.o mainN.o
  239. mainDR.o: main.c gnuchess.h version.h ttable.h
  240.     $(CC) -DDEBUG -DDEBUG4 $(CFLAGS) $(HASH) $(LANGF) $(BINBOOK) -c main.c
  241.     del mainDR.o
  242.     rename main.o mainDR.o
  243.  
  244. genmoveN.o: genmoves.c gnuchess.h version.h ttable.h
  245.     $(CC) $(CFLAGS) $(HASH) $(LANGF) -c genmoves.c
  246.     del genmoveN.o
  247.     rename genmoves.o genmoveN.o
  248.  
  249. eco.o: eco.c gnuchess.h version.h ataks.h ttable.h
  250.     $(CC) $(CFLAGS) $(HASH) $(LANGF) $(BINBOOK) $(BINECO) $(PGNECO) -c eco.c
  251.     
  252. bookN.o: book.c gnuchess.h version.h ataks.h ttable.h
  253.     $(CC) $(CFLAGS) $(HASH) $(LANGF) $(BINBOOK) $(PGNECO) $(BINECO) -c book.c
  254.     del bookN.o
  255.     rename book.o bookN.o
  256. bookG.o: book.c gnuchess.h version.h ataks.h ttable.h
  257.     $(CC) $(CFLAGS) $(HASH) $(LANGF) $(BINBOOK) $(PGNECO) $(BINECO) -DIGNUAN -c book.c
  258.     del bookG.o
  259.     rename book.o bookG.o
  260.  
  261. ataks.o: ataks.h ataks.c gnuchess.h version.h ttable.h
  262.     $(CC) $(CFLAGS) $(HASH) $(LANGF) -c ataks.c
  263.     
  264. utilN.o: util.c gnuchess.h version.h
  265.     $(CC) $(CFLAGS) $(HASH) $(LANGF) -c util.c
  266.     del utilN.o
  267.     rename util.o utilN.o
  268.     
  269. evalN.o: eval.c gnuchess.h version.h ttable.h
  270.     $(CC) $(CFLAGS) $(HASH) $(LANGF) -c eval.c
  271.     del evalN.o
  272.     rename eval.o evalN.o
  273.  
  274. evalDR.o: eval.c gnuchess.h version.h ttable.h
  275.     $(CC) -DDEBUG -DDEBUG4 $(CFLAGS) $(HASH) $(LANGF) -c eval.c
  276.     del evalDR.o
  277.     rename eval.o evalDR.o
  278.  
  279. init.o: init.c gnuchess.h version.h ttable.h
  280.     $(CC) $(CFLAGS) $(HASH) $(LANGF) -c init.c
  281.     
  282. searchN.o: 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
  283.     $(CC) $(CFLAGS) $(HASH) $(LANGF) -c search.c
  284.     del searchN.o
  285.     rename search.o searchN.o
  286. searchG.o: 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
  287.     $(CC) $(CFLAGS) $(HASH) $(LANGF) -DIGUAN -c search.c
  288.     del searchG.o
  289.     rename search.o searchG.o
  290. searchDR.o: 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
  291.     $(CC) -DDEBUG -DDEBUG4 $(CFLAGS) $(HASH) $(LANGF) -c search.c
  292.     del searchDR.o
  293.     rename search.o searchDR.o
  294.  
  295. uxdsp.o: uxdsp.c gnuchess.h version.h
  296.     $(CC) $(CFLAGS) $(HASH) $(LANGF) -c uxdsp.c
  297.     
  298. nuxdsp.o: nuxdsp.c gnuchess.h version.h
  299.     $(CC) $(CFLAGS) $(HASH) $(LANGF) -c nuxdsp.c
  300.     
  301. nondspR.o: nondsp.c gnuchess.h version.h
  302.     $(CC) $(CFLAGS) $(HASH) $(LANGF) -DNONDSP -c nondsp.c
  303.     del nondspR.o
  304.     rename nondsp.o nondspR.o
  305. nondspDR.o: nondsp.c gnuchess.h version.h
  306.     $(CC) -DDEBUG -DDEBUG4 $(CFLAGS) $(HASH) $(LANGF) -DNONDSP -c nondsp.c
  307.     del nondspDR.o
  308.     rename nondsp.o nondspDR.o
  309.  
  310. dspcomN.o: dspcom.c gnuchess.h version.h
  311.     $(CC) $(CFLAGS) $(HASH) $(LANGF) -c dspcom.c
  312.     del dspcomN.o
  313.     rename dspcom.o dspcomN.o
  314.  
  315. dspcomR.o: dspcom.c gnuchess.h version.h
  316.     $(CC) $(CFLAGS) $(HASH) $(LANGF) -DNONDSP -c dspcom.c
  317.     del dspcomR.o
  318.     rename dspcom.o dspcomR.o
  319. dspcomDR.o: dspcom.c gnuchess.h version.h
  320.     $(CC) -DDEBUG -DDEBUG4 $(CFLAGS) $(HASH) $(LANGF) -DNONDSP -c dspcom.c
  321.     del dspcomDR.o
  322.     rename dspcom.o dspcomDR.o
  323.  
  324. postprint.o: postprint.c gnuchess.h version.h
  325.     $(CC) $(CFLAGS) $(HASH) -c postprint.c
  326.     
  327. binsort.exe: binsort.c binsort.h
  328.     $(CC) $(CFLAGS) -o binsort binsort.c
  329.     coff2exe -s go32.exe binsort
  330.     del binsort
  331.     
  332. ecosort.exe: ecosort.c gnuchess.h
  333.     $(CC) $(CFLAGS) -o ecosort ecosort.c
  334.     coff2exe -s go32.exe ecosort
  335.     del ecosort
  336.     
  337. ecocvt.exe: ecocvt.c
  338.     $(CC) $(CFLAGS) -o ecocvt ecocvt.c
  339.     coff2exe -s go32.exe ecocvt
  340.     del ecocvt
  341.     
  342. distribution:
  343.     -patchlevel=`cat $(DISTDIR)/gnuchess-$(VERS)/src/version.h|grep patchlevel|sed -e 's/[^0-9]//g'` ;\
  344.     echo "GNU patchlevel is $$patchlevel" ;\
  345.     cd $(DISTDIR) ;\
  346.     rm -f gnuchess.tar.$(VERS).Z* gnuchess.tar.$(VERS).Z.uu* ;\
  347.     tar cf - $(PROGS) | compress > $(DISTDIR)/gnuchess-$(VERS).pl$$patchlevel.tar.Z ;\
  348.     uuencode gnuchess-$(VERS).pl$$patchlevel.tar.Z gnuchess-$(VERS).pl$$patchlevel.tar.Z > gnuchess-$(VERS).pl$$patchlevel.tar.Z.uu ;\
  349.     rm -f x?? ;\
  350.     split -2500 gnuchess-$(VERS).pl$$patchlevel.tar.Z.uu ;\
  351.     for i in x??; do \
  352.       mv $$i $(DISTDIR)/GNU_Chess_$$i; \
  353.     done
  354.  
  355. gnuchess.dat: $(BOOK)
  356.     -del input.tmp
  357.     -del textbook.tmp 
  358.     -del gnuchess.dat
  359.     echo 3 0 > input.tmp
  360.     echo quit >> input.tmp
  361.     gzip -d -c $(BOOK) > textbook.tmp
  362.     gnuchesr < input.tmp -b textbook.tmp -B gnuchess.dat $(BOOKOPTS)
  363.     del input.tmp 
  364.     del textbook.tmp
  365.  
  366. # Currently eco support does not work on MSDOS, so this is not built:
  367. gnuchess.eco: ecor.exe binsort.exe ecocvt.exe ecosort.exe
  368.     -del step0.eco
  369.     -del step1.eco
  370.     -del step2.eco
  371.     -del gnuchess.eco
  372.     echo 0 0 > step0.eco
  373.     ecor -b ../book/eco.pgn -B step1.eco < step0.eco
  374.     ecosort
  375.     ecocvt step2.eco gnuchess.eco
  376.     del step0.eco
  377.     del step1.eco
  378.     del step2.eco
  379.  
  380. install:
  381.     -copy gnuchesr.exe $(BINDIR1)\gnuchesr.exe
  382.     -copy gnuchesn.exe $(BINDIR1)\gnuchesn.exe
  383.     -copy postprin.exe $(BINDIR1)\postprin.exe
  384.     -copy gnuan.exe $(BINDIR1)\gnuan.exe
  385.     -copy gnuchess.dat $(LIBDIR1)\gnuchess.dat
  386.     -copy ..\misc\gnuchess.lang $(LIBDIR1)\gnuchess.lan
  387.  
  388. clean:
  389.     -del *.o
  390.     -del *.exe
  391.  
  392.