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

  1. #
  2. # Makefile for GNU Chess
  3. #
  4. # Copyright (c) 1992 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. # gnuchess  is a curses-based chess.
  25. # gnuchessn is a fancy-display-curses-based chess.
  26. # gnuchessr is a plain dumb-terminal chess (but with full variation output)
  27. # gnuchessc is suitable for chesstool use (mimics /usr/games/chess output)
  28. # gnuchessx is the xchess based chess.
  29. #
  30.  
  31. # The version number of this GNU and Xboard release
  32. VERS=    4.0
  33. XVERS = 2.0
  34.  
  35. # Relevant file areas.
  36. DIST=    ../README ../README.lang ../doc ../misc ../src ../test
  37.  
  38. # Distribution directory
  39. DISTDIR=/tmp_mnt/home/fsf/cracraft/gnuchess-4.0
  40.  
  41. # Programs being distributed
  42. PROGS=gnuchess-$(VERS) xboard-$(XVERS)
  43. #PROGS=gnuchess-$(VERS)
  44.  
  45. LIBS = 
  46.  
  47. # Change these to something less transitory, like /usr/games, and then
  48. # compile. Ask your system admin / unix guru to put gnuchess.{hash,lang,book}
  49. # in $(LIBDIR).
  50. # Where the binaries live.
  51. BINDIR= /games/gnu40/bin
  52. BINDIR1 = \games\gnu40\bin
  53.  
  54. # Where language description, our book, and the persistent hash live.
  55. LIBDIR= /games/gnu40/misc
  56. LIBDIR1 = \games\gnu40\misc
  57.  
  58. # Display routines.
  59. LCURSES=-lcurses -ltermcap
  60.  
  61. #compile options for gnuchess
  62. # -DAG[0-4]  selects a set of values for SpaceBonus tables
  63. # -DQUIETBACKGROUND don't print post information in background ( easy OFF)
  64. # -DNOMEMSET if your machine does not support memset
  65. # -DNOMATERIAL don't call it a draw when no pawns and both sides < rook
  66. # -DNODYNALPHA don't dynamically adjust alpha
  67. # -DHISTORY use history killer hueristic 
  68. # -DKILLT use killt killer hueristic 
  69. # -DHASGETTIMEOFDAY use gettimeofday for more accurate timing
  70. # -DCLIENT create client version for use with ICS
  71. # -DNOSCORESPACE don't use Scorespace heuristic
  72. # -DOLDXBOARD don't generate underpromote moves
  73. # -DGNU3 don't generate underpromote moves
  74. # -DLONG64 if you have 64bit longs
  75. # -DSYSV   if you are using SYSV
  76. # -DCACHE  Cache static evaluations 
  77. # -DE4OPENING always open e4 if white and respond to e4 with e5 if black
  78. # -DQUIETBOOKGEN Don't print errors while loading a book or generating a binbook
  79. # -DSEMIQUIETBOOKGEN Print less verbose errors while reading book or generating binbook
  80. # -DGDX  use random file based book
  81. # -DNULLMOVE include null move heuristic
  82. # some debug options
  83. # -DDEBUG8 dump board,movelist,input move to /tmp/DEBUG if illegal move
  84. # -DDEBUG9 dump move list from test command
  85. # -DDEBUG10 dump board and move after search before !easy begins
  86. # -DDEBUG11 dump board when the move is output
  87. # -DDEBUG12 dump boards between moves
  88. # -DDEBUG13 dump search control information for each move to /tmp/DEBUG
  89. # -DDEBUG40 include extra values of variables for debugging  in game list
  90. # -DDEBUG41 dump post output to /tmp/DEBUG
  91. # the rest of the debug options are tied to the debuglevel command
  92. # -DDEBUG -DDEBUG4 set up code for debuglevel command
  93. #          debuglevel
  94. #               1 always force evaluation in evaluate
  95. #               4 print move list after search
  96. #               8 print move list after book before search
  97. #              16 print move list after each ply of search
  98. #              32 print adds to transposition table
  99. #              64 print returns from transposition table lookups
  100. #          256 print search tree as it is generated
  101. #          512 debug trace
  102. #         1024 interactive tree print
  103. #            debug? p#  where # is no. of plys to print from top of tree (default all plys)
  104. #                   XXXX moves specifying branch of tree to print (default all branches)
  105. #                   return terminates input
  106. #         2048 non-interactive trace print
  107.  
  108. # gnufour
  109. #OPT= -DHASGETTIMEOFDAY -DGNU3 -DHISTORY -DSEMIQUIETBOOKGEN -DQUIETBACKGROUND -DGDX  -DNULLMOVE -DCACHE -DCLIENT
  110. # normal
  111. OPT= -DQUIETBACKGROUND -DGNU3 -DHISTORY -DGDX -DSEMIQUIETBOOKGEN -DNULLMOVE
  112.  
  113. # The hashfile is a record of positions seen. It is used by
  114. # GNU Chess to avoid making the same mistakes, a form of learning.
  115. HASH=    -DHASHFILE=\"$(LIBDIR)/gnuchess.hash\"
  116.  
  117. # The "book" is a record of the first few moves, for playing good
  118. # moves easily and quickly, saving time, and irritating the human
  119. # opponent.
  120. #BOOK=    -DBOOK=\"$(LIBDIR)/gnuchess.book\"
  121. BOOK=    
  122. BINBOOK = -DBINBOOK=\"$(LIBDIR)/gnuchess.data\"
  123.  
  124. # The language file describes capabilities of the program. Perhaps
  125. # it is useful for non-English speaking countries and customizing
  126. # for their convenience and chess happiness.
  127. LANG= -DLANGFILE=\"$(LIBDIR)/gnuchess.lang\"
  128.  
  129. # The compiler used for compiling this software.
  130. # Use this for a plain C compiler 
  131. #CC= cc $(OPT)
  132. # Use this for DEC's ANSI C compiler on Ultrix
  133. #CC= c89 $(OPT)
  134. # Use this if you are lucky enough to have GNU CC.
  135. #CC=     gcc -W  $(OPT)
  136. #CC=    /contrib/system/bin/gcc -W $(OPT)
  137. # Use this if you are using Microsoft C 7.0 for MSDOS
  138. CC= cl
  139.  
  140. # Miscellaneous CFLAGS. Uncomment the one you need and comment 
  141. # the other.
  142. #CFLAGS= -p -Dinline=""     -traditional-cpp
  143. #CFLAGS= -O4 -Qpath .  # SunOS cc using unprotoize
  144. #CFLAGS= -O4 # Sun acc
  145. #CFLAGS= -g -traditional-cpp  # debug
  146. #CFLAGS= -O2 # DEC ANSI C (c89) on Ultrix.
  147. #CFLAGS= +O3 -Aa -D_HPUX_SOURCE -DSYSV # HPUX cc 
  148. #CFLAGS= -O   -finline-functions -fstrength-reduce -D__mips -D__LANGUAGE_C # gnu cc 1.40 on DS5000
  149. #CFLAGS= -O   -finline-functions -fstrength-reduce  # gnu cc 1.40 on others
  150. #CFLAGS= -O2 -funroll-loops -D__mips -D__LANGUAGE_C # gnu cc 2.00 on DS5000
  151. #CFLAGS= -O2 -D__alpha -D__LANGUAGE_C # gnu cc 2.00 on Flamingo
  152. #CFLAGS= -O2 -funroll-loops -traditional-cpp  # gnu cc  2.00 on SunOS
  153. #CFLAGS= -O2 -funroll-loops  # gnu cc  2.00 on others
  154. CFLAGS= /AH /Ox /G2 /W3 $(OPT) # Microsoft C 7.0
  155.  
  156. all : gnuchess.exe gnuchesr.exe gnuchesn.exe postprint.exe gnuan.exe game.exe bincheckr.exe checkgame.exe
  157.  
  158. gnuchess.exe: mainN.obj bookN.obj genmoveN.obj ataks.obj util.obj evalN.obj init.obj searchN.obj dspcomN.obj uxdsp.obj
  159.         $(CC) @<<
  160.         $(CFLAGS) $(HASH) $(LANG) $(BOOK) /Fegnuchess.exe mainN.obj bookN.obj genmoveN.obj ataks.obj util.obj evalN.obj init.obj searchN.obj dspcomN.obj uxdsp.obj $(LIBS) /F 2000
  161. <<
  162.  
  163. gnuan.exe: mainN.obj bookN.obj genmoveN.obj ataks.obj util.obj evalN.obj init.obj searchN.obj gnuan.obj
  164.         $(CC) @<<
  165.         $(CFLAGS) $(HASH) $(LANG) $(BOOK) /Fegnuan.exe mainN.obj bookN.obj genmoveN.obj ataks.obj util.obj evalN.obj init.obj searchN.obj gnuan.obj $(LIBS) /F 2000
  166. <<
  167.  
  168. Dgnuchesr.exe: mainDR.obj bookN.obj genmoveN.obj ataks.obj utilDR.obj evalDR.obj init.obj searchDR.obj dspcomDR.obj nondspDR.obj
  169.         $(CC) @<<
  170.         -DDEBUG  -DDEBUG4 $(CFLAGS) $(HASH) $(LANG) $(BOOK) /Fe gnuchesr.exe mainDR.obj bookN.obj genmoveN.obj ataks.obj utilDR.obj evalDR.obj init.obj searchDR.obj dspcomDR.obj nondspDR.obj $(LIBS) /F 2000
  171. <<
  172.  
  173. gnuchesr.exe: mainN.obj bookN.obj genmoveN.obj ataks.obj util.obj evalN.obj init.obj searchN.obj dspcomR.obj nondspR.obj
  174.         $(CC) @<<
  175.         $(CFLAGS) $(HASH) $(LANG) $(BOOK) /Fegnuchesr.exe mainN.obj bookN.obj genmoveN.obj ataks.obj util.obj evalN.obj init.obj searchN.obj dspcomR.obj nondspR.obj /F 2000
  176. <<
  177.  
  178. gnuchesn.exe: mainN.obj bookN.obj genmoveN.obj ataks.obj util.obj evalN.obj init.obj searchN.obj dspcomN.obj nuxdsp.obj
  179.         $(CC) @<<
  180.         $(CFLAGS) $(HASH) $(LANG) $(BOOK) /Fegnuchesn.exe mainN.obj bookN.obj genmoveN.obj ataks.obj util.obj evalN.obj init.obj searchN.obj dspcomN.obj nuxdsp.obj /F 2000
  181. <<
  182.  
  183. game.exe: game.c gnuchess.h
  184.         $(CC) $(CFLAGS) game.c
  185.     
  186. postprint.exe: postprint.obj
  187.         $(CC) @<<
  188.         $(CFLAGS) $(HASH) postprint.obj
  189. <<
  190.     
  191. bincheckr.exe: bincheckr.obj
  192.         $(CC) $(CFLAGS) bincheckr.obj
  193.     
  194. checkgame.exe: checkgame.obj
  195.         $(CC) $(CFLAGS) checkgame.obj
  196.  
  197. gnuan.obj: gnuan.c gnuchess.h version.h
  198.         $(CC) @<<
  199.         $(CFLAGS) $(HASH) $(LANG) $(BOOK) -c gnuan.c
  200. <<
  201.  
  202. mainN.obj: main.c gnuchess.h version.h
  203.         $(CC) @<<
  204.         $(CFLAGS) $(HASH) $(LANG) $(BOOK) $(BINBOOK) -c main.c
  205. <<
  206.         del mainN.obj
  207.         rename main.obj mainN.obj
  208. mainDR.obj: main.c gnuchess.h version.h
  209.         $(CC)  @<<
  210.         -DDEBUG -DDEBUG4 $(CFLAGS) $(HASH) $(LANG) $(BOOK) $(BINBOOK) \
  211.         -c main.c
  212. <<
  213.         del mainDR.obj
  214.         rename main.obj mainDR.obj
  215.  
  216. genmoveN.obj: genmove.c gnuchess.h version.h
  217.         $(CC) @<<
  218.         $(CFLAGS) $(HASH) $(LANG) $(BOOK) -c genmove.c
  219. <<
  220.         del genmoveN.obj
  221.         rename genmove.obj genmoveN.obj
  222.  
  223. bookN.obj: book.c gnuchess.h version.h ataks.h
  224.         $(CC) @<<
  225.         $(CFLAGS) $(HASH) $(LANG) $(BOOK) $(BINBOOK) -c book.c
  226. <<
  227.         del bookN.obj
  228.         rename book.obj bookN.obj
  229.  
  230. ataks.obj: ataks.h ataks.c gnuchess.h version.h
  231.         $(CC) @<<
  232.         $(CFLAGS) $(HASH) $(LANG) $(BOOK) -c ataks.c
  233. <<
  234.  
  235. util.obj: util.c gnuchess.h version.h
  236.         $(CC) @<<
  237.         $(CFLAGS) $(HASH) $(LANG) $(BOOK) -c util.c
  238. <<
  239.  
  240. evalN.obj: eval.c gnuchess.h version.h
  241.         $(CC) @<<
  242.         $(CFLAGS) $(HASH) $(LANG) $(BOOK) -c eval.c
  243. <<
  244.         del evalN.obj
  245.         rename eval.obj evalN.obj
  246. evalDR.obj: eval.c gnuchess.h version.h
  247.         $(CC)  @<<
  248.         -DDEBUG4 -DDEBUG $(CFLAGS) $(HASH) $(LANG) $(BOOK) \
  249.                 -c eval.c
  250. <<
  251.         del evalDR.obj
  252.         rename eval.obj evalDR.obj
  253. utilDR.obj: util.c gnuchess.h version.h
  254.         $(CC)  @<<
  255.         -DDEBUG4 -DDEBUG $(CFLAGS) $(HASH) $(LANG) $(BOOK) \
  256.                 -c util.c
  257. <<
  258.         del utilDR.obj
  259.         rename util.obj utilDR.obj
  260.  
  261. init.obj: init.c gnuchess.h version.h
  262.         $(CC) @<<
  263.         $(CFLAGS) $(HASH) $(LANG) $(BOOK) -c init.c
  264. <<
  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
  267.         $(CC) @<<
  268.         $(CFLAGS) $(HASH) $(LANG) $(BOOK) -c search.c
  269. <<
  270.         del searchN.obj
  271.         rename search.obj searchN.obj
  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
  273.         $(CC)  @<<
  274.         -DDEBUG4 -DDEBUG $(CFLAGS) $(HASH) $(LANG) $(BOOK) \
  275.                 -c search.c
  276. <<
  277.         del searchDR.obj
  278.         rename search.obj searchDR.obj
  279.  
  280. uxdsp.obj: uxdsp.c gnuchess.h version.h
  281.         $(CC) @<<
  282.         $(CFLAGS) $(HASH) $(LANG) $(BOOK) -c uxdsp.c
  283. <<
  284.  
  285. nuxdsp.obj: nuxdsp.c gnuchess.h version.h
  286.         $(CC) @<<
  287.         $(CFLAGS) $(HASH) $(LANG) $(BOOK) -c nuxdsp.c
  288. <<
  289.  
  290. nondspR.obj: nondsp.c gnuchess.h version.h
  291.         $(CC) @<<
  292.         $(CFLAGS) $(HASH) $(LANG) $(BOOK) -DNONDSP \
  293.                 -c nondsp.c
  294. <<
  295.         del nondspR.obj
  296.         rename nondsp.obj nondspR.obj
  297. nondspDR.obj: nondsp.c gnuchess.h version.h
  298.         $(CC) @<<
  299.         -DDEBUG4 -DDEBUG $(CFLAGS) $(HASH) $(LANG) $(BOOK) -DNONDSP \
  300.          -c nondsp.c 
  301. <<
  302.         del nondspDR.obj
  303.         rename nondsp.obj nondspDR.obj
  304.  
  305. dspcomN.obj: dspcom.c gnuchess.h version.h
  306.         $(CC) @<<
  307.         $(CFLAGS) $(HASH) $(LANG) $(BOOK) -c dspcom.c
  308. <<
  309.         del dspcomN.obj
  310.         rename dspcom.obj dspcomN.obj
  311. dspcomR.obj: dspcom.c gnuchess.h version.h
  312.         $(CC) @<<
  313.         $(CFLAGS) $(HASH) $(LANG) $(BOOK) -DNONDSP \
  314.                 -c dspcom.c
  315. <<
  316.         del dspcomR.obj
  317.         rename dspcom.obj dspcomR.obj
  318. dspcomDR.obj: dspcom.c gnuchess.h version.h
  319.         $(CC)  @<<
  320.         -DDEBUG -DDEBUG4 $(CFLAGS) $(HASH) $(LANG) $(BOOK) -DNONDSP \
  321.                 -c dspcom.c
  322. <<
  323.         del dspcomDR.obj
  324.         rename dspcom.obj dspcomDR.obj
  325.  
  326. postprint.obj: postprint.c gnuchess.h version.h
  327.         $(CC) @<<
  328.         $(CFLAGS) $(HASH) -c postprint.c
  329. <<
  330.  
  331. distribution:
  332.     -patchlevel=`cat $(DISTDIR)/gnuchess-$(VERS)/src/version.h|grep patchlevel|sed -e 's/[^0-9]//g'` ;\
  333.     echo "GNU patchlevel is $$patchlevel" ;\
  334.     xpatchlevel=`cat $(DISTDIR)/xboard-$(XVERS)/patchlevel.h|sed -e "s/#define PATCHLEVEL //"` ;\
  335.     cd $(DISTDIR) ;\
  336.     rm -f gnuchess.tar.$(VERS).Z* gnuchess.tar.$(VERS).Z.uu* ;\
  337.     tar cf - $(PROGS) | compress > $(DISTDIR)/gnuchess-$(VERS).pl$$patchlevel.tar.Z ;\
  338.     uuencode gnuchess-$(VERS).pl$$patchlevel.tar.Z gnuchess-$(VERS).pl$$patchlevel.tar.Z > gnuchess-$(VERS).pl$$patchlevel.tar.Z.uu ;\
  339.     rm -f x?? ;\
  340.     split -2500 gnuchess-$(VERS).pl$$patchlevel.tar.Z.uu ;\
  341.     for i in x??; do \
  342.           rename $$i $(DISTDIR)/GNU_Chess_$$i; \
  343.     done
  344.  
  345. install:
  346.         -copy gnuchesr.exe $(BINDIR1)\gnuchesr.exe
  347.         -copy gnuchesn.exe $(BINDIR1)\gnuchesn.exe
  348.         -copy postprint.exe $(BINDIR1)\postprint.exe
  349.         -copy gnuan.exe $(BINDIR1)\gnuan.exe
  350.         -copy gnuchess.exe $(BINDIR1)\gnuchess.exe
  351.         -copy bincheckr.exe $(BINDIR1)\bincheckr.exe
  352.         -copy checkgame.exe $(BINDIR1)\checkgame.exe
  353.         -copy ../misc/gnuchess.book $(LIBDIR1)\gnuchess.book
  354.         -copy ../misc/gnuchess.lang $(LIBDIR1)\gnuchess.lang
  355.  
  356. clean:
  357.     -rm -f gnuchessx gnuchessc gnuchess gnuchessr gnuchessn gnuchessd postprint gnuan bincheckr checkgame game
  358.     -echo $(DISTDIR)
  359.     -rm -f $(DISTDIR)/gnuchess-4.0/misc/gnuchess.book.data
  360.         -find $(DISTDIR) \( -name '*.obj' -o -name '*~' -o -name 'CL*' -o -name 'PATCH*' -o -name '#*#' -o -name '%*%' -o -name '*orig' \) -exec rm -f {} \;
  361.