Makefile.mingw.in 5.45 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
# Makefile.mingw
#
# Author: Bruno Coudoin (from GAIM example)
# Description: Top Makefile for win32 (mingw) port of GCompris
#

VERSION = "@VERSION@"

pkgdatadir = gcompris

GCOMPRIS_SRC = ./src/gcompris
GCOMPRIS_BOARDS = ./src/boards
GCOMPRIS_INSTALL_DIR = ./win32-install-dir

GTK_TOP :=		/gtk
GNUWIN32_TOP :=		/gnuwin32
LIBXML2_TOP :=		/libxml2
SDL_TOP :=		/sdl
CANVAS_TOP :=		/gnomecanvas
GNUCHESS_TOP :=		/gnuchess
21 22
PYTHON_DLL :=		/c/WINDOWS/system32/python24.dll
PYTHON_TOP :=		/c/Python24
Bruno Coudoin's avatar
Bruno Coudoin committed
23
GNUCAP_TOP :=		/gnucap
24
SQLITE_TOP :=		/sqlite
25 26 27 28 29 30

MAKENSIS := "/c/Program Files/NSIS/makensis.exe"

# These will be copied in the win32-install-dir ready to be packaged.
NEEDED_DLLS =		$(GNUCHESS_TOP)/bin/pthreadGC.dll \
			$(GNUCHESS_TOP)/bin/libreadline.dll \
31
			$(PYTHON_DLL) \
Bruno Coudoin's avatar
Bruno Coudoin committed
32
			$(GNUCAP_TOP)/src/MSW/gnucap.exe \
33 34 35 36 37 38 39 40 41 42
			$(GTK_TOP)/bin/gspawn-win32-helper.exe \
			$(GNUCHESS_TOP)/bin/gnuchess.exe \
			$(GNUWIN32_TOP)/bin/libintl-2.dll \
			$(GNUWIN32_TOP)/bin/libiconv-2.dll \
			$(CANVAS_TOP)/bin/libgnomecanvas-2-0.dll \
			$(SDL_TOP)/bin/SDL.dll \
			$(SDL_TOP)/bin/SDL_mixer.dll \
			$(LIBXML2_TOP)/bin/libxml2.dll \
			$(GTK_TOP)/bin/freetype6.dll \
			$(GTK_TOP)/bin/intl.dll \
Bruno Coudoin's avatar
Bruno Coudoin committed
43 44
			$(GTK_TOP)/bin/libcairo-2.dll \
			$(GTK_TOP)/bin/libpangocairo-1.0-0.dll \
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
			$(GTK_TOP)/bin/libart_lgpl_2-2.dll \
			$(GTK_TOP)/bin/freetype6.dll \
			$(GTK_TOP)/bin/libart_lgpl_2-2.dll \
			$(GTK_TOP)/bin/libgdk-win32-2.0-0.dll \
			$(GTK_TOP)/bin/libgdk_pixbuf-2.0-0.dll \
			$(GTK_TOP)/bin/libglib-2.0-0.dll \
			$(GTK_TOP)/bin/libgmodule-2.0-0.dll \
			$(GTK_TOP)/bin/libgobject-2.0-0.dll \
			$(GTK_TOP)/bin/libpango-1.0-0.dll \
			$(GTK_TOP)/bin/libpangowin32-1.0-0.dll \
			$(GTK_TOP)/bin/libpangoft2-1.0-0.dll \
			$(GTK_TOP)/bin/libgtk-win32-2.0-0.dll \
			$(GTK_TOP)/bin/libatk-1.0-0.dll \
			$(GTK_TOP)/bin/libfontconfig-1.dll \
			$(GTK_TOP)/bin/zlib1.dll \
			$(GTK_TOP)/bin/libgthread-2.0-0.dll \
			$(GTK_TOP)/expat/bin/xmlparse.dll \
			$(GTK_TOP)/expat/bin/xmltok.dll \
			$(GTK_TOP)/bin/iconv.dll \
			$(GTK_TOP)/bin/intl.dll \
Bruno Coudoin's avatar
Bruno Coudoin committed
65
			$(GTK_TOP)/bin/libpng13.dll \
66
			$(GTK_TOP)/bin/jpeg62.dll \
67 68
			$(SQLITE_TOP)/sqlite3.dll \
			/c/WINDOWS/system32/msvcr71.dll
69 70

NEEDED_FILES =		README \
71
	     		README.mingw \
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87
			COPYING \
			Changelog

##
##

all:
	cp config.h.mingw config.h
	$(MAKE) -C $(GCOMPRIS_BOARDS) -f Makefile.mingw
	$(MAKE) -C $(GCOMPRIS_SRC) -f Makefile.mingw


install: all
	mkdir -p $(GCOMPRIS_INSTALL_DIR)/share
	$(MAKE) -C $(GCOMPRIS_BOARDS) -f Makefile.mingw install
	$(MAKE) -C $(GCOMPRIS_SRC) -f Makefile.mingw install
