1 # speedo.mk - Speedo rebuilds speedily.
2 # Copyright (C) 2008, 2014 g10 Code GmbH
4 # speedo is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 3 of the License, or
7 # (at your option) any later version.
9 # speedo is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, see <http://www.gnu.org/licenses/>.
17 # speedo builds gnupg-related packages from GIT and installs them in a
18 # user directory, thereby providing a non-obstrusive test environment.
19 # speedo does only work with GNU make. The build system is similar to
20 # that of gpg4win. The following commands are supported:
22 # make -f speedo.mk all pkg2rep=/dir/with/tarballs
26 # Builds all packages and installs them under PLAY/inst. At the end,
27 # speedo prints commands that can be executed in the local shell to
28 # make use of the installed packages.
30 # make -f speedo.mk clean
32 # make -f speedo.mk clean-PACKAGE
34 # Removes all packages or the package PACKAGE from the installation
35 # and build tree. A subsequent make will rebuild these (and only
38 # make -f speedo.mk report
40 # make -f speedo.mk report-PACKAGE
42 # Lists packages and versions.
45 # We need to know our own name.
46 SPEEDO_MK := $(realpath $(lastword $(MAKEFILE_LIST)))
48 .PHONY : help native native-gui w32-installer w32-source
49 .PHONY : git-native git-native-gui git-w32-installer git-w32-source
50 .PHONY : this-native this-native-gui this-w32-installer this-w32-source
53 @echo 'usage: make -f speedo.mk TARGET'
54 @echo ' with TARGET being one of:'
55 @echo ' help This help'
56 @echo ' native Native build of the GnuPG core'
57 @echo ' native-gui Ditto but with pinentry and GPA'
58 @echo ' w32-installer Build a Windows installer'
59 @echo ' w32-source Pack a source archive'
60 @echo ' w32-release Build a Windows release'
61 @echo ' w32-sign-installer Sign the installer'
63 @echo 'You may append INSTALL_PREFIX=<dir> for native builds.'
64 @echo 'Prepend TARGET with "git-" to build from GIT repos.'
65 @echo 'Prepend TARGET with "this-" to build from the source tarball.'
66 @echo 'Use SELFCHECK=0 for a non-released version.'
67 @echo 'Use CUSTOM_SWDB=1 for an already downloaded swdb.lst.'
69 SPEEDOMAKE := $(MAKE) -f $(SPEEDO_MK) UPD_SWDB=1
72 $(SPEEDOMAKE) TARGETOS=native WHAT=release WITH_GUI=0 all
74 git-native: check-tools
75 $(SPEEDOMAKE) TARGETOS=native WHAT=git WITH_GUI=0 all
77 this-native: check-tools
78 $(SPEEDOMAKE) TARGETOS=native WHAT=this WITH_GUI=0 all
80 native-gui: check-tools
81 $(SPEEDOMAKE) TARGETOS=native WHAT=release WITH_GUI=1 all
83 git-native-gui: check-tools
84 $(SPEEDOMAKE) TARGETOS=native WHAT=git WITH_GUI=1 all
86 this-native-gui: check-tools
87 $(SPEEDOMAKE) TARGETOS=native WHAT=this WITH_GUI=1 all
89 w32-installer: check-tools
90 $(SPEEDOMAKE) TARGETOS=w32 WHAT=release WITH_GUI=0 installer
92 git-w32-installer: check-tools
93 $(SPEEDOMAKE) TARGETOS=w32 WHAT=git WITH_GUI=0 installer
95 this-w32-installer: check-tools
96 $(SPEEDOMAKE) TARGETOS=w32 WHAT=this WITH_GUI=0 \
97 CUSTOM_SWDB=1 installer
99 w32-source: check-tools
100 $(SPEEDOMAKE) TARGETOS=w32 WHAT=release WITH_GUI=0 dist-source
102 git-w32-source: check-tools
103 $(SPEEDOMAKE) TARGETOS=w32 WHAT=git WITH_GUI=0 dist-source
105 this-w32-source: check-tools
106 $(SPEEDOMAKE) TARGETOS=w32 WHAT=this WITH_GUI=0 \
107 CUSTOM_SWDB=1 dist-source
109 w32-release: check-tools
110 $(SPEEDOMAKE) TARGETOS=w32 WHAT=release WITH_GUI=0 SELFCHECK=0 \
111 installer-from-source
113 w32-sign-installer: check-tools
114 $(SPEEDOMAKE) TARGETOS=w32 WHAT=release WITH_GUI=0 SELFCHECK=0 \
117 w32-release-offline: check-tools
118 $(SPEEDOMAKE) TARGETOS=w32 WHAT=release WITH_GUI=0 SELFCHECK=0 \
119 CUSTOM_SWDB=1 pkgrep=${HOME}/b pkg10rep=${HOME}/b \
120 installer-from-source
123 # Set this to "git" to build from git,
124 # to "release" from tarballs,
125 # to "this" from the unpacked sources.
128 # Set target to "native" or "w32"
131 # Set to 1 to build the GUI tools
134 # Set to 1 to use a pre-installed swdb.lst instead of the online version.
137 # Set to 1 to really download the swdb.
140 # Set to 0 to skip the GnuPG version self-check
143 # Set to the location of the directory with tarballs of
145 TARBALLS=$(shell pwd)/../tarballs
147 # Number of parallel make jobs
150 # Name to use for the w32 installer and sources
153 # Use this to override the installaion directory for native builds.
156 # The Authenticode key used to sign the Windows installer
157 AUTHENTICODE_KEY=${HOME}/.gnupg/g10code-authenticode-key.p12
161 # They must be absolute, as we switch directories pretty often.
162 root := $(shell pwd)/PLAY
164 bdir := $(root)/build
165 bdir6:= $(root)/build-w64
166 ifeq ($(INSTALL_PREFIX),none)
169 idir := $(abspath $(INSTALL_PREFIX))
171 idir6:= $(root)/inst-w64
172 stampdir := $(root)/stamps
173 topsrc := $(shell cd $(dir $(SPEEDO_MK)).. && pwd)
174 auxsrc := $(topsrc)/build-aux/speedo
175 patdir := $(topsrc)/build-aux/speedo/patches
176 w32src := $(topsrc)/build-aux/speedo/w32
178 # =====BEGIN LIST OF PACKAGES=====
179 # The packages that should be built. The order is also the build order.
180 # Fixme: Do we need to build pkg-config for cross-building?
183 libgpg-error npth libgcrypt
185 ifeq ($(TARGETOS),w32)
187 zlib bzip2 adns sqlite
189 speedo_spkgs += gettext libiconv
194 libassuan libksba gnupg
196 ifeq ($(TARGETOS),w32)
199 libffi glib pkg-config
206 ifeq ($(TARGETOS),w32)
210 gdk-pixbuf atk pixman cairo pango gtk+
214 ifeq ($(TARGETOS),w32)
216 speedo_spkgs += pinentry
218 speedo_spkgs += gpa gpgex
224 speedo_spkgs += pinentry gpa
230 # =====END LIST OF PACKAGES=====
233 # Packages which are additionally build for 64 bit Windows. They are
234 # only used for gpgex and thus we need to build them only if we want
238 speedo_w64_spkgs += libgpg-error libiconv gettext libassuan gpgex
241 # Packages which use the gnupg autogen.sh build style
242 speedo_gnupg_style = \
243 libgpg-error npth libgcrypt \
244 libassuan libksba gnupg gpgme \
247 # Packages which use only make and no build directory
248 speedo_make_only_style = \
251 # Get the content of the software DB.
252 ifeq ($(CUSTOM_SWDB),1)
253 getswdb_options = --skip-download --skip-verify
257 ifeq ($(SELFCHECK),0)
258 getswdb_options += --skip-selfcheck
261 SWDB := $(shell $(topsrc)/build-aux/getswdb.sh $(getswdb_options) && echo okay)
262 ifeq ($(strip $(SWDB)),)
264 $(error Error getting GnuPG software version database)
268 # Version numbers of the released packages
269 gnupg_ver_this = $(shell cat $(topsrc)/VERSION)
271 gnupg_ver := $(shell awk '$$1=="gnupg21_ver" {print $$2}' swdb.lst)
273 libgpg_error_ver := $(shell awk '$$1=="libgpg_error_ver" {print $$2}' swdb.lst)
274 libgpg_error_sha1:= $(shell awk '$$1=="libgpg_error_sha1" {print $$2}' swdb.lst)
275 libgpg_error_sha2:= $(shell awk '$$1=="libgpg_error_sha2" {print $$2}' swdb.lst)
277 npth_ver := $(shell awk '$$1=="npth_ver" {print $$2}' swdb.lst)
278 npth_sha1 := $(shell awk '$$1=="npth_sha1" {print $$2}' swdb.lst)
279 npth_sha2 := $(shell awk '$$1=="npth_sha2" {print $$2}' swdb.lst)
281 libgcrypt_ver := $(shell awk '$$1=="libgcrypt_ver" {print $$2}' swdb.lst)
282 libgcrypt_sha1 := $(shell awk '$$1=="libgcrypt_sha1" {print $$2}' swdb.lst)
283 libgcrypt_sha2 := $(shell awk '$$1=="libgcrypt_sha2" {print $$2}' swdb.lst)
285 libassuan_ver := $(shell awk '$$1=="libassuan_ver" {print $$2}' swdb.lst)
286 libassuan_sha1 := $(shell awk '$$1=="libassuan_sha1" {print $$2}' swdb.lst)
287 libassuan_sha2 := $(shell awk '$$1=="libassuan_sha2" {print $$2}' swdb.lst)
289 libksba_ver := $(shell awk '$$1=="libksba_ver" {print $$2}' swdb.lst)
290 libksba_sha1 := $(shell awk '$$1=="libksba_sha1" {print $$2}' swdb.lst)
291 libksba_sha2 := $(shell awk '$$1=="libksba_sha2" {print $$2}' swdb.lst)
293 gpgme_ver := $(shell awk '$$1=="gpgme_ver" {print $$2}' swdb.lst)
294 gpgme_sha1 := $(shell awk '$$1=="gpgme_sha1" {print $$2}' swdb.lst)
295 gpgme_sha2 := $(shell awk '$$1=="gpgme_sha2" {print $$2}' swdb.lst)
297 pinentry_ver := $(shell awk '$$1=="pinentry_ver" {print $$2}' swdb.lst)
298 pinentry_sha1 := $(shell awk '$$1=="pinentry_sha1" {print $$2}' swdb.lst)
299 pinentry_sha2 := $(shell awk '$$1=="pinentry_sha2" {print $$2}' swdb.lst)
301 gpa_ver := $(shell awk '$$1=="gpa_ver" {print $$2}' swdb.lst)
302 gpa_sha1 := $(shell awk '$$1=="gpa_sha1" {print $$2}' swdb.lst)
303 gpa_sha2 := $(shell awk '$$1=="gpa_sha2" {print $$2}' swdb.lst)
305 gpgex_ver := $(shell awk '$$1=="gpgex_ver" {print $$2}' swdb.lst)
306 gpgex_sha1 := $(shell awk '$$1=="gpgex_sha1" {print $$2}' swdb.lst)
307 gpgex_sha2 := $(shell awk '$$1=="gpgex_sha2" {print $$2}' swdb.lst)
309 zlib_ver := $(shell awk '$$1=="zlib_ver" {print $$2}' swdb.lst)
310 zlib_sha1 := $(shell awk '$$1=="zlib_sha1_gz" {print $$2}' swdb.lst)
311 zlib_sha2 := $(shell awk '$$1=="zlib_sha2_gz" {print $$2}' swdb.lst)
313 bzip2_ver := $(shell awk '$$1=="bzip2_ver" {print $$2}' swdb.lst)
314 bzip2_sha1 := $(shell awk '$$1=="bzip2_sha1_gz" {print $$2}' swdb.lst)
315 bzip2_sha2 := $(shell awk '$$1=="bzip2_sha2_gz" {print $$2}' swdb.lst)
317 adns_ver := $(shell awk '$$1=="adns_ver" {print $$2}' swdb.lst)
318 adns_sha1 := $(shell awk '$$1=="adns_sha1" {print $$2}' swdb.lst)
319 adns_sha2 := $(shell awk '$$1=="adns_sha2" {print $$2}' swdb.lst)
321 sqlite_ver := $(shell awk '$$1=="sqlite_ver" {print $$2}' swdb.lst)
322 sqlite_sha1 := $(shell awk '$$1=="sqlite_sha1_gz" {print $$2}' swdb.lst)
323 sqlite_sha2 := $(shell awk '$$1=="sqlite_sha2_gz" {print $$2}' swdb.lst)
326 $(info Information from the version database)
327 $(info GnuPG ..........: $(gnupg_ver) (building $(gnupg_ver_this)))
328 $(info Libgpg-error ...: $(libgpg_error_ver))
329 $(info Npth ...........: $(npth_ver))
330 $(info Libgcrypt ......: $(libgcrypt_ver))
331 $(info Libassuan ......: $(libassuan_ver))
332 $(info Zlib ...........: $(zlib_ver))
333 $(info Bzip2 ..........: $(bzip2_ver))
334 $(info ADNS ...........: $(adns_ver))
335 $(info SQLite .........: $(sqlite_ver))
336 $(info GPGME ..........: $(gpgme_ver))
337 $(info Pinentry .......: $(pinentry_ver))
338 $(info GPA ............: $(gpa_ver))
339 $(info GpgEX.... ......: $(gpgex_ver))
342 # Version number for external packages
343 pkg_config_ver = 0.23
345 gettext_ver = 0.18.2.1
349 gdk_pixbuf_ver = 2.26.5
356 # The GIT repository. Using a local repo is much faster.
357 #gitrep = git://git.gnupg.org
360 # The tarball directories
361 pkgrep = ftp://ftp.gnupg.org/gcrypt
362 pkg10rep = ftp://ftp.g10code.com/g10code
363 pkg2rep = $(TARBALLS)
365 # For each package, the following variables can be defined:
367 # speedo_pkg_PACKAGE_git: The GIT repository that should be built.
368 # speedo_pkg_PACKAGE_gitref: The GIT revision to checkout
370 # speedo_pkg_PACKAGE_tar: URL to the tar file that should be built.
372 # Exactly one of the above variables is required. Note that this
373 # version of speedo does not cache repositories or tar files, and does
374 # not test the integrity of the downloaded software. If you care
375 # about this, you can also specify filenames to locally verified files.
376 # Filenames are differentiated from URLs by starting with a slash '/'.
378 # speedo_pkg_PACKAGE_configure: Extra arguments to configure.
380 # speedo_pkg_PACKAGE_make_args: Extra arguments to make.
382 # speedo_pkg_PACKAGE_make_args_inst: Extra arguments to make install.
384 # Note that you can override the defaults in this file in a local file
388 else ifeq ($(WHAT),git)
389 speedo_pkg_libgpg_error_git = $(gitrep)/libgpg-error
390 speedo_pkg_libgpg_error_gitref = master
391 speedo_pkg_npth_git = $(gitrep)/npth
392 speedo_pkg_npth_gitref = master
393 speedo_pkg_libassuan_git = $(gitrep)/libassuan
394 speedo_pkg_libassuan_gitref = master
395 speedo_pkg_libgcrypt_git = $(gitrep)/libgcrypt
396 speedo_pkg_libgcrypt_gitref = master
397 speedo_pkg_libksba_git = $(gitrep)/libksba
398 speedo_pkg_libksba_gitref = master
399 speedo_pkg_gpgme_git = $(gitrep)/gpgme
400 speedo_pkg_gpgme_gitref = master
401 speedo_pkg_pinentry_git = $(gitrep)/pinentry
402 speedo_pkg_pinentry_gitref = master
403 speedo_pkg_gpa_git = $(gitrep)/gpa
404 speedo_pkg_gpa_gitref = master
405 speedo_pkg_gpgex_git = $(gitrep)/gpgex
406 speedo_pkg_gpgex_gitref = master
407 else ifeq ($(WHAT),release)
408 speedo_pkg_libgpg_error_tar = \
409 $(pkgrep)/libgpg-error/libgpg-error-$(libgpg_error_ver).tar.bz2
410 speedo_pkg_npth_tar = \
411 $(pkgrep)/npth/npth-$(npth_ver).tar.bz2
412 speedo_pkg_libassuan_tar = \
413 $(pkgrep)/libassuan/libassuan-$(libassuan_ver).tar.bz2
414 speedo_pkg_libgcrypt_tar = \
415 $(pkgrep)/libgcrypt/libgcrypt-$(libgcrypt_ver).tar.bz2
416 speedo_pkg_libksba_tar = \
417 $(pkgrep)/libksba/libksba-$(libksba_ver).tar.bz2
418 speedo_pkg_gpgme_tar = \
419 $(pkgrep)/gpgme/gpgme-$(gpgme_ver).tar.bz2
420 speedo_pkg_pinentry_tar = \
421 $(pkgrep)/pinentry/pinentry-$(pinentry_ver).tar.bz2
422 speedo_pkg_gpa_tar = \
423 $(pkgrep)/gpa/gpa-$(gpa_ver).tar.bz2
424 speedo_pkg_gpgex_tar = \
425 $(pkg10rep)/gpgex/gpgex-$(gpgex_ver).tar.bz2
427 $(error invalid value for WHAT (use on of: git release this))
430 speedo_pkg_pkg_config_tar = $(pkg2rep)/pkg-config-$(pkg_config_ver).tar.gz
431 speedo_pkg_zlib_tar = $(pkgrep)/zlib/zlib-$(zlib_ver).tar.gz
432 speedo_pkg_bzip2_tar = $(pkgrep)/bzip2/bzip2-$(bzip2_ver).tar.gz
433 speedo_pkg_sqlite_tar = $(pkgrep)/sqlite/sqlite-autoconf-$(sqlite_ver).tar.gz
434 speedo_pkg_adns_tar = $(pkg10rep)/adns/adns-$(adns_ver).tar.bz2
435 speedo_pkg_libiconv_tar = $(pkg2rep)/libiconv-$(libiconv_ver).tar.gz
436 speedo_pkg_gettext_tar = $(pkg2rep)/gettext-$(gettext_ver).tar.gz
437 speedo_pkg_libffi_tar = $(pkg2rep)/libffi-$(libffi_ver).tar.gz
438 speedo_pkg_glib_tar = $(pkg2rep)/glib-$(glib_ver).tar.xz
439 speedo_pkg_libpng_tar = $(pkg2rep)/libpng-$(libpng_ver).tar.bz2
440 speedo_pkg_gdk_pixbuf_tar = $(pkg2rep)/gdk-pixbuf-$(gdk_pixbuf_ver).tar.xz
441 speedo_pkg_atk_tar = $(pkg2rep)/atk-$(atk_ver).tar.bz2
442 speedo_pkg_pango_tar = $(pkg2rep)/pango-$(pango_ver).tar.bz2
443 speedo_pkg_pixman_tar = $(pkg2rep)/pixman-$(pixman_ver).tar.gz
444 speedo_pkg_cairo_tar = $(pkg2rep)/cairo-$(cairo_ver).tar.xz
445 speedo_pkg_gtk__tar = $(pkg2rep)/gtk+-$(gtk__ver).tar.xz
449 # Package build options
452 speedo_pkg_libgpg_error_configure = --enable-static
453 speedo_pkg_w64_libgpg_error_configure = --enable-static
455 speedo_pkg_libassuan_configure = --enable-static
456 speedo_pkg_w64_libassuan_configure = --enable-static
458 speedo_pkg_libgcrypt_configure = --disable-static
460 speedo_pkg_libksba_configure = --disable-static
462 ifeq ($(TARGETOS),w32)
463 speedo_pkg_gnupg_configure = \
464 --enable-gpg2-is-gpg --disable-g13 --disable-ntbtls \
465 --enable-build-timestamp
467 speedo_pkg_gnupg_configure = --disable-g13
469 speedo_pkg_gnupg_extracflags = -g
471 # Create the version info files only for W32 so that they won't get
472 # installed if for example INSTALL_PREFIX=/usr/local is used.
473 ifeq ($(TARGETOS),w32)
474 define speedo_pkg_gnupg_post_install
476 sed -n 's/.*PACKAGE_VERSION "\(.*\)"/\1/p' config.h >$(idir)/INST_VERSION; \
477 sed -n 's/.*W32INFO_VI_PRODUCTVERSION \(.*\)/\1/p' common/w32info-rc.h \
478 |sed 's/,/./g' >$(idir)/INST_PROD_VERSION )
482 # The LDFLAGS is needed for -lintl for glib.
484 speedo_pkg_gpgme_configure = \
485 --enable-static --enable-w32-glib --disable-w32-qt \
486 --with-gpg-error-prefix=$(idir) \
487 LDFLAGS=-L$(idir)/lib
489 speedo_pkg_gpgme_configure = \
490 --disable-static --disable-w32-glib --disable-w32-qt \
491 --with-gpg-error-prefix=$(idir) \
492 LDFLAGS=-L$(idir)/lib
496 ifeq ($(TARGETOS),w32)
497 speedo_pkg_pinentry_configure = --disable-pinentry-gtk2
499 speedo_pkg_pinentry_configure = --enable-pinentry-gtk2
501 speedo_pkg_pinentry_configure += \
502 --disable-pinentry-qt4 \
503 CPPFLAGS=-I$(idir)/include \
504 LDFLAGS=-L$(idir)/lib \
505 CXXFLAGS=-static-libstdc++
508 speedo_pkg_gpa_configure = \
509 --with-libiconv-prefix=$(idir) --with-libintl-prefix=$(idir) \
510 --with-gpgme-prefix=$(idir) --with-zlib=$(idir) \
511 --with-libassuan-prefix=$(idir) --with-gpg-error-prefix=$(idir)
513 speedo_pkg_gpgex_configure = \
514 --with-gpg-error-prefix=$(idir) \
515 --with-libassuan-prefix=$(idir) \
518 speedo_pkg_w64_gpgex_configure = \
519 --with-gpg-error-prefix=$(idir6) \
520 --with-libassuan-prefix=$(idir6) \
528 ifeq ($(TARGETOS),w32)
529 speedo_pkg_zlib_make_args = \
530 -fwin32/Makefile.gcc PREFIX=$(host)- IMPLIB=libz.dll.a
532 speedo_pkg_zlib_make_args_inst = \
533 -fwin32/Makefile.gcc \
534 BINARY_PATH=$(idir)/bin INCLUDE_PATH=$(idir)/include \
535 LIBRARY_PATH=$(idir)/lib SHARED_MODE=1 IMPLIB=libz.dll.a
537 # Zlib needs some special magic to generate a libtool file.
538 # We also install the pc file here.
539 define speedo_pkg_zlib_post_install
540 (set -e; mkdir $(idir)/lib/pkgconfig || true; \
541 cp $(auxsrc)/zlib.pc $(idir)/lib/pkgconfig/; \
543 echo "# Generated by libtool" > lib/libz.la \
544 echo "dlname='../bin/zlib1.dll'" >> lib/libz.la; \
545 echo "library_names='libz.dll.a'" >> lib/libz.la; \
546 echo "old_library='libz.a'" >> lib/libz.la; \
547 echo "dependency_libs=''" >> lib/libz.la; \
548 echo "current=1" >> lib/libz.la; \
549 echo "age=2" >> lib/libz.la; \
550 echo "revision=5" >> lib/libz.la; \
551 echo "installed=yes" >> lib/libz.la; \
552 echo "shouldnotlink=no" >> lib/libz.la; \
553 echo "dlopen=''" >> lib/libz.la; \
554 echo "dlpreopen=''" >> lib/libz.la; \
555 echo "libdir=\"$(idir)/lib\"" >> lib/libz.la)
560 ifeq ($(TARGETOS),w32)
561 speedo_pkg_bzip2_make_args = \
562 CC="$(host)-gcc" AR="$(host)-ar" RANLIB="$(host)-ranlib"
564 speedo_pkg_bzip2_make_args_inst = \
565 PREFIX=$(idir) CC="$(host)-gcc" AR="$(host)-ar" RANLIB="$(host)-ranlib"
568 speedo_pkg_w64_libiconv_configure = \
569 --enable-shared=no --enable-static=yes
571 speedo_pkg_gettext_configure = \
572 --with-lib-prefix=$(idir) --with-libiconv-prefix=$(idir) \
573 CPPFLAGS=-I$(idir)/include LDFLAGS=-L$(idir)/lib
574 speedo_pkg_w64_gettext_configure = \
575 --with-lib-prefix=$(idir) --with-libiconv-prefix=$(idir) \
576 CPPFLAGS=-I$(idir6)/include LDFLAGS=-L$(idir6)/lib
577 speedo_pkg_gettext_extracflags = -O2
578 # We only need gettext-runtime and there is sadly no top level
579 # configure option for this
580 speedo_pkg_gettext_make_dir = gettext-runtime
583 speedo_pkg_glib_configure = \
584 --disable-modular-tests \
585 --with-libiconv=gnu \
586 CPPFLAGS=-I$(idir)/include \
587 LDFLAGS=-L$(idir)/lib \
589 LIBFFI_CFLAGS=-I$(idir)/lib/libffi-$(libffi_ver)/include \
590 LIBFFI_LIBS=\"-L$(idir)/lib -lffi\"
591 ifeq ($(TARGETOS),w32)
592 speedo_pkg_glib_extracflags = -march=i486
595 ifeq ($(TARGETOS),w32)
596 speedo_pkg_libpng_configure = \
597 CPPFLAGS=\"-I$(idir)/include -DPNG_BUILD_DLL\" \
598 LDFLAGS=\"-L$(idir)/lib\" LIBPNG_DEFINES=\"-DPNG_BUILD_DLL\"
600 speedo_pkg_libpng_configure = \
601 CPPFLAGS=\"-I$(idir)/include\" \
602 LDFLAGS=\"-L$(idir)/lib\"
605 ifneq ($(TARGETOS),w32)
606 speedo_pkg_gdk_pixbuf_configure = --without-libtiff --without-libjpeg
609 speedo_pkg_pixman_configure = \
610 CPPFLAGS=-I$(idir)/include \
611 LDFLAGS=-L$(idir)/lib
613 ifeq ($(TARGETOS),w32)
614 speedo_pkg_cairo_configure = \
615 --disable-qt --disable-ft --disable-fc \
616 --enable-win32 --enable-win32-font \
617 CPPFLAGS=-I$(idir)/include \
618 LDFLAGS=-L$(idir)/lib
620 speedo_pkg_cairo_configure = \
622 CPPFLAGS=-I$(idir)/include \
623 LDFLAGS=-L$(idir)/lib
626 speedo_pkg_pango_configure = \
628 CPPFLAGS=-I$(idir)/include \
629 LDFLAGS=-L$(idir)/lib
631 speedo_pkg_gtk__configure = \
633 CPPFLAGS=-I$(idir)/include \
634 LDFLAGS=-L$(idir)/lib
641 report: report-speedo
645 ifeq ($(TARGETOS),w32)
646 STRIP = i686-w64-mingw32-strip
650 W32CC = i686-w64-mingw32-gcc
655 # The generic speedo code
660 SHA1SUM := $(shell $(topsrc)/build-aux/getswdb.sh --find-sha1sum)
661 ifeq ($(SHA1SUM),false)
662 $(error The sha1sum tool is missing)
664 SHA2SUM := $(shell $(topsrc)/build-aux/getswdb.sh --find-sha256sum)
665 ifeq ($(SHA2SUM),false)
666 $(error The sha256sum tool is missing)
670 BUILD_ISODATE=$(shell date -u +%Y-%m-%d)
671 BUILD_DATESTR=$(subst -,,$(BUILD_ISODATE))
673 # The next two macros will work only after gnupg has been build.
674 ifeq ($(TARGETOS),w32)
675 INST_VERSION=$(shell head -1 $(idir)/INST_VERSION)
676 INST_PROD_VERSION=$(shell head -1 $(idir)/INST_PROD_VERSION)
680 speedo_build_list = $(speedo_spkgs)
681 speedo_w64_build_list = $(speedo_w64_spkgs)
683 # To avoid running external commands during the read phase (":=" style
684 # assignments), we check that the targetos has been given
687 # Determine build and host system
688 build := $(shell $(topsrc)/autogen.sh --silent --print-build)
689 ifeq ($(TARGETOS),w32)
690 speedo_autogen_buildopt := --build-w32
691 speedo_autogen_buildopt6 := --build-w64
692 host := $(shell $(topsrc)/autogen.sh --silent --print-host --build-w32)
693 host6:= $(shell $(topsrc)/autogen.sh --silent --print-host --build-w64)
694 speedo_host_build_option := --host=$(host) --build=$(build)
695 speedo_host_build_option6 := --host=$(host6) --build=$(build)
696 speedo_w32_cflags := -mms-bitfields
698 speedo_autogen_buildopt :=
700 speedo_host_build_option :=
707 speedo_makeopt=-j$(MAKE_J)
710 # End non-empty TARGETOS
715 # The playground area is our scratch area, where we unpack, build and
716 # install the packages.
717 $(stampdir)/stamp-directories:
718 $(MKDIR) $(root) || true
719 $(MKDIR) $(stampdir) || true
720 $(MKDIR) $(sdir) || true
721 $(MKDIR) $(bdir) || true
722 $(MKDIR) $(idir) || true
723 ifeq ($(TARGETOS),w32)
724 $(MKDIR) $(bdir6) || true
725 $(MKDIR) $(idir6) || true
727 touch $(stampdir)/stamp-directories
729 # Frob the name $1 by converting all '-' and '+' characters to '_'.
731 $(subst +,_,$(subst -,_,$(1)))
734 # Get the variable $(1) (which may contain '-' and '+' characters).
736 $($(call FROB_macro,$(1)))
739 # Set a couple of common variables.
742 git="$(call GETVAR,speedo_pkg_$(1)_git)"; \
743 gitref="$(call GETVAR,speedo_pkg_$(1)_gitref)"; \
744 tar="$(call GETVAR,speedo_pkg_$(1)_tar)"; \
745 sha2="$(call GETVAR,$(1)_sha2)"; \
746 sha1="$(call GETVAR,$(1)_sha1)"; \
747 pkgsdir="$(sdir)/$(1)"; \
748 if [ "$(1)" = "gnupg" ]; then \
752 pkgsdir="$(topsrc)"; \
754 pkgbdir="$(bdir)/$(1)"; \
755 pkgcfg="$(call GETVAR,speedo_pkg_$(1)_configure)"; \
756 tmp="$(speedo_w32_cflags) \
757 $(call GETVAR,speedo_pkg_$(1)_extracflags)"; \
758 if [ x$$$$(echo "$$$$tmp" | tr -d '[:space:]')x != xx ]; then \
759 pkgextracflags="CFLAGS=\"$$$$tmp\""; \
763 pkgmkdir="$(call GETVAR,speedo_pkg_$(1)_make_dir)"; \
764 pkgmkargs="$(call GETVAR,speedo_pkg_$(1)_make_args)"; \
765 pkgmkargs_inst="$(call GETVAR,speedo_pkg_$(1)_make_args_inst)"; \
766 pkgmkargs_uninst="$(call GETVAR,speedo_pkg_$(1)_make_args_uninst)"; \
767 export PKG_CONFIG="/usr/bin/pkg-config"; \
768 export PKG_CONFIG_PATH="$(idir)/lib/pkgconfig"; \
769 [ "$(TARGETOS)" != native ] && export PKG_CONFIG_LIBDIR=""; \
770 export SYSROOT="$(idir)"; \
771 export PATH="$(idir)/bin:$${PATH}"; \
772 export LD_LIBRARY_PATH="$(idir)/lib:$${LD_LIBRARY_PATH}"
777 git="$(call GETVAR,speedo_pkg_$(1)_git)"; \
778 gitref="$(call GETVAR,speedo_pkg_$(1)_gitref)"; \
779 tar="$(call GETVAR,speedo_pkg_$(1)_tar)"; \
780 sha2="$(call GETVAR,$(1)_sha2)"; \
781 sha1="$(call GETVAR,$(1)_sha1)"; \
782 pkgsdir="$(sdir)/$(1)"; \
783 if [ "$(1)" = "gnupg" ]; then \
787 pkgsdir="$(topsrc)"; \
789 pkgbdir="$(bdir6)/$(1)"; \
790 pkgcfg="$(call GETVAR,speedo_pkg_w64_$(1)_configure)"; \
791 tmp="$(speedo_w32_cflags) \
792 $(call GETVAR,speedo_pkg_$(1)_extracflags)"; \
793 if [ x$$$$(echo "$$$$tmp" | tr -d '[:space:]')x != xx ]; then \
794 pkgextracflags="CFLAGS=\"$$$$tmp\""; \
798 pkgmkdir="$(call GETVAR,speedo_pkg_$(1)_make_dir)"; \
799 pkgmkargs="$(call GETVAR,speedo_pkg_$(1)_make_args)"; \
800 pkgmkargs_inst="$(call GETVAR,speedo_pkg_$(1)_make_args_inst)"; \
801 pkgmkargs_uninst="$(call GETVAR,speedo_pkg_$(1)_make_args_uninst)"; \
802 export PKG_CONFIG="/usr/bin/pkg-config"; \
803 export PKG_CONFIG_PATH="$(idir6)/lib/pkgconfig"; \
804 [ "$(TARGETOS)" != native ] && export PKG_CONFIG_LIBDIR=""; \
805 export SYSROOT="$(idir6)"; \
806 export PATH="$(idir6)/bin:$${PATH}"; \
807 export LD_LIBRARY_PATH="$(idir6)/lib:$${LD_LIBRARY_PATH}"
811 # Template for source packages.
813 # Note that the gnupg package is special: The package source dir is
814 # the same as the topsrc dir and thus we need to detect the gnupg
815 # package and cd to that directory. We also test that no in-source build
816 # has been done. autogen.sh is not run for gnupg.
820 $(stampdir)/stamp-$(1)-00-unpack: $(stampdir)/stamp-directories
822 @echo "speedo: * $(1)"
824 @(set -e; cd $(sdir); \
825 $(call SETVARS,$(1)); \
826 if [ "$(WHAT)" = "this" ]; then \
827 echo "speedo: using included source"; \
828 elif [ "$(1)" = "gnupg" ]; then \
830 if [ -f config.log ]; then \
831 echo "GnuPG has already been build in-source" >&2 ;\
832 echo "Please run \"make distclean\" and retry" >&2 ;\
835 echo "speedo: unpacking gnupg not needed"; \
836 elif [ -n "$$$${git}" ]; then \
837 echo "speedo: unpacking $(1) from $$$${git}:$$$${gitref}"; \
838 git clone -b "$$$${gitref}" "$$$${git}" "$$$${pkg}"; \
840 AUTOGEN_SH_SILENT=1 ./autogen.sh; \
841 elif [ -n "$$$${tar}" ]; then \
842 echo "speedo: unpacking $(1) from $$$${tar}"; \
843 case "$$$${tar}" in \
844 *.gz) pretar=zcat ;; \
845 *.bz2) pretar=bzcat ;; \
846 *.xz) pretar=xzcat ;; \
849 [ -f tmp.tgz ] && rm tmp.tgz; \
850 case "$$$${tar}" in \
851 /*) $$$${pretar} < $$$${tar} | tar xf - ;; \
852 *) wget -q -O - $$$${tar} | tee tmp.tgz \
853 | $$$${pretar} | tar x$$$${opt}f - ;; \
855 if [ -f tmp.tgz ]; then \
856 if [ -n "$$$${sha2}" ]; then \
857 tmp=$$$$($(SHA2SUM) <tmp.tgz|cut -d' ' -f1);\
858 if [ "$$$${tmp}" != "$$$${sha2}" ]; then \
860 echo "speedo: ERROR: SHA-256 checksum mismatch for $(1)";\
864 elif [ -n "$$$${sha1}" ]; then \
865 tmp=$$$$($(SHA1SUM) <tmp.tgz|cut -d' ' -f1);\
866 if [ "$$$${tmp}" != "$$$${sha1}" ]; then \
868 echo "speedo: ERROR: SHA-1 checksum mismatch for $(1)";\
874 echo "speedo: Warning: No checksum known for $(1)";\
879 base=`echo "$$$${tar}" | sed -e 's,^.*/,,' \
880 | sed -e 's,\.tar.*$$$$,,'`; \
881 mv $$$${base} $(1); \
882 patch="$(patdir)/$(1)-$$$${base#$(1)-}.patch";\
883 patchx="$(patdir)/$(1).patch"; \
884 if [ -x "$$$${patch}" ]; then \
885 echo "speedo: applying patch $$$${patch}"; \
886 cd $(1); "$$$${patch}"; \
887 elif [ -x "$$$${patchx}" ]; then \
888 echo "speedo: applying patch $$$${patchx}";\
889 cd $(1); "$$$${patchx}"; \
890 elif [ -f "$$$${patch}" ]; then \
891 echo "speedo: warning: $$$${patch} is not executable"; \
894 echo "speedo: unpacking $(1) from UNKNOWN"; \
896 @touch $(stampdir)/stamp-$(1)-00-unpack
898 $(stampdir)/stamp-$(1)-01-configure: $(stampdir)/stamp-$(1)-00-unpack
899 @echo "speedo: configuring $(1)"
900 ifneq ($(findstring $(1),$(speedo_make_only_style)),)
901 @echo "speedo: configure run not required"
902 else ifneq ($(findstring $(1),$(speedo_gnupg_style)),)
903 @($(call SETVARS,$(1)); \
904 mkdir "$$$${pkgbdir}"; \
905 cd "$$$${pkgbdir}"; \
906 if [ -n "$(speedo_autogen_buildopt)" ]; then \
907 eval AUTOGEN_SH_SILENT=1 w32root="$(idir)" \
908 "$$$${pkgsdir}/autogen.sh" \
909 $(speedo_autogen_buildopt) \
910 $$$${pkgcfg} $$$${pkgextracflags}; \
912 eval "$$$${pkgsdir}/configure" \
914 --enable-maintainer-mode \
916 $$$${pkgcfg} $$$${pkgextracflags}; \
919 @($(call SETVARS,$(1)); \
920 mkdir "$$$${pkgbdir}"; \
921 cd "$$$${pkgbdir}"; \
922 eval "$$$${pkgsdir}/configure" \
923 --silent $(speedo_host_build_option) \
925 $$$${pkgcfg} $$$${pkgextracflags}; \
928 @touch $(stampdir)/stamp-$(1)-01-configure
930 # Note that unpack has no 64 bit version becuase it is just the source.
931 # Fixme: We should use templates to create the standard and w64
932 # version of these rules.
933 $(stampdir)/stamp-w64-$(1)-01-configure: $(stampdir)/stamp-$(1)-00-unpack
934 @echo "speedo: configuring $(1) (64 bit)"
935 ifneq ($(findstring $(1),$(speedo_make_only_style)),)
936 @echo "speedo: configure run not required"
937 else ifneq ($(findstring $(1),$(speedo_gnupg_style)),)
938 @($(call SETVARS_W64,$(1)); \
939 mkdir "$$$${pkgbdir}"; \
940 cd "$$$${pkgbdir}"; \
941 if [ -n "$(speedo_autogen_buildopt)" ]; then \
942 eval AUTOGEN_SH_SILENT=1 w64root="$(idir6)" \
943 "$$$${pkgsdir}/autogen.sh" \
944 $(speedo_autogen_buildopt6) \
945 $$$${pkgcfg} $$$${pkgextracflags}; \
947 eval "$$$${pkgsdir}/configure" \
949 --enable-maintainer-mode \
950 --prefix="$(idir6)" \
951 $$$${pkgcfg} $$$${pkgextracflags}; \
954 @($(call SETVARS_W64,$(1)); \
955 mkdir "$$$${pkgbdir}"; \
956 cd "$$$${pkgbdir}"; \
957 eval "$$$${pkgsdir}/configure" \
958 --silent $(speedo_host_build_option6) \
959 --prefix="$(idir6)" \
960 $$$${pkgcfg} $$$${pkgextracflags}; \
963 @touch $(stampdir)/stamp-w64-$(1)-01-configure
966 $(stampdir)/stamp-$(1)-02-make: $(stampdir)/stamp-$(1)-01-configure
967 @echo "speedo: making $(1)"
968 ifneq ($(findstring $(1),$(speedo_make_only_style)),)
969 @($(call SETVARS,$(1)); \
970 cd "$$$${pkgsdir}"; \
971 test -n "$$$${pkgmkdir}" && cd "$$$${pkgmkdir}"; \
972 if test "$$$${pkg}" = zlib -a "$(TARGETOS)" != w32 ; then \
973 ./configure --prefix="$(idir)" ; \
975 $(MAKE) --no-print-directory $(speedo_makeopt) $$$${pkgmkargs} V=0)
977 @($(call SETVARS,$(1)); \
978 cd "$$$${pkgbdir}"; \
979 test -n "$$$${pkgmkdir}" && cd "$$$${pkgmkdir}"; \
980 $(MAKE) --no-print-directory $(speedo_makeopt) $$$${pkgmkargs} V=0)
982 @touch $(stampdir)/stamp-$(1)-02-make
984 $(stampdir)/stamp-w64-$(1)-02-make: $(stampdir)/stamp-w64-$(1)-01-configure
985 @echo "speedo: making $(1) (64 bit)"
986 ifneq ($(findstring $(1),$(speedo_make_only_style)),)
987 @($(call SETVARS_W64,$(1)); \
988 cd "$$$${pkgsdir}"; \
989 test -n "$$$${pkgmkdir}" && cd "$$$${pkgmkdir}"; \
990 $(MAKE) --no-print-directory $(speedo_makeopt) $$$${pkgmkargs} V=0)
992 @($(call SETVARS_W64,$(1)); \
993 cd "$$$${pkgbdir}"; \
994 test -n "$$$${pkgmkdir}" && cd "$$$${pkgmkdir}"; \
995 $(MAKE) --no-print-directory $(speedo_makeopt) $$$${pkgmkargs} V=0)
997 @touch $(stampdir)/stamp-w64-$(1)-02-make
999 # Note that post_install must come last because it may be empty and
1000 # "; ;" is a syntax error.
1001 $(stampdir)/stamp-$(1)-03-install: $(stampdir)/stamp-$(1)-02-make
1002 @echo "speedo: installing $(1)"
1003 ifneq ($(findstring $(1),$(speedo_make_only_style)),)
1004 @($(call SETVARS,$(1)); \
1005 cd "$$$${pkgsdir}"; \
1006 test -n "$$$${pkgmkdir}" && cd "$$$${pkgmkdir}"; \
1007 $(MAKE) --no-print-directory $$$${pkgmkargs_inst} install V=0;\
1008 $(call speedo_pkg_$(call FROB_macro,$(1))_post_install))
1010 @($(call SETVARS,$(1)); \
1011 cd "$$$${pkgbdir}"; \
1012 test -n "$$$${pkgmkdir}" && cd "$$$${pkgmkdir}"; \
1013 $(MAKE) --no-print-directory $$$${pkgmkargs_inst} install-strip V=0;\
1014 $(call speedo_pkg_$(call FROB_macro,$(1))_post_install))
1016 touch $(stampdir)/stamp-$(1)-03-install
1018 $(stampdir)/stamp-w64-$(1)-03-install: $(stampdir)/stamp-w64-$(1)-02-make
1019 @echo "speedo: installing $(1) (64 bit)"
1020 ifneq ($(findstring $(1),$(speedo_make_only_style)),)
1021 @($(call SETVARS_W64,$(1)); \
1022 cd "$$$${pkgsdir}"; \
1023 test -n "$$$${pkgmkdir}" && cd "$$$${pkgmkdir}"; \
1024 $(MAKE) --no-print-directory $$$${pkgmkargs_inst} install V=0;\
1025 $(call speedo_pkg_$(call FROB_macro,$(1))_post_install))
1027 @($(call SETVARS_W64,$(1)); \
1028 cd "$$$${pkgbdir}"; \
1029 test -n "$$$${pkgmkdir}" && cd "$$$${pkgmkdir}"; \
1030 $(MAKE) --no-print-directory $$$${pkgmkargs_inst} install-strip V=0;\
1031 $(call speedo_pkg_$(call FROB_macro,$(1))_post_install))
1033 touch $(stampdir)/stamp-w64-$(1)-03-install
1035 $(stampdir)/stamp-final-$(1): $(stampdir)/stamp-$(1)-03-install
1036 @echo "speedo: $(1) done"
1037 @touch $(stampdir)/stamp-final-$(1)
1039 $(stampdir)/stamp-w64-final-$(1): $(stampdir)/stamp-w64-$(1)-03-install
1040 @echo "speedo: $(1) (64 bit) done"
1041 @touch $(stampdir)/stamp-w64-final-$(1)
1045 @echo "speedo: uninstalling $(1)"
1046 @($(call SETVARS,$(1)); \
1047 (cd "$$$${pkgbdir}" 2>/dev/null && \
1048 $(MAKE) --no-print-directory \
1049 $$$${pkgmkargs_uninst} uninstall V=0 ) || true;\
1050 if [ "$(1)" = "gnupg" ]; then \
1051 rm -fR "$$$${pkgbdir}" || true ;\
1053 rm -fR "$$$${pkgsdir}" "$$$${pkgbdir}" || true;\
1055 -rm -f $(stampdir)/stamp-final-$(1) $(stampdir)/stamp-$(1)-*
1059 build-$(1): $(stampdir)/stamp-final-$(1)
1062 .PHONY : report-$(1)
1064 @($(call SETVARS,$(1)); \
1066 if [ -n "$$$${git}" ]; then \
1067 if [ -e "$$$${pkgsdir}/.git" ]; then \
1068 cd "$$$${pkgsdir}" && \
1073 elif [ -n "$$$${tar}" ]; then \
1074 base=`echo "$$$${tar}" | sed -e 's,^.*/,,' \
1075 | sed -e 's,\.tar.*$$$$,,'`; \
1082 # Insert the template for each source package.
1083 $(foreach spkg, $(speedo_spkgs), $(eval $(call SPKG_template,$(spkg))))
1085 $(stampdir)/stamp-final: $(stampdir)/stamp-directories
1086 ifeq ($(TARGETOS),w32)
1087 $(stampdir)/stamp-final: $(addprefix $(stampdir)/stamp-w64-final-,$(speedo_w64_build_list))
1089 $(stampdir)/stamp-final: $(addprefix $(stampdir)/stamp-final-,$(speedo_build_list))
1090 touch $(stampdir)/stamp-final
1092 all-speedo: $(stampdir)/stamp-final
1094 report-speedo: $(addprefix report-,$(speedo_build_list))
1096 # Just to check if we catched all stamps.
1098 $(RM) -fR $(stampdir)
1108 ifeq ($(TARGETOS),w32)
1110 dist-source: installer
1111 for i in 00 01 02 03; do sleep 1;touch PLAY/stamps/stamp-*-${i}-*;done
1113 tarname="$(INST_NAME)-$(INST_VERSION)_$(BUILD_DATESTR).tar" ;\
1114 [ -f "$$tarname" ] && rm "$$tarname" ;\
1115 tar -C $(topsrc) -cf "$$tarname" --exclude-backups --exclude-vc \
1116 --transform='s,^\./,$(INST_NAME)-$(INST_VERSION)/,' \
1117 --anchored --exclude './PLAY' . ;\
1118 tar --totals -rf "$$tarname" --exclude-backups --exclude-vc \
1119 --transform='s,^,$(INST_NAME)-$(INST_VERSION)/,' \
1120 PLAY/stamps/stamp-*-00-unpack PLAY/src swdb.lst swdb.lst.sig ;\
1121 [ -f "$$tarname".xz ] && rm "$$tarname".xz;\
1126 # Extract the two latest news entries. */
1127 $(bdir)/NEWS.tmp: $(topsrc)/NEWS
1128 awk '/^Notewo/ {if(okay>1){exit}; okay++};okay {print $0}' \
1129 <$(topsrc)/NEWS >$(bdir)/NEWS.tmp
1131 $(bdir)/README.txt: $(bdir)/NEWS.tmp $(topsrc)/README $(w32src)/README.txt \
1132 $(w32src)/pkg-copyright.txt
1134 -e '/!NEWSFILE!/{r $(bdir)/NEWS.tmp' -e 'd;}' \
1135 -e '/!GNUPGREADME!/{r $(topsrc)/README' -e 'd;}' \
1136 -e '/!PKG-COPYRIGHT!/{r $(w32src)/pkg-copyright.txt' -e 'd;}' \
1137 -e 's,!VERSION!,$(INST_VERSION),g' \
1138 < $(w32src)/README.txt \
1140 | awk '{printf "%s\r\n", $$0}' >$(bdir)/README.txt
1142 $(bdir)/g4wihelp.dll: $(w32src)/g4wihelp.c $(w32src)/exdll.h
1143 (set -e; cd $(bdir); \
1144 $(W32CC) -I. -shared -O2 -o g4wihelp.dll $(w32src)/g4wihelp.c \
1146 $(STRIP) g4wihelp.dll)
1148 w32_insthelpers: $(bdir)/g4wihelp.dll
1150 $(bdir)/inst-options.ini: $(w32src)/inst-options.ini
1151 cat $(w32src)/inst-options.ini >$(bdir)/inst-options.ini
1153 extra_installer_options =
1154 ifeq ($(WITH_GUI),1)
1155 extra_installer_options += -DWITH_GUI=1
1158 installer: all w32_insthelpers $(w32src)/inst-options.ini $(bdir)/README.txt
1160 -DINST_DIR=$(idir) \
1161 -DINST6_DIR=$(idir6) \
1162 -DBUILD_DIR=$(bdir) \
1163 -DTOP_SRCDIR=$(topsrc) \
1164 -DW32_SRCDIR=$(w32src) \
1165 -DBUILD_ISODATE=$(BUILD_ISODATE) \
1166 -DBUILD_DATESTR=$(BUILD_DATESTR) \
1167 -DNAME=$(INST_NAME) \
1168 -DVERSION=$(INST_VERSION) \
1169 -DPROD_VERSION=$(INST_PROD_VERSION) \
1170 $(extra_installer_options) $(w32src)/inst.nsi
1171 @echo "Ready: $(idir)/$(INST_NAME)-$(INST_VERSION)_$(BUILD_DATESTR).exe"
1174 define MKSWDB_commands
1175 ( pref="#+macro: gnupg21_w32_" ;\
1176 echo "$${pref}ver $(INST_VERSION)_$(BUILD_DATESTR)" ;\
1177 echo "$${pref}date $(2)" ;\
1178 echo "$${pref}size $$(wc -c <$(1)|awk '{print int($$1/1024)}')k";\
1179 echo "$${pref}sha1 $$(sha1sum <$(1)|cut -d' ' -f1)" ;\
1180 echo "$${pref}sha2 $$(sha256sum <$(1)|cut -d' ' -f1)" ;\
1185 # Build the installer from the source tarball.
1186 installer-from-source: dist-source
1188 [ -d PLAY-release ] && rm -rf PLAY-release; \
1189 mkdir PLAY-release;\
1191 tar xJf "../$(INST_NAME)-$(INST_VERSION)_$(BUILD_DATESTR).tar.xz";\
1192 cd $(INST_NAME)-$(INST_VERSION); \
1193 $(MAKE) -f build-aux/speedo.mk this-w32-installer SELFCHECK=0;\
1194 reldate="$$(date -u +%Y-%m-%d)" ;\
1195 exefile="$(INST_NAME)-$(INST_VERSION)_$(BUILD_DATESTR).exe" ;\
1196 cp "PLAY/inst/$$exefile" ../.. ;\
1197 exefile="../../$$exefile" ;\
1198 $(call MKSWDB_commands,$${exefile},$${reldate}); \
1201 # This target repeats some of the installer-from-source steps but it
1202 # is intended to be called interactively, so that the passphrase can be
1207 cd $(INST_NAME)-$(INST_VERSION); \
1208 reldate="$$(date -u +%Y-%m-%d)" ;\
1209 exefile="$(INST_NAME)-$(INST_VERSION)_$(BUILD_DATESTR).exe" ;\
1210 echo "speedo: /*" ;\
1211 echo "speedo: * Signing installer" ;\
1212 echo "speedo: * Key: $(AUTHENTICODE_KEY)";\
1213 echo "speedo: */" ;\
1214 osslsigncode sign -pkcs12 $(AUTHENTICODE_KEY) -askpass \
1215 -h sha256 -in "PLAY/inst/$$exefile" -out "../../$$exefile" ;\
1216 exefile="../../$$exefile" ;\
1217 $(call MKSWDB_commands,$${exefile},$${reldate}); \
1218 echo "speedo: /*" ;\
1219 echo "speedo: * Verification result" ;\
1220 echo "speedo: */" ;\
1221 osslsigncode verify $${exefile} \
1231 # Check availibility of standard tools
1237 # Mark phony targets
1239 .PHONY: all all-speedo report-speedo clean-stamps clean-speedo installer \
1240 w32_insthelpers check-tools