eliot/extras/contrib/Makefile
Olivier Teulière 3c7a84d543 Support saving/loading games (any game type) in XML format.
Status:
It works well, but there are still a few details to improve/fix

More details about the changes:
 - New dependency on Arabica and Libxml2 to parse the XML
 - Loading the old format is still supported for this release, but won't be supported anymore in the next one
 - Games are now only saved in the new format
 - In training mode, the player is now created externally, like in the other modes
 - Avoid using GameIO (the one from game/) whenever possible
 - Do not use a FILE* argument anymore when loading a game
 - Throw and catch exceptions correctly when a game cannot be loaded or saved
 - The non-regression tests now use a new method to print the game history
2009-11-29 16:01:31 +00:00

130 lines
4.3 KiB
Makefile

ICONV_VERSION = 1.12
LIBCONFIG_VERSION = 1.3.2
BOOST_VERSION = 1_39_0
QT_VERSION = 4.5.3
LIBXML2_VERSION = 2.7.5
ARABICA_VERSION = 2009-march
PREFIX = $(shell pwd)/inst
WGET = wget -c
# XXX: Hardcoded for mingw on linux, at the moment
CC = i586-mingw32msvc-gcc
CXX = i586-mingw32msvc-g++
CPPFLAGS += -I$(PREFIX)/include
CONFIGURE = CC="$(CC)" CXX="$(CXX)" CPPFLAGS="$(CPPFLAGS)" ./configure --host=i586-mingw32msvc --build=i386-linux --prefix=$(PREFIX)
.PHONY: help all
all: .iconv .boost .qt .libconfig
help:
@echo "Usage: make all"
$(PREFIX):
mkdir -p $@
### iconv ###
ICONV_DIR = libiconv-$(ICONV_VERSION)
ICONV_ARCHIVE = libiconv-$(ICONV_VERSION).tar.gz
$(ICONV_ARCHIVE): $(PREFIX)
$(WGET) http://ftp.gnu.org/pub/gnu/libiconv/$@
$(ICONV_DIR): $(ICONV_ARCHIVE)
tar xzf $<
.iconv: $(ICONV_DIR)
(cd $< && $(CONFIGURE) --enable-static --disable-shared && make && make install)
touch $@
### libconfig ###
LIBCONFIG_DIR = libconfig-$(LIBCONFIG_VERSION)
LIBCONFIG_ARCHIVE = libconfig-$(LIBCONFIG_VERSION).tar.gz
$(LIBCONFIG_ARCHIVE): $(PREFIX)
$(WGET) http://www.hyperrealm.com/libconfig/$@
$(LIBCONFIG_DIR): $(LIBCONFIG_ARCHIVE)
tar xvf $<
.libconfig: $(LIBCONFIG_DIR)
(cd $< && CFLAGS=-DLIBCONFIG_STATIC CXXFLAGS=-DLIBCONFIG_STATIC $(CONFIGURE) --enable-static --disable-shared && make && make install)
touch $@
### Boost ###
BOOST_DIR = boost_$(BOOST_VERSION)
BOOST_ARCHIVE = boost_$(BOOST_VERSION).tar.bz2
$(BOOST_ARCHIVE): $(PREFIX)
$(WGET) http://garr.dl.sourceforge.net/sourceforge/boost/$@
$(BOOST_DIR): $(BOOST_ARCHIVE)
tar xjf $<
# We don't build any library, because we don't need them (and it is really
# hard to cross-compile with their crappy build system)
.boost: $(BOOST_DIR)
#(cd $< && ./configure --prefix=$(PREFIX) && ./tools/jam/src/bin.linuxx86/bjam --toolset=gcc --prefix=$(PREFIX) --without-date_time --without-filesystem --without-graph --without-iostreams --without-program_options --without-python --without-regex --without-serialization --without-signals --without-test --without-thread --without-wave install)
cp -r $</boost $(PREFIX)/include
touch $@
### Qt ###
# FIXME: No automated way to build it at the moment :-(
QT_ARCHIVE = qt4-$(QT_VERSION)-win32-bin.tar.bz2
QT_DIR = qt4-$(QT_VERSION)-win32-bin
$(QT_ARCHIVE): $(PREFIX)
$(WGET) http://dl.sv.nongnu.org/releases-noredirect/eliot/other/$@
$(QT_DIR): $(QT_ARCHIVE)
tar xjf $<
.qt: $(QT_DIR)
#(cd $<; mkdir -p $(PREFIX)/bin; mkdir -p $(PREFIX)/include; mkdir -p $(PREFIX)/lib/pkgconfig; rm -f $(PREFIX)/lib/pkgconfig/Qt*; sed 's,@@PREFIX@@,$(PREFIX),' lib/pkgconfig/QtCore.pc.in > $(PREFIX)/lib/pkgconfig/QtCore.pc; sed 's,@@PREFIX@@,$(PREFIX),' lib/pkgconfig/QtGui.pc.in > $(PREFIX)/lib/pkgconfig/QtGui.pc; cp -r include/* $(PREFIX)/include; cp lib/*a $(PREFIX)/lib; mkdir -p $(PREFIX)/share/qt4/translations; cp -r share/translations/* $(PREFIX)/share/qt4/translations)
(cd $<; cp -r bin include lib share $(PREFIX); sed 's,@@PREFIX@@,$(PREFIX),' $(PREFIX)/lib/pkgconfig/QtCore.pc.in > $(PREFIX)/lib/pkgconfig/QtCore.pc; sed 's,@@PREFIX@@,$(PREFIX),' lib/pkgconfig/QtGui.pc.in > $(PREFIX)/lib/pkgconfig/QtGui.pc; rm $(PREFIX)/lib/pkgconfig/*.in)
touch $@
### LibXML 2 ###
LIBXML2_DIR = libxml2-$(LIBXML2_VERSION)
LIBXML2_ARCHIVE = libxml2-$(LIBXML2_VERSION).tar.gz
$(LIBXML2_ARCHIVE): $(PREFIX)
$(WGET) ftp://xmlsoft.org/libxml2/$@
$(LIBXML2_DIR): $(LIBXML2_ARCHIVE)
tar xzf $<
# TODO: add more --without-xxx flags (apparently needed for build: pattern, debug)
# --with-legacy and --with-html are needed for arabica
.libxml2: $(LIBXML2_DIR)
(cd $< && $(CONFIGURE) --enable-static --disable-shared --with-legacy --without-schematron --without-tree --without-zlib --without-http --without-ftp --without-html --without-python --without-docbook --without-regexps && make install)
touch $@
### Arabica ###
ARABICA_DIR = arabica-$(ARABICA_VERSION)
ARABICA_ARCHIVE = arabica-$(ARABICA_VERSION).tar.bz2
$(ARABICA_ARCHIVE): $(PREFIX)
$(WGET) http://downloads.sourceforge.net/project/arabica/arabica/March-09/$@?use_mirror=ovh
$(ARABICA_DIR): $(ARABICA_ARCHIVE)
tar xjf $<
.arabica: $(ARABICA_DIR)
(cd $< && patch -p0 < ../arabica-no-example.patch && $(CONFIGURE) --enable-static --disable-shared --with-parser=libxml2 --with-libxml2=$(PREFIX) --with-boost=$(PREFIX) --with-tests=no --with-dom=no && make install)
touch $@