2 # Makefile for Freeciv Windows installer creation
4 # See doc/README.msys2 for building instructions.
11 WINARCH
=$(shell .
/win_arch.sh
)
13 ifeq ($(WINARCH
),win64
)
15 LIBGCCDLL
=libgcc_s_seh-1.dll
16 GCCDLL
=gcc_s-seh-1.dll
19 LIBGCCDLL
=libgcc_s_dw2-1.dll
23 ifeq ($(MIN_WIN_VER
),)
29 # msys2 has dlls in...
30 DLLPATH_PREFIX
=/$(ARCHDIR
)/bin
/
36 # by default build all installers that are buildable with current msys2 environment
37 # gtk2-installer is not built.
38 all: gtk3-installer sdl2-installer ruledit-installer qt-installer gtk3.22
-installer
40 # These are what can be built in current official environment version
41 buildable-win32
: gtk3-installer sdl2-installer ruledit-installer qt-installer gtk3.22
-installer
43 buildable-win64
: gtk3-installer sdl2-installer ruledit-installer qt-installer gtk3.22
-installer
45 # See comments on 'snapshot' target why this wrapping is needed
46 buildable
: buildable-
$(WINARCH
)
49 make GUI
=gtk3 FCMP
=gtk3 EXTRA_CONFIG
="--disable-ruledit $(EXTRA_CONFIG)" wrap-gtk3
52 make GUI
=gtk3.22 FCMP
=gtk3 EXTRA_CONFIG
="--disable-ruledit $(EXTRA_CONFIG)" wrap-gtk3
55 make GUI
=gtk2 FCMP
=gtk2 EXTRA_CONFIG
="--disable-ruledit $(EXTRA_CONFIG)" wrap-gtk2
58 make GUI
=sdl2 FCMP
=gtk3 EXTRA_CONFIG
="--disable-ruledit $(EXTRA_CONFIG)" wrap-sdl2
61 make GUI
=qt FCMP
=qt EXTRA_CONFIG
="--with-qt5-includes=/$(ARCHDIR)/include --with-qt5-libs=/$(ARCHDIR)/lib $(EXTRA_CONFIG)" wrap-qt
66 # Autogen.sh here will make ./win_arch.sh to work.
67 # The $(WINACRH) value we got for this run is not good. The new run
68 # launched from this target will pick correct value, and can make 'buildable' target
69 # to depend on correct arch version.
71 cd ..
/..
; .
/autogen.sh
--no-configure-run
72 make VERSION_REVTYPE
="svn" EXTRA_CONFIG
="--enable-svnrev" buildable
78 # create build directory
79 mkdir
-p build-
$(WINARCH
)-$(GUI
)
81 cd build-
$(WINARCH
)-$(GUI
); ..
/..
/..
/configure FREECIV_LABEL_FORCE
="<base>-msys2" CPPFLAGS
="-D_WIN32_WINNT=$(MIN_WIN_VER)" --enable-client
=$(GUI
) --with-followtag
="win32-S2_6" --without-readline
--enable-fcdb
=sqlite3
--with-sqlite3-prefix
=/$(ARCHDIR
) --enable-fcmp
=$(FCMP
) $(EXTRA_CONFIG
)
83 make
-C build-
$(WINARCH
)-$(GUI
)
84 make
-C build-
$(WINARCH
)-$(GUI
)/translations
/freeciv update-po
85 make
-C build-
$(WINARCH
)-$(GUI
)/bootstrap langstat_freeciv.txt
87 build-freeciv-ruledit
:
88 # create build directory
89 mkdir
-p build-
$(WINARCH
)-ruledit
91 cd build-
$(WINARCH
)-ruledit
; ..
/..
/..
/configure FREECIV_LABEL_FORCE
="<base>-msys2" CPPFLAGS
="-D_WIN32_WINNT=$(MIN_WIN_VER)" --disable-client
--disable-server
--disable-fcmp
--disable-freeciv-manual
--enable-ruledit
--with-qt5-includes
=/$(ARCHDIR
)/include --with-qt5-libs
=/$(ARCHDIR
)/lib
$(EXTRA_CONFIG
)
93 make
-C build-
$(WINARCH
)-ruledit
94 make
-C build-
$(WINARCH
)-ruledit
/translations
/ruledit update-po
95 make
-C build-
$(WINARCH
)-ruledit
/bootstrap langstat_ruledit.txt
97 build-freeciv-gtk3
: build-freeciv-common
99 build-freeciv-gtk2
: build-freeciv-common
101 build-freeciv-sdl2
: build-freeciv-common
103 build-freeciv-qt
: build-freeciv-common
107 install-freeciv-common
:
109 make
-C build-
$(WINARCH
)-$(GUI
) DESTDIR
=`pwd`/install-
$(WINARCH
)-$(GUI
) install
110 # reorder directory layout
111 mv install-
$(WINARCH
)-$(GUI
)/$(INSTSUB
)/bin
/* install-
$(WINARCH
)-$(GUI
)/
112 mv install-
$(WINARCH
)-$(GUI
)/$(INSTSUB
)/etc install-
$(WINARCH
)-$(GUI
)/
113 mv install-
$(WINARCH
)-$(GUI
)/$(INSTSUB
)/share
/freeciv install-
$(WINARCH
)-$(GUI
)/data
114 mkdir
-p install-
$(WINARCH
)-$(GUI
)/share
115 mv install-
$(WINARCH
)-$(GUI
)/$(INSTSUB
)/share
/locale install-
$(WINARCH
)-$(GUI
)/share
/
116 mv install-
$(WINARCH
)-$(GUI
)/$(INSTSUB
)/share
/doc install-
$(WINARCH
)-$(GUI
)/doc
117 mkdir
-p install-
$(WINARCH
)-$(GUI
)/debuginfo
118 cp build-
$(WINARCH
)-$(GUI
)/gen_headers
/fc_config.h install-
$(WINARCH
)-$(GUI
)/debuginfo
119 mkdir
-p install-
$(WINARCH
)-$(GUI
)/doc
/freeciv
/installer
120 cp licenses
/COPYING.installer install-
$(WINARCH
)-$(GUI
)/doc
/freeciv
/installer
/
121 # delete unneeded files
122 rm -r install-
$(WINARCH
)-$(GUI
)/$(INSTSUB
)
123 # strip 'freeciv-manual' and 'freeciv-mp-<gui>' executables
124 strip install-
$(WINARCH
)-$(GUI
)/freeciv-m
*
125 # add start menu files
126 cp freeciv-server.cmd freeciv-mp-
$(FCMP
).cmd freeciv-
$(GUI
).cmd Freeciv.url install-
$(WINARCH
)-$(GUI
)/
128 install-freeciv-gtk3
: install-freeciv-common
130 install-freeciv-gtk3.22
: install-freeciv-common
132 install-freeciv-gtk2
: install-freeciv-common
134 install-freeciv-sdl2
: install-freeciv-common
136 install-freeciv-qt
: install-freeciv-common
137 # strip 'freeciv-ruledit' executable
138 strip install-
$(WINARCH
)-$(GUI
)/freeciv-ruledit.exe
139 cp freeciv-ruledit.cmd install-
$(WINARCH
)-$(GUI
)/
142 mkdir
-p install-
$(WINARCH
)-ruledit
/share
144 install-ruledit
: install-ruledit-dir
146 make
-C build-
$(WINARCH
)-ruledit DESTDIR
=`pwd`/install-
$(WINARCH
)-ruledit
/ install
147 # reorder directory layout
148 mv install-
$(WINARCH
)-ruledit
/$(INSTSUB
)/bin
/* install-
$(WINARCH
)-ruledit
/
149 mv install-
$(WINARCH
)-ruledit
/$(INSTSUB
)/share
/freeciv install-
$(WINARCH
)-ruledit
/data
150 mv install-
$(WINARCH
)-ruledit
/$(INSTSUB
)/share
/locale install-
$(WINARCH
)-ruledit
/share
/
151 mv install-
$(WINARCH
)-ruledit
/$(INSTSUB
)/share
/doc install-
$(WINARCH
)-ruledit
/doc
152 mkdir
-p install-
$(WINARCH
)-ruledit
/debuginfo
153 cp build-
$(WINARCH
)-ruledit
/gen_headers
/fc_config.h install-
$(WINARCH
)-ruledit
/debuginfo
154 mkdir
-p install-
$(WINARCH
)-ruledit
/doc
/freeciv
/installer
155 cp licenses
/COPYING.installer install-
$(WINARCH
)-ruledit
/doc
/freeciv
/installer
/
156 # delete unneeded files
157 rm -r install-
$(WINARCH
)-ruledit
/$(INSTSUB
)
158 # strip 'freeciv-ruledit' executable
159 strip install-
$(WINARCH
)-ruledit
/freeciv-ruledit.exe
160 # add start menu files
161 cp freeciv-ruledit.cmd Freeciv.url install-
$(WINARCH
)-ruledit
/
163 # install Freeciv environment
167 libSDL2_mixer-2-0-0.dll \
169 libfluidsynth-1.dll \
174 libvorbisfile-3.dll \
198 libcairo-gobject-2.dll \
200 libfontconfig-1.dll \
203 libgdk_pixbuf-2.0
-0.dll \
206 libgmodule-2.0
-0.dll \
207 libgobject-2.0
-0.dll \
208 libgthread-2.0
-0.dll \
213 libpangocairo-1.0
-0.dll \
214 libpangowin32-1.0
-0.dll \
219 libwinpthread-1.dll \
225 cp
-R
$(addprefix $(DLLPATH_PREFIX
), $(COMMON_DLLS
)) install-
$(WINARCH
)-$(GUI
)/
227 DEFAULT_FCMP_DLLS
:= \
234 libpangoft2-1.0
-0.dll \
237 install-env-default-fcmp
: install-env-common
238 cp
-R
$(addprefix $(DLLPATH_PREFIX
), $(DEFAULT_FCMP_DLLS
)) install-
$(WINARCH
)-$(GUI
)/
239 # add additional GTK+3 files
240 mkdir
-p install-
$(WINARCH
)-$(GUI
)/etc
241 cp
-R
/$(ARCHDIR
)/etc
/gtk-3.0 install-
$(WINARCH
)-$(GUI
)/etc
/
242 mkdir
-p install-
$(WINARCH
)-$(GUI
)/share
/icons
243 cp
-R
/$(ARCHDIR
)/share
/icons
/Adwaita install-
$(WINARCH
)-$(GUI
)/share
/icons
/
244 mkdir
-p install-
$(WINARCH
)-$(GUI
)/lib
/gtk-3.0
/
245 cp
-R
/$(ARCHDIR
)/lib
/gtk-3.0
/* install-
$(WINARCH
)-$(GUI
)/lib
/gtk-3.0
/
246 mkdir
-p install-
$(WINARCH
)-$(GUI
)/lib
/gdk-pixbuf-2.0
/
247 cp
-R
/$(ARCHDIR
)/lib
/gdk-pixbuf-2.0
/* install-
$(WINARCH
)-$(GUI
)/lib
/gdk-pixbuf-2.0
/
248 cp
-R
/$(ARCHDIR
)/share
/locale install-
$(WINARCH
)-$(GUI
)/share
/
249 find install-
$(WINARCH
)-$(GUI
)/share
/locale
-type f
-not
-name
"freeciv*.mo" -and
-not
-name gtk30.mo
-delete
251 install-env-gtk3
: install-env-default-fcmp
253 install-env-gtk3.22
: install-env-default-fcmp
256 libgdk-win32-2.0
-0.dll \
257 libgtk-win32-2.0
-0.dll \
260 libpangoft2-1.0
-0.dll \
263 install-env-gtk2
: install-env-common
265 cp
-R
$(addprefix $(DLLPATH_PREFIX
), $(GTK2_DLLS
)) install-
$(WINARCH
)-$(GUI
)/
266 # add additional GTK+2 files
267 mkdir
-p install-
$(WINARCH
)-$(GUI
)/etc
268 cp
-R
/$(ARCHDIR
)/etc
/gtk-2.0 install-
$(WINARCH
)-$(GUI
)/etc
/
269 mkdir
-p install-
$(WINARCH
)-$(GUI
)/lib
/gtk-2.0
/
270 cp
-R
/$(ARCHDIR
)/lib
/gtk-2.0
/2.10.0 install-
$(WINARCH
)-$(GUI
)/lib
/gtk-2.0
/
271 cp
-R
/$(ARCHDIR
)/share
/locale install-
$(WINARCH
)-$(GUI
)/share
/
272 find install-
$(WINARCH
)-$(GUI
)/share
/locale
-type f
-not
-name
"freeciv*.mo" -and
-not
-name gtk20.mo
-delete
275 libSDL2_gfx-1-0-0.dll \
282 install-env-sdl2
: install-env-default-fcmp
284 cp
-R
$(addprefix $(DLLPATH_PREFIX
), $(SDL2_DLLS
)) install-
$(WINARCH
)-$(GUI
)/
299 install-env-qt
: install-env-common
301 cp
-R
$(addprefix $(DLLPATH_PREFIX
), $(QT_DLLS
)) install-
$(WINARCH
)-$(GUI
)/
302 # add additional Qt files
303 cp
-R
/$(ARCHDIR
)/share
/qt5
/plugins install-
$(WINARCH
)-$(GUI
)/
304 cp
-R
/$(ARCHDIR
)/share
/locale install-
$(WINARCH
)-$(GUI
)/share
/
305 find install-
$(WINARCH
)-$(GUI
)/share
/locale
-type f
-not
-name
"freeciv*.mo" -delete
325 libcairo-gobject-2.dll \
327 libfontconfig-1.dll \
331 libgdk_pixbuf-2.0
-0.dll \
337 libpangocairo-1.0
-0.dll \
338 libpangowin32-1.0
-0.dll \
343 libwinpthread-1.dll \
349 cp
-R
$(addprefix $(DLLPATH_PREFIX
), $(RULEDIT_DLLS
)) install-
$(WINARCH
)-ruledit
/
350 cp
-R
$(addprefix $(DLLPATH_PREFIX
), $(QT_DLLS
)) install-
$(WINARCH
)-ruledit
/
351 # add additional Qt files
352 cp
-R
/$(ARCHDIR
)/share
/qt5
/plugins install-
$(WINARCH
)-ruledit
/
353 cp
-R
/usr
/share
/locale install-
$(WINARCH
)-ruledit
/share
/
354 find install-
$(WINARCH
)-ruledit
/share
/locale
-type f
-not
-name
"freeciv-ruledit.mo" -delete
358 installer-common
: clean-install-common install-freeciv-
$(GUI
) install-env-
$(GUI
)
359 # extract Freeciv version
360 $(eval FREECIV_VERSION
:= $(shell ..
/..
/fc_version
))
362 .
/create-freeciv-
$(GUI
)-nsi.sh install-
$(WINARCH
)-$(GUI
) $(FREECIV_VERSION
) $(WINARCH
) > Freeciv-
$(WINARCH
)-$(FREECIV_VERSION
)-$(GUI
).nsi
363 # create installer executable
365 makensis Freeciv-
$(WINARCH
)-$(FREECIV_VERSION
)-$(GUI
).nsi
367 installer-ruledit
: clean-install-ruledit install-ruledit install-env-ruledit
368 # extract Freeciv version
369 $(eval FREECIV_VERSION
:= $(shell ..
/..
/fc_version
))
371 .
/create-freeciv-ruledit-nsi.sh install-
$(WINARCH
)-ruledit
$(FREECIV_VERSION
) $(WINARCH
) > Freeciv-
$(WINARCH
)-$(FREECIV_VERSION
)-ruledit.nsi
372 # create installer executable
374 makensis Freeciv-
$(WINARCH
)-$(FREECIV_VERSION
)-ruledit.nsi
376 wrap-gtk3
: build-freeciv-gtk3 installer-common
378 wrap-gtk2
: build-freeciv-gtk2 installer-common
380 wrap-sdl2
: build-freeciv-sdl2 installer-common
382 wrap-qt
: build-freeciv-qt installer-common
384 wrap-ruledit
: build-freeciv-ruledit installer-ruledit
390 rm -rf build-
*-$(GUI
)
393 rm -rf build-
*-ruledit
395 clean-install-common
:
396 rm -rf install-
*-$(GUI
)
397 .
/cleanup_checkout.sh ..
/..
399 clean-install-ruledit
:
400 rm -rf install-
*-ruledit
401 .
/cleanup_checkout.sh ..
/..
403 clean-installer-common
:
404 rm -f Output
/Freeciv-
*-$(GUI
)-setup.exe
405 rm -f Freeciv-
*-$(GUI
).nsi
407 clean-installer-ruledit
:
408 rm -f Output
/Freeciv-ruledit-
*-setup.exe
409 rm -f Freeciv-
*-ruledit.nsi
412 make GUI
=gtk3 clean-build-common clean-install-common clean-installer-common
413 make GUI
=gtk3.22 clean-build-common clean-install-common clean-installer-common
414 make GUI
=gtk2 clean-build-common clean-install-common clean-installer-common
415 make GUI
=sdl2 clean-build-common clean-install-common clean-installer-common
416 make GUI
=qt clean-build-common clean-install-common clean-installer-common
417 make clean-build-ruledit clean-install-ruledit clean-installer-ruledit