2 # Makefile for Freeciv Windows installer creation
6 # 1. download and extract the MinGW build environment from
7 # https://sourceforge.net/projects/freeciv/files/dependencies/gnuwin32/
8 # Current version is gnuwin32-2016-07-27.
9 # 2. double click on "gnuwin32/msys.bat"
10 # 3. install the development packages:
12 # 4. close current session and restart msys.bat. This is required
13 # for PATH to be set correctly after development packages
15 # 5. change into the Freeciv directory where this Makefile resides
16 # $ cd <path_to_freeciv_source>/win32/installer
19 # 7. find the installer executables in the 'Output' directory
26 ifeq ($(MIN_WIN_VER
),)
35 # by default build all installers
36 all: gtk3-installer sdl2-installer qt-installer ruledit-installer
39 make GUI
=gtk3 FCMP
=gtk3 EXTRA_CONFIG
="--disable-ruledit $(EXTRA_CONFIG)" wrap-gtk3
42 make GUI
=sdl2 FCMP
=gtk3 EXTRA_CONFIG
="--disable-ruledit $(EXTRA_CONFIG)" wrap-sdl2
45 make GUI
=qt FCMP
=qt wrap-qt
51 cd ..
/..
; .
/autogen.sh
--no-configure-run
52 make VERSION_REVTYPE
="svn" EXTRA_CONFIG
="--enable-svnrev" all
58 # create build directory
61 cd build-
$(GUI
); ..
/..
/..
/configure CPPFLAGS
="-D_WIN32_WINNT=$(MIN_WIN_VER)" --enable-client
=$(GUI
) --with-followtag
="windows-S3_1" --enable-fcdb
=sqlite3
--enable-fcmp
=$(FCMP
) $(EXTRA_CONFIG
)
64 make
-C build-
$(GUI
)/translations
/core update-po
65 make
-C build-
$(GUI
)/bootstrap langstat_core.txt
67 build-freeciv-ruledit
:
68 # create build directory
69 mkdir
-p build-ruledit
71 cd build-ruledit
; ..
/..
/..
/configure CPPFLAGS
="-D_WIN32_WINNT=$(MIN_WIN_VER)" --disable-client
--disable-server
--disable-fcmp
--disable-freeciv-manual
--enable-ruledit
$(EXTRA_CONFIG
)
74 make
-C build-ruledit
/translations
/ruledit update-po
75 make
-C build-ruledit
/bootstrap langstat_ruledit.txt
77 build-freeciv-gtk3
: build-freeciv-common
79 build-freeciv-sdl2
: build-freeciv-common
81 build-freeciv-qt
: build-freeciv-common
85 install-freeciv-common
:
87 make
-C build-
$(GUI
) DESTDIR
=`pwd`/install-
$(GUI
) install
88 # reorder directory layout
89 mv install-
$(GUI
)/usr
/local
/bin
/* install-
$(GUI
)/
90 mv install-
$(GUI
)/usr
/local
/etc install-
$(GUI
)/
91 mv install-
$(GUI
)/usr
/local
/share
/freeciv install-
$(GUI
)/data
92 mkdir
-p install-
$(GUI
)/share
93 mv install-
$(GUI
)/usr
/local
/share
/locale install-
$(GUI
)/share
/
94 mv install-
$(GUI
)/usr
/local
/share
/doc install-
$(GUI
)/doc
95 mkdir
-p install-
$(GUI
)/debuginfo
96 cp build-
$(GUI
)/gen_headers
/fc_config.h install-
$(GUI
)/debuginfo
97 mkdir
-p install-
$(GUI
)/doc
/freeciv
/installer
98 cp licenses
/COPYING.installer install-
$(GUI
)/doc
/freeciv
/installer
/
99 # delete unneeded files
100 rm -r install-
$(GUI
)/usr
101 # strip 'freeciv-manual' and 'freeciv-mp-<gui>' executables
102 strip install-
$(GUI
)/freeciv-m
*
103 # add start menu files
104 cp freeciv-server.cmd freeciv-mp-
$(FCMP
).cmd freeciv-
$(GUI
).cmd Freeciv.url install-
$(GUI
)/
106 install-freeciv-gtk3
: install-freeciv-common
108 install-freeciv-sdl2
: install-freeciv-common
110 cp
/opt
/fireflysung-1.3
.0/fireflysung.ttf install-sdl2
/data
/themes
/gui-sdl2
/human
/
111 cp
/opt
/fireflysung-1.3
.0/COPYRIGHT install-sdl2
/data
/themes
/gui-sdl2
/human
/COPYING.fireflysung
112 cp
/opt
/sazanami-20040629
/sazanami-gothic.ttf install-sdl2
/data
/themes
/gui-sdl2
/human
/
113 cp
/opt
/sazanami-20040629
/README install-sdl2
/data
/themes
/gui-sdl2
/human
/COPYING.sazanami
114 cp
/opt
/un-fonts
/UnDotum.ttf install-sdl2
/data
/themes
/gui-sdl2
/human
/
115 cp
/opt
/un-fonts
/COPYING install-sdl2
/data
/themes
/gui-sdl2
/human
/COPYING.UnDotum
117 install-freeciv-qt
: install-freeciv-common
118 # strip 'freeciv-ruledit' executable
119 strip install-
$(GUI
)/freeciv-ruledit.exe
120 cp freeciv-ruledit.cmd install-
$(GUI
)/
123 mkdir
-p install-ruledit
/share
125 install-ruledit
: install-ruledit-dir
127 make
-C build-ruledit DESTDIR
=`pwd`/install-ruledit
install
128 # reorder directory layout
129 mv install-ruledit
/usr
/local
/bin
/* install-ruledit
/
130 mv install-ruledit
/usr
/local
/etc install-ruledit
/
131 mv install-ruledit
/usr
/local
/share
/freeciv install-ruledit
/data
132 mv install-ruledit
/usr
/local
/share
/locale install-ruledit
/share
/
133 mv install-ruledit
/usr
/local
/share
/doc install-ruledit
/doc
134 mkdir
-p install-ruledit
/debuginfo
135 cp build-ruledit
/gen_headers
/fc_config.h install-ruledit
/debuginfo
136 mkdir
-p install-ruledit
/doc
/freeciv
/installer
137 cp licenses
/COPYING.installer install-ruledit
/doc
/freeciv
/installer
/
138 # delete unneeded files
139 rm -r install-ruledit
/usr
140 # strip 'freeciv-ruledit' executable
141 strip install-ruledit
/freeciv-ruledit.exe
142 # add start menu files
143 cp freeciv-ruledit.cmd Freeciv.url install-ruledit
/
145 # install Freeciv environment
151 libMagickCore-6.Q16-1.dll \
152 libMagickWand-6.Q16-1.dll \
157 libcairo-gobject-2.dll \
160 libfontconfig-1.dll \
163 libgdk_pixbuf-2.0
-0.dll \
166 libgmodule-2.0
-0.dll \
167 libgobject-2.0
-0.dll \
168 libgthread-2.0
-0.dll \
175 libpangocairo-1.0
-0.dll \
176 libpangowin32-1.0
-0.dll \
183 libvorbisfile-3.dll \
193 cp
-R
$(addprefix /bin
/, $(COMMON_DLLS
)) install-
$(GUI
)
195 DEFAULT_FCMP_DLLS
:= \
199 install-env-default-fcmp
: install-env-common
200 cp
-R
$(addprefix /bin
/, $(DEFAULT_FCMP_DLLS
)) install-
$(GUI
)
201 # add additional GTK+3 files
202 mkdir
-p install-
$(GUI
)/etc
203 cp
-R
/etc
/gtk-3.0 install-
$(GUI
)/etc
/
204 mkdir
-p install-
$(GUI
)/lib
/gtk-3.0
/
205 cp
-R
/lib
/gtk-3.0
/3.0.0 install-
$(GUI
)/lib
/gtk-3.0
/
206 cp
-R
/share
/locale install-
$(GUI
)/share
/
207 find install-
$(GUI
)/share
/locale
-type f
-not
-name
"freeciv*.mo" -and
-not
-name gtk30.mo
-delete
209 install-env-gtk3
: install-env-default-fcmp
213 libSDL2_gfx-1-0-0.dll \
217 install-env-sdl2
: install-env-default-fcmp
219 cp
-R
$(addprefix /bin
/, $(SDL2_DLLS
)) install-
$(GUI
)
227 install-env-qt
: install-env-common
229 cp
-R
$(addprefix /bin
/, $(QT_DLLS
)) install-
$(GUI
)
230 # add additional Qt files
231 cp
-R
/plugins install-
$(GUI
)/
232 cp
-R
/share
/locale install-
$(GUI
)/share
/
233 find install-
$(GUI
)/share
/locale
-type f
-not
-name
"freeciv*.mo" -delete
237 cp
-R
$(addprefix /bin
/, $(COMMON_DLLS
)) install-ruledit
238 cp
-R
$(addprefix /bin
/, $(QT_DLLS
)) install-ruledit
239 # add additional Qt files
240 cp
-R
/plugins install-ruledit
/
241 cp
-R
/share
/locale install-ruledit
/share
/
242 find install-ruledit
/share
/locale
-type f
-not
-name
"freeciv-ruledit.mo" -delete
246 installer-common
: clean-install-common install-freeciv-
$(GUI
) install-env-
$(GUI
)
247 # extract Freeciv version
248 $(eval FREECIV_VERSION
:= $(shell ..
/..
/fc_version
))
250 .
/create-freeciv-
$(GUI
)-nsi.sh install-
$(GUI
) $(FREECIV_VERSION
) > Freeciv-
$(FREECIV_VERSION
)-$(GUI
).nsi
251 # create installer executable
253 makensis Freeciv-
$(FREECIV_VERSION
)-$(GUI
).nsi
255 installer-ruledit
: clean-install-ruledit install-ruledit install-env-ruledit
256 # extract Freeciv version
257 $(eval FREECIV_VERSION
:= $(shell ..
/..
/fc_version
))
259 .
/create-freeciv-ruledit-nsi.sh install-ruledit
$(FREECIV_VERSION
) > Freeciv-
$(FREECIV_VERSION
)-ruledit.nsi
260 # create installer executable
262 makensis Freeciv-
$(FREECIV_VERSION
)-ruledit.nsi
264 wrap-gtk3
: build-freeciv-gtk3 installer-common
266 wrap-sdl2
: build-freeciv-sdl2 installer-common
268 wrap-qt
: build-freeciv-qt installer-common
270 wrap-ruledit
: build-freeciv-ruledit installer-ruledit
281 clean-install-common
:
282 rm -rf install-
$(GUI
)
283 .
/cleanup_checkout.sh ..
/..
285 clean-install-ruledit
:
286 rm -rf install-ruledit
287 .
/cleanup_checkout.sh ..
/..
289 clean-installer-common
:
290 rm -f Output
/Freeciv-
*-$(GUI
)-setup.exe
291 rm -f Freeciv-
*-$(GUI
).nsi
293 clean-installer-ruledit
:
294 rm -f Output
/Freeciv-ruledit-
*-setup.exe
295 rm -f Freeciv-
*-ruledit.nsi
298 make GUI
=gtk3 clean-build-common clean-install-common clean-installer-common
299 make GUI
=sdl2 clean-build-common clean-install-common clean-installer-common
300 make GUI
=qt clean-build-common clean-install-common clean-installer-common
301 make clean-build-ruledit clean-install-ruledit clean-installer-ruledit