Makefile.mingw.in 7.03 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12
# 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
13
CANVAS_SRC = ./src/goocanvas/src
14 15
GCOMPRIS_INSTALL_DIR = ./win32-install-dir

16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
activity_dir = advanced_colors-activity \
	algebra_by-activity \
	algebra_guesscount-activity \
	awele-activity \
	babymatch-activity \
	billard-activity \
	canal_lock-activity \
	chess_computer-activity \
	clickgame-activity \
	click_on_letter-activity \
	clockgame-activity \
	colors-activity \
	crane-activity \
	enumerate-activity \
	erase-activity \
	fifteen-activity \
	gletters-activity \
	hanoi-activity \
	hanoi_real-activity \
	imageid-activity \
	leftright-activity \
	magic_hat_minus-activity \
	maze-activity \
	memory-activity \
	missing_letter-activity \
	money-activity \
	paratrooper-activity \
	photohunter-activity \
	planegame-activity \
	railroad-activity \
	read_colors-activity \
	readingh-activity \
	reversecount-activity \
	scalesboard-activity \
	smallnumbers-activity \
	submarine-activity \
	superbrain-activity \
	tangram-activity \
	target-activity \
	traffic-activity \
	wordprocessor-activity \
	wordsgame-activity

59
include global_win32.mak
60 61

# These will be copied in the win32-install-dir ready to be packaged.
62
NEEDED_DLLS =		$(GNUCHESS_TOP)/bin/pthreadGC2.dll \
63
			$(GNUCHESS_TOP)/bin/libreadline.dll \
64 65 66
			$(GNUCHESS_TOP)/bin/gnuchess.exe \
			$(FONTCONFIG_TOP)/bin/libfontconfig-1.dll \
			$(FREETYPE_TOP)/bin/freetype6.dll \
67
			$(GNUCAP_TOP)/src/MSW/gnucap.exe \
68 69
			$(GTK_TOP)/bin/gspawn-win32-helper.exe \
			$(GTK_TOP)/bin/intl.dll \
70
			$(GTK_TOP)/bin/libjpeg-7.dll \
71
			$(GTK_TOP)/bin/libatk-1.0-0.dll \
72
			$(GTK_TOP)/bin/libcairo-2.dll \
73
			$(GTK_TOP)/bin/libexpat-1.dll \
