##### Makefile for Scid for Unix operating systems. CXX = g++ CC = gcc LINK = g++ # BINDIR: where the Scid programs are copied for "make install". BINDIR = /usr/local/bin SHAREDIR = /usr/local/share/scid FONTDIR = /Library/Fonts/ ### TCL_VERSION: Set this according to the version of Tcl/Tk you have # installed that you want Scid to use: 8.5 / 8.6 / ... TCL_VERSION = 8.5 # TCL_INCLUDE, TCL_LIBRARY, TK_LIBRARY: these are the compiler options # needed for linking Scid with Tcl/Tk. The program "./configure" # will try to determine them automatically, but if it cannot, you # can use the examples below for help in setting these variables. # # The settings determined by "./configure" are: TCL_INCLUDE = -F/System/Library/Frameworks/Tcl.framework -F/System/Library/Frameworks/Tk.framework TCL_LIBRARY = -framework Tcl -ldl TK_LIBRARY = $(TCL_LIBRARY) -framework Tk ### Nalimov tablebases # TB = for no tablebase support # TB = -DSCID_USE_TB for tablebase support # TB = -DSCID_USE_TB -DT41_INCLUDE # for use of 4-1 (King + 3 pieces vs lone king) tablebases. TB = -DSCID_USE_TB -DT41_INCLUDE ### SCIDFLAGS: Scid customization flags. # Use -DZLIB if your system does not have zlib and you need # to include the code in the src/zlib directory. # The default is to use the system zlib library. SCIDFLAGS = ### DEBUG: Defining the macro ASSERTIONS will turn on assertions, which # helps to track bugs after modifications, but the programs will run # a little faster with assertions turned off. DEBUG = #-DASSERTIONS WARNINGS = -Wall # On some systems, adding "-fno-rtti" and "-fno-exceptions" produces # smaller, faster programs since Scid does not use those C++ features. CFLAGS = -O2 -fno-exceptions $(WARNINGS) $(DEBUG) CXXFLAGS = -fno-rtti $(CFLAGS) $(SCIDFLAGS) LDFLAGS = ### LANGUAGES: List of additional Tcl files to include in Scid for # multi-language menu support. # By default, it is all the contributed languages, but you # can reduce the size of the Scid program by only specifying # the languages you want supported. LANGUAGES = tcl/lang/deutsch.tcl tcl/lang/francais.tcl tcl/lang/italian.tcl tcl/lang/nederlan.tcl tcl/lang/spanish.tcl tcl/lang/portbr.tcl tcl/lang/swedish.tcl tcl/lang/norsk.tcl tcl/lang/polish.tcl tcl/lang/czech.tcl tcl/lang/hungary.tcl tcl/lang/serbian.tcl ############################################################ # # You should not need to edit anything below this line. # ############################################################ ### EXECS: executable programs compiled from C++ files. # Note: scidt and eco2epd are obsolete and not compiled by default. EXECS= pgnscid tkscid tcscid scmerge scidlet ### SCIDOBJS: not all the .o files that make up Scid, just the standard ones # that most of the programs include. SCIDOBJS= src/misc.o src/index.o src/date.o src/namebase.o src/position.o \ src/game.o src/gfile.o src/matsig.o src/bytebuf.o src/textbuf.o \ src/myassert.o src/stralloc.o src/mfile.o src/dstring.o src/pgnparse.o \ src/stored.o src/movelist.o \ src/polyglot/attack.o src/polyglot/board.o src/polyglot/book.o \ src/polyglot/book_make.o src/polyglot/book_merge.o src/polyglot/colour.o \ src/polyglot/fen.o src/polyglot/game.o src/polyglot/hash.o \ src/polyglot/io.o src/polyglot/line.o src/polyglot/list.o src/polyglot/main.o src/polyglot/move.o \ src/polyglot/move_do.o src/polyglot/move_gen.o src/polyglot/move_legal.o src/polyglot/option.o \ src/polyglot/parse.o src/polyglot/pgn.o src/polyglot/piece.o src/polyglot/random.o \ src/polyglot/san.o src/polyglot/search.o src/polyglot/square.o src/polyglot/util.o ### ZLIBOBJS: object files in the zlib compression library. ZLIBOBJS= src/zlib/adler32.o src/zlib/compress.o src/zlib/crc32.o \ src/zlib/gzio.o src/zlib/uncompr.o src/zlib/deflate.o src/zlib/trees.o \ src/zlib/zutil.o src/zlib/inflate.o src/zlib/infblock.o \ src/zlib/inftrees.o src/zlib/infcodes.o src/zlib/infutil.o \ src/zlib/inffast.o ### ZLIB: Should be "-lz" if your system has zlib, "" otherwise. ZLIB = -lz ### OBJS: Will be "$(SCIDOBJS)", "$(POLYGLOTOBJS)", and also "$(ZLIBOBJS)" if they are # needed on your system. OBJS= $(SCIDOBJS) ### TCLS: all the .tcl files that make up "scid". TCLS= \ tcl/start.tcl \ tcl/config.tcl \ tcl/bitmaps.tcl \ tcl/language.tcl \ tcl/utils.tcl \ tcl/utils/date.tcl tcl/utils/font.tcl tcl/utils/graph.tcl tcl/utils/history.tcl \ tcl/utils/pane.tcl tcl/utils/sound.tcl tcl/utils/string.tcl tcl/utils/tooltip.tcl \ tcl/utils/validate.tcl tcl/utils/win.tcl \ tcl/misc/misc.tcl tcl/htext.tcl \ tcl/file.tcl \ tcl/file/finder.tcl tcl/file/bookmark.tcl tcl/file/recent.tcl tcl/file/epd.tcl \ tcl/file/spellchk.tcl tcl/file/maint.tcl \ tcl/edit.tcl \ tcl/game.tcl \ tcl/game/browser.tcl \ tcl/windows.tcl \ tcl/windows/gamelist.tcl tcl/windows/pgn.tcl tcl/windows/book.tcl \ tcl/windows/comment.tcl tcl/windows/eco.tcl \ tcl/windows/stats.tcl tcl/windows/tree.tcl tcl/windows/crosstab.tcl \ tcl/windows/pfinder.tcl tcl/windows/tourney.tcl tcl/windows/switcher.tcl \ tcl/search/search.tcl \ tcl/search/board.tcl tcl/search/header.tcl tcl/search/material.tcl \ tcl/contrib/ezsmtp/ezsmtp.tcl \ tcl/tools/email.tcl \ tcl/tools/import.tcl \ tcl/tools/optable.tcl tcl/tools/preport.tcl tcl/tools/pinfo.tcl \ tcl/tools/analysis.tcl tcl/tools/comp.tcl tcl/tools/wbdetect.tcl \ tcl/tools/reper.tcl tcl/tools/graphs.tcl tcl/tools/tablebase.tcl tcl/tools/ptracker.tcl \ tcl/help/help.tcl tcl/help/tips.tcl \ tcl/menus.tcl tcl/board.tcl tcl/move.tcl tcl/main.tcl tcl/tools/correspondence.tcl \ tcl/lang/english.tcl $(LANGUAGES) \ tcl/tools/fics.tcl tcl/tools/uci.tcl tcl/end.tcl tcl/tools/tacgame.tcl tcl/tools/sergame.tcl tcl/tools/calvar.tcl tcl/tools/tactics.tcl tcl/tools/novag.tcl tcl/misc/flags.tcl tcl/tools/inputengine.tcl ### SCRIPTS: # Small extra programs. Most are written in Tcl using tcscid, but # a few contributed ones may be in Python or other languages. SCRIPTS= sc_addmove sc_epgn sc_spell sc_eco sc_import sc_remote sc_tree scidpgn pgnfix spliteco #################### ### Type "make" or "make all" to make all programs: all: all_scid engines all_scid: scid $(SCRIPTS) $(EXECS) engines: phalanx toga phalanx: $(MAKE) -C engines/phalanx/ -f Makefile CC="$(CC)" LINK="$(LINK)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" toga: $(MAKE) -C engines/toga/src -f Makefile CXX="$(CXX)" LINK="$(LINK)" CXXFLAGS="$(CXXFLAGS)" LDFLAGS="$(LDFLAGS)" ### To copy all executables to $BINDIR, with read and execute permission # for all users, and put extra files in $SHAREDIR, type "make install". install: install_scid install_engines install_scid: all_scid install -m 755 -d $(SHAREDIR) install -m 755 -d $(BINDIR) install -m 755 -d $(SHAREDIR)/data/ install -m 755 scid $(SCRIPTS) $(EXECS) $(BINDIR) install -m 644 -p scid.eco $(SHAREDIR)/data/ install -m 644 -p spelling.ssp $(SHAREDIR) install -m 755 -d $(SHAREDIR)/books install -m 666 ./books/* $(SHAREDIR)/books/ install -m 755 -d $(SHAREDIR)/bases install -m 666 ./bases/* $(SHAREDIR)/bases/ install -m 755 -d $(SHAREDIR)/html cp -r ./html/* $(SHAREDIR)/html/ chmod -R 0777 $(SHAREDIR)/html/* install -m 755 -d $(SHAREDIR)/bitmaps cp -r ./bitmaps/* $(SHAREDIR)/bitmaps/ chmod -R 0777 $(SHAREDIR)/bitmaps/* @if [ "`id -u`" -eq 0 ]; then \ install -m 644 -p fonts/*.ttf $(FONTDIR); \ else \ install -m 644 -p fonts/*.ttf ~/Library/Fonts; \ fi install_engines: engines install -m 755 -d $(SHAREDIR)/engines install -m 755 -d $(SHAREDIR)/engines/phalanx install ./engines/phalanx/phalanx $(SHAREDIR)/engines/phalanx install -m 755 -d $(SHAREDIR)/engines/toga install ./engines/toga/src/fruit $(SHAREDIR)/engines/toga/ uninstall: rm -rf $(SHAREDIR)/engines rm -rf $(SHAREDIR)/books rm -rf $(SHAREDIR)/bases rm -rf $(SHAREDIR)/data/ rm -f $(SHAREDIR)/data/scid.eco rm -f $(SHAREDIR)/spelling.ssp rm -f $(BINDIR)/scid $(BINDIR)/sc_addmove $(BINDIR)/sc_epgn rm -f $(BINDIR)/sc_spell $(BINDIR)/sc_eco $(BINDIR)/sc_import rm -f $(BINDIR)/sc_remote $(BINDIR)/sc_tree $(BINDIR)/scidpgn rm -f $(BINDIR)/pgnfix $(BINDIR)/spliteco rm -f $(BINDIR)/pgnscid $(BINDIR)/tkscid $(BINDIR)/tcscid rm -f $(BINDIR)/scmerge $(BINDIR)/scidlet rm -f $(BINDIR)/phalanx $(BINDIR)/fruit rm -rf $(SHAREDIR)/html rm -rf $(SHAREDIR)/bitmaps # Not going to uninstall OSX fonts.... # They all exist in the one directory, and don't want to trash it by accident # Get us back to as nearly a fresh distro state as we can # distclean: clean rm -f engines/toga/src/fruit rm -rf ./dist clean: rm -f game.* tkscid.so position.* src/*.o src/zlib/*.o src/zlib/*.a src/polyglot/*.o $(EXECS) scid $(SCRIPTS) cd engines/phalanx/ && make clean && cd ../../ cd engines/toga/src/ && make clean && cd ../../../ strip: strip $(EXECS) ### To compress scid and executables with gzexe: type "make gzexe". gzexe: gzexe $(EXECS) scid scid: $(TCLS) rm -f ./scid cat $(TCLS) > ./scid chmod +x scid ### Mac OSX App mac_app: all_scid engines install -m 755 -d dist/ScidvsMac5x5.app/Contents/MacOS install -m 755 -d dist/ScidvsMac5x5.app/Contents/Resources/data install -m 755 -d dist/ScidvsMac5x5.app/Contents/Resources/books install -m 755 -d dist/ScidvsMac5x5.app/Contents/Resources/bases install -m 755 -d dist/ScidvsMac5x5.app/Contents/Resources/engines install -m 755 -d dist/ScidvsMac5x5.app/Contents/Resources/engines/phalanx install -m 755 -d dist/ScidvsMac5x5.app/Contents/Resources/engines/toga install -m 755 -d dist/ScidvsMac5x5.app/Contents/Resources/html install -m 755 -d dist/ScidvsMac5x5.app/Contents/Resources/bitmaps install -m 755 $(SCRIPTS) $(EXECS) dist/ScidvsMac5x5.app/Contents/MacOS install -m 755 scid dist/ScidvsMac5x5.app/Contents/MacOS install -m 644 -p scid.eco dist/ScidvsMac5x5.app/Contents/Resources/data/ install -m 644 -p spelling.ssp dist/ScidvsMac5x5.app/Contents/Resources/ install -m 666 ./books/* dist/ScidvsMac5x5.app/Contents/Resources/books/ install -m 666 ./bases/* dist/ScidvsMac5x5.app/Contents/Resources/bases/ install -m 755 ./engines/phalanx/phalanx dist/ScidvsMac5x5.app/Contents/Resources/engines/phalanx/ install -m 755 ./engines/toga/*.txt dist/ScidvsMac5x5.app/Contents/Resources/engines/toga/ install -m 755 ./engines/toga/src/fruit dist/ScidvsMac5x5.app/Contents/Resources/engines/toga/ install -m 644 icons/scid.icns dist/ScidvsMac5x5.app/Contents/Resources/ install -m 644 Info.plist dist/ScidvsMac5x5.app/Contents/ cp -r ./html/* dist/ScidvsMac5x5.app/Contents/Resources/html/ cp -r ./bitmaps/* dist/ScidvsMac5x5.app/Contents/Resources/bitmaps/ cp -r README.html images dist/ mac_install: mac_app install -m 755 -d /Applications/ScidvsMac5x5.app cp -rp dist/ScidvsMac5x5.app/* /Applications/ScidvsMac5x5.app ### Compress App into an OSX disk image mac_dmg: mac_app hdiutil create -fs "HFS+" -volname "Scid vs. PC" -srcfolder dist ScidvsMac5x5.dmg # Change menu bindings and description mac_menus: sed -i "" -e "s/Control-/Command-/g" -e "s/Ctrl+/Command-/g" tcl/menus.tcl mac_rename: install_name_tool -change /Library/Frameworks/Tcl.framework/Versions/8.5/Tcl \ @executable_path/../Frameworks/Tcl.framework/Versions/8.5/Tcl tkscid install_name_tool -change /Library/Frameworks/Tk.framework/Versions/8.5/Tk \ @executable_path/../Frameworks/Tk.framework/Versions/8.5/Tk tkscid mac_buttons: patch -p0 scid