Bruno Coudoin's avatar
Bruno Coudoin committed
88 89 90 91 92 93 94 95 96
	cp -r $(GCOMPRIS_BOARDS)/python $(GCOMPRIS_INSTALL_DIR)/share/gcompris
	rm -f $(GCOMPRIS_INSTALL_DIR)/share/gcompris/python/Makefile*
	rm -f $(GCOMPRIS_INSTALL_DIR)/share/gcompris/python/gcompris/Makefile*
	rm -f $(GCOMPRIS_INSTALL_DIR)/share/gcompris/python/admin/Makefile*
	cp -r $(GCOMPRIS_BOARDS)/python $(GCOMPRIS_INSTALL_DIR)/share/gcompris
	rm -f $(GCOMPRIS_INSTALL_DIR)/share/gcompris/python/Makefile*
	rm -f $(GCOMPRIS_INSTALL_DIR)/share/gcompris/python/gcompris/Makefile*
	rm -f $(GCOMPRIS_INSTALL_DIR)/share/gcompris/python/admin/Makefile*

97 98 99 100 101 102 103 104 105 106 107 108 109 110

# Copy mandratory files for the package in the package directory
prepack:
	mkdir -p $(GCOMPRIS_INSTALL_DIR)/GTK
	cp $(NEEDED_DLLS) $(GCOMPRIS_INSTALL_DIR)
	cp $(NEEDED_FILES) $(GCOMPRIS_INSTALL_DIR)
	cp -r $(GTK_TOP)/etc $(GCOMPRIS_INSTALL_DIR)
	mkdir -p $(GCOMPRIS_INSTALL_DIR)/GTK/share
	cp -r $(GTK_TOP)/share/themes $(GCOMPRIS_INSTALL_DIR)/share
	mkdir -p $(GCOMPRIS_INSTALL_DIR)/lib
	cp -r $(GTK_TOP)/lib/locale $(GCOMPRIS_INSTALL_DIR)/lib
	cp -r $(GTK_TOP)/lib/gtk-2.0 $(GCOMPRIS_INSTALL_DIR)/lib
	cp -r $(GTK_TOP)/lib/pango $(GCOMPRIS_INSTALL_DIR)/lib

Bruno Coudoin's avatar
Bruno Coudoin committed
111
python:
112 113
	cp $(PYTHON_TOP)/DLLs/tcl84.dll $(GCOMPRIS_INSTALL_DIR)
	cp $(PYTHON_TOP)/DLLs/tk84.dll $(GCOMPRIS_INSTALL_DIR)
Bruno Coudoin's avatar
Bruno Coudoin committed
114 115
	cp tools/py2exe/gcompris.py $(GCOMPRIS_INSTALL_DIR)
	cp tools/py2exe/setup.py $(GCOMPRIS_INSTALL_DIR)
116 117 118
	cd $(GCOMPRIS_INSTALL_DIR);$(PYTHON_TOP)/python.exe setup.py py2exe;cp dist/library.zip python24.zip;cp dist/*.pyd .;rm -rf dist build;rm -f gcompris.py*;cd ..
	rm -f $(GCOMPRIS_INSTALL_DIR)/tcl84.dll
	rm -f $(GCOMPRIS_INSTALL_DIR)/tk84.dll
119 120 121 122 123 124 125 126 127 128 129 130 131 132

installer:
	$(MAKENSIS) gcompris-installer.nsi

clean:
	$(MAKE) -C $(GCOMPRIS_SRC) -f Makefile.mingw clean
	$(MAKE) -C $(GCOMPRIS_BOARDS) -f Makefile.mingw clean
	rm -rf config.h
	rm -rf gcompris*.exe

#
# Run this on Linux to prepare datadir for windows
#
prep:
Bruno Coudoin's avatar
Bruno Coudoin committed
133
	mkdir $(GCOMPRIS_INSTALL_DIR)
134
	mkdir -p $(GCOMPRIS_INSTALL_DIR)/share/$(pkgdatadir)/boards
135
	cd boards ; tar cf -  --exclude "Makefile.in" --exclude "*.in" --exclude "*~" --exclude "Makefile" --exclude "Makefile.am" --exclude CVS --exclude .xvpics * | ( cd ../$(GCOMPRIS_INSTALL_DIR)/share/$(pkgdatadir)/boards ; tar xf -) ; cd .. ;
136 137 138 139 140 141 142 143 144 145
	@echo "-------------------------------------------------------------------------------"
	@echo " WARNING: MAKE SURE TO HAVE RUN A MAKE INSTALL OF GCOMPRIS IN /USR/LOCAL FIRST"
	@echo "-------------------------------------------------------------------------------"
	mkdir -p $(GCOMPRIS_INSTALL_DIR)/share/locale
	cp -r /usr/local/share/locale/* $(GCOMPRIS_INSTALL_DIR)/share/locale/
	@echo "Remove other .mo file not from gcompris"
	find ./win32-install-dir/share/locale/ -name \*.mo | grep -v gcompris.mo | xargs rm -f
	@echo "Copy pixmap"
	mkdir $(GCOMPRIS_INSTALL_DIR)/share/pixmaps
	cp gcompris.png $(GCOMPRIS_INSTALL_DIR)/share/pixmaps
Bruno Coudoin's avatar
Bruno Coudoin committed
146
	@echo remove tuxpaint activity
147
	rm -f $(GCOMPRIS_INSTALL_DIR)/share/$(pkgdatadir)/boards/tuxpaint.xml
148
	@echo "Create the file gcompris-win-prepack.tar.gz"
Bruno Coudoin's avatar
Bruno Coudoin committed
149
	tar -czf gcompris-win-prepack.tar.gz win32-install-dir nsis tools