Makefile.mingw.in 7.05 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
activity_dir = \
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
	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 \
	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 \
	readingh-activity \
	reversecount-activity \
	scalesboard-activity \
	smallnumbers-activity \
	submarine-activity \
	superbrain-activity \
	tangram-activity \
	target-activity \
	traffic-activity \
	wordprocessor-activity \
	wordsgame-activity

57
include global_win32.mak
58 59

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

NEEDED_FILES =		README \
99
	     		README.mingw \
100
	     		README.translators \
101
			COPYING \
102
			ChangeLog
103 104 105 106

##
##

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

113
Makefile.mingw: Makefile.mingw.in config.h
114 115 116 117 118 119 120 121 122 123 124 125
	./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
126

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

135 136

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

153
python: Makefile.mingw
154 155
	cp $(PYTHON_TOP)/DLLs/tcl85.dll $(GCOMPRIS_INSTALL_DIR)
	cp $(PYTHON_TOP)/DLLs/tk85.dll $(GCOMPRIS_INSTALL_DIR)
156
	cp $(PYTHON_TOP)/python26.dll $(GCOMPRIS_INSTALL_DIR)
157 158
	cp tools/py2exe/gcompris.py $(GCOMPRIS_INSTALL_DIR)
	cp tools/py2exe/setup.py $(GCOMPRIS_INSTALL_DIR)
159 160 161
	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
162

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

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

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