74 75 76 77 78
			$(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 \
79 80
			$(GTK_TOP)/bin/libgthread-2.0-0.dll \
			$(GTK_TOP)/bin/libgtk-win32-2.0-0.dll \
81
			$(GTK_TOP)/bin/libpango-1.0-0.dll \
82
			$(GTK_TOP)/bin/libpangocairo-1.0-0.dll \
83
			$(GTK_TOP)/bin/libpangoft2-1.0-0.dll \
84 85 86
			$(GTK_TOP)/bin/libpangowin32-1.0-0.dll \
			$(GTK_TOP)/bin/libgio-2.0-0.dll \
			$(GTK_TOP)/bin/libpng12-0.dll \
87
			$(GTK_TOP)/bin/zlib1.dll \
88 89
			$(ICONV_TOP)/bin/iconv.dll \
			$(LIBXML2_TOP)/bin/libxml2.dll \
90
			$(MSVCR90_DLL) \
91 92 93 94 95
			$(SDL_TOP)/bin/SDL.dll \
			$(SDL_TOP)/bin/SDL_mixer.dll \
			$(SDL_TOP)/bin/libogg-0.dll \
			$(SDL_TOP)/bin/libvorbis-0.dll \
			$(SDL_TOP)/bin/libvorbisfile-3.dll \
96
			$(SQLITE_TOP)/sqlite3.dll \
97 98 99
			$(RSVG_TOP)/bin/librsvg-2-2.dll \
			$(CROCO_TOP)/bin/libcroco-0.6-3.dll \
			$(GSF_TOP)/bin/libgsf-1-114.dll
100 101

NEEDED_FILES =		README \
102
	     		README.mingw \
103
	     		README.translators \
104
			COPYING \
105
			ChangeLog
106 107 108 109

##
##

110
all: Makefile.mingw config.h
111
	$(MAKE) -C $(CANVAS_SRC) -f Makefile.mingw
112
	$(MAKE) -C $(GCOMPRIS_BOARDS) -f Makefile.mingw
113
	for actdir in $(activity_dir); do $(MAKE) -C src/$$actdir -f Makefile.mingw; done
114 115
	$(MAKE) -C $(GCOMPRIS_SRC) -f Makefile.mingw

116 117 118 119 120 121 122 123 124 125 126 127 128
Makefile.mingw: Makefile.mingw.in
	./config.status Makefile.mingw

config.h: config.h.mingw.in
	./config.status config.h.mingw
	cp config.h.mingw config.h

gcompris-installer.nsi: gcompris-installer.nsi.in nsis_translations.desktop
	./config.status gcompris-installer.nsi
	./tools/create_nsis_translations.pl nsis_translations.desktop gcompris-installer.nsi nsis/translations

nsis_translations.desktop: nsis_translations.desktop.in
	LC_ALL=C /usr/bin/intltool-merge -d -u -c ./po/.intltool-merge-cache ./po nsis_translations.desktop.in nsis_translations.desktop
129

130
install: all Makefile.mingw
131 132
	mkdir -p $(GCOMPRIS_INSTALL_DIR)/share
	$(MAKE) -C $(GCOMPRIS_SRC) -f Makefile.mingw install
133 134 135 136 137
	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*

138 139

# Copy mandratory files for the package in the package directory
140
prepack: Makefile.mingw
141
	mkdir -p $(GCOMPRIS_INSTALL_DIR)
142
	cp $(NEEDED_DLLS) $(GCOMPRIS_INSTALL_DIR)
143
	cp -r $(LOCAL_PREFIX)/Microsoft.VC90.CRT $(GCOMPRIS_INSTALL_DIR)
144 145
	cp $(NEEDED_FILES) $(GCOMPRIS_INSTALL_DIR)
	cp -r $(GTK_TOP)/etc $(GCOMPRIS_INSTALL_DIR)
146 147
	cp -r $(GTK_TOP)/manifest $(GCOMPRIS_INSTALL_DIR)
	mkdir -p $(GCOMPRIS_INSTALL_DIR)/share
148 149
	cp -r $(GTK_TOP)/share/themes $(GCOMPRIS_INSTALL_DIR)/share
	mkdir -p $(GCOMPRIS_INSTALL_DIR)/lib
150
	cp -r $(GTK_TOP)/share/locale $(GCOMPRIS_INSTALL_DIR)/lib
151
	cp -r $(GTK_TOP)/lib/gtk-2.0 $(GCOMPRIS_INSTALL_DIR)/lib
152
	cp $(LOCAL_PREFIX)/libxml2-2.7.6.win32/bin/libxml2.dll $(GCOMPRIS_INSTALL_DIR)/libxml2-2.dll
153

154
python: Makefile.mingw
155 156
	cp $(PYTHON_TOP)/DLLs/tcl85.dll $(GCOMPRIS_INSTALL_DIR)
	cp $(PYTHON_TOP)/DLLs/tk85.dll $(GCOMPRIS_INSTALL_DIR)
157
	cp $(PYTHON_TOP)/python26.dll $(GCOMPRIS_INSTALL_DIR)
158 159
	cp tools/py2exe/gcompris.py $(GCOMPRIS_INSTALL_DIR)
	cp tools/py2exe/setup.py $(GCOMPRIS_INSTALL_DIR)
160 161 162
	cd $(GCOMPRIS_INSTALL_DIR);$(PYTHON_TOP)/python.exe setup.py py2exe;cp dist/library.zip python26.zip;cp dist/*.pyd .;rm -rf dist build;rm -f gcompris.py*;cd ..
	rm -f $(GCOMPRIS_INSTALL_DIR)/tcl85.dll
	rm -f $(GCOMPRIS_INSTALL_DIR)/tk85.dll
163

164
installer: Makefile.mingw gcompris-installer.nsi
165 166
	$(MAKENSIS) gcompris-installer.nsi

167
clean: Makefile.mingw
168
	$(MAKE) -C $(CANVAS_SRC) -f Makefile.mingw clean
169 170
	$(MAKE) -C $(GCOMPRIS_SRC) -f Makefile.mingw clean
	$(MAKE) -C $(GCOMPRIS_BOARDS) -f Makefile.mingw clean
171
	for actdir in $(activity_dir); do $(MAKE) -C src/$$actdir -f Makefile.mingw clean; done
172 173
	rm -rf config.h
	rm -rf gcompris*.exe
174 175
	rm -f gcompris-installer.nsi
	rm -f nsis_translations.desktop
176 177 178 179

#
# Run this on Linux to prepare datadir for windows
#
180 181
prep: Makefile.mingw
	mkdir -p $(GCOMPRIS_INSTALL_DIR)
182 183 184 185 186 187 188 189
	mkdir -p $(GCOMPRIS_INSTALL_DIR)/share/$(pkgdatadir)/boards
	@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
190 191 192
	@echo "Copying activity data from /usr/local/share/gcompris"
	mkdir -p $(GCOMPRIS_INSTALL_DIR)/share/gcompris
	cp -r /usr/local/share/gcompris/* $(GCOMPRIS_INSTALL_DIR)/share/gcompris
193
	@echo "Copy pixmap"
194
	mkdir -p $(GCOMPRIS_INSTALL_DIR)/share/pixmaps
195
	cp gcompris.png $(GCOMPRIS_INSTALL_DIR)/share/pixmaps
196
	@echo remove tuxpaint activity
197
	rm -f $(GCOMPRIS_INSTALL_DIR)/share/$(pkgdatadir)/boards/tuxpaint.xml
198 199 200 201
	rm -f $(GCOMPRIS_INSTALL_DIR)/share/gcompris/python/tuxpaint.py
	find $(GCOMPRIS_INSTALL_DIR) -name "Makefile*" -exec rm -f {} \;
	find $(GCOMPRIS_INSTALL_DIR) -name "*.in" -exec rm -f {} \;
	find $(GCOMPRIS_INSTALL_DIR) -name "*~" -exec rm -f {} \;
202