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)
189 speedo_spkgs += gettext libiconv
196 ifeq ($(TARGETOS),w32)
204 ifeq ($(TARGETOS),w32)
207 libffi glib pkg-config
214 ifeq ($(TARGETOS),w32)
218 gdk-pixbuf atk pixman cairo pango gtk+
222 ifeq ($(TARGETOS),w32)
224 speedo_spkgs += pinentry
226 speedo_spkgs += gpa gpgex
232 speedo_spkgs += pinentry gpa
238 # =====END LIST OF PACKAGES=====
241 # Packages which are additionally build for 64 bit Windows. They are
242 # only used for gpgex and thus we need to build them only if we want
246 speedo_w64_spkgs += libgpg-error libiconv gettext libassuan gpgex
249 # Packages which use the gnupg autogen.sh build style
250 speedo_gnupg_style = \
251 libgpg-error npth libgcrypt \
252 libassuan libksba ntbtls gnupg gpgme \
255 # Packages which use only make and no build directory
256 speedo_make_only_style = \
259 # Get the content of the software DB.
260 ifeq ($(CUSTOM_SWDB),1)
261 getswdb_options = --skip-download --skip-verify
265 ifeq ($(SELFCHECK),0)
266 getswdb_options += --skip-selfcheck
269 SWDB := $(shell $(topsrc)/build-aux/getswdb.sh $(getswdb_options) && echo okay)
270 ifeq ($(strip $(SWDB)),)
272 $(error Error getting GnuPG software version database)
276 # Version numbers of the released packages
277 gnupg_ver_this = $(shell cat $(topsrc)/VERSION)
279 gnupg_ver := $(shell awk '$$1=="gnupg22_ver" {print $$2}' swdb.lst)
281 libgpg_error_ver := $(shell awk '$$1=="libgpg_error_ver" {print $$2}' swdb.lst)
282 libgpg_error_sha1:= $(shell awk '$$1=="libgpg_error_sha1" {print $$2}' swdb.lst)
283 libgpg_error_sha2:= $(shell awk '$$1=="libgpg_error_sha2" {print $$2}' swdb.lst)
285 npth_ver := $(shell awk '$$1=="npth_ver" {print $$2}' swdb.lst)
286 npth_sha1 := $(shell awk '$$1=="npth_sha1" {print $$2}' swdb.lst)
287 npth_sha2 := $(shell awk '$$1=="npth_sha2" {print $$2}' swdb.lst)
289 libgcrypt_ver := $(shell awk '$$1=="libgcrypt_ver" {print $$2}' swdb.lst)
290 libgcrypt_sha1 := $(shell awk '$$1=="libgcrypt_sha1" {print $$2}' swdb.lst)
291 libgcrypt_sha2 := $(shell awk '$$1=="libgcrypt_sha2" {print $$2}' swdb.lst)
293 libassuan_ver := $(shell awk '$$1=="libassuan_ver" {print $$2}' swdb.lst)
294 libassuan_sha1 := $(shell awk '$$1=="libassuan_sha1" {print $$2}' swdb.lst)
295 libassuan_sha2 := $(shell awk '$$1=="libassuan_sha2" {print $$2}' swdb.lst)
297 libksba_ver := $(shell awk '$$1=="libksba_ver" {print $$2}' swdb.lst)
298 libksba_sha1 := $(shell awk '$$1=="libksba_sha1" {print $$2}' swdb.lst)
299 libksba_sha2 := $(shell awk '$$1=="libksba_sha2" {print $$2}' swdb.lst)
301 ntbtls_ver := $(shell awk '$$1=="ntbtls_ver" {print $$2}' swdb.lst)
302 ntbtls_sha1 := $(shell awk '$$1=="ntbtls_sha1" {print $$2}' swdb.lst)
303 ntbtls_sha2 := $(shell awk '$$1=="ntbtls_sha2" {print $$2}' swdb.lst)
305 gpgme_ver := $(shell awk '$$1=="gpgme_ver" {print $$2}' swdb.lst)
306 gpgme_sha1 := $(shell awk '$$1=="gpgme_sha1" {print $$2}' swdb.lst)
307 gpgme_sha2 := $(shell awk '$$1=="gpgme_sha2" {print $$2}' swdb.lst)
309 pinentry_ver := $(shell awk '$$1=="pinentry_ver" {print $$2}' swdb.lst)
310 pinentry_sha1 := $(shell awk '$$1=="pinentry_sha1" {print $$2}' swdb.lst)
311 pinentry_sha2 := $(shell awk '$$1=="pinentry_sha2" {print $$2}' swdb.lst)
313 gpa_ver := $(shell awk '$$1=="gpa_ver" {print $$2}' swdb.lst)
314 gpa_sha1 := $(shell awk '$$1=="gpa_sha1" {print $$2}' swdb.lst)
315 gpa_sha2 := $(shell awk '$$1=="gpa_sha2" {print $$2}' swdb.lst)
317 gpgex_ver := $(shell awk '$$1=="gpgex_ver" {print $$2}' swdb.lst)
318 gpgex_sha1 := $(shell awk '$$1=="gpgex_sha1" {print $$2}' swdb.lst)
319 gpgex_sha2 := $(shell awk '$$1=="gpgex_sha2" {print $$2}' swdb.lst)
321 zlib_ver := $(shell awk '$$1=="zlib_ver" {print $$2}' swdb.lst)
322 zlib_sha1 := $(shell awk '$$1=="zlib_sha1_gz" {print $$2}' swdb.lst)
323 zlib_sha2 := $(shell awk '$$1=="zlib_sha2_gz" {print $$2}' swdb.lst)
325 bzip2_ver := $(shell awk '$$1=="bzip2_ver" {print $$2}' swdb.lst)
326 bzip2_sha1 := $(shell awk '$$1=="bzip2_sha1_gz" {print $$2}' swdb.lst)
327 bzip2_sha2 := $(shell awk '$$1=="bzip2_sha2_gz" {print $$2}' swdb.lst)
329 sqlite_ver := $(shell awk '$$1=="sqlite_ver" {print $$2}' swdb.lst)
330 sqlite_sha1 := $(shell awk '$$1=="sqlite_sha1_gz" {print $$2}' swdb.lst)
331 sqlite_sha2 := $(shell awk '$$1=="sqlite_sha2_gz" {print $$2}' swdb.lst)
334 $(info Information from the version database)
335 $(info GnuPG ..........: $(gnupg_ver) (building $(gnupg_ver_this)))
336 $(info Libgpg-error ...: $(libgpg_error_ver))
337 $(info Npth ...........: $(npth_ver))
338 $(info Libgcrypt ......: $(libgcrypt_ver))
339 $(info Libassuan ......: $(libassuan_ver))
340 $(info Libksba ........: $(libksba_ver))
341 $(info Zlib ...........: $(zlib_ver))
342 $(info Bzip2 ..........: $(bzip2_ver))
343 $(info SQLite .........: $(sqlite_ver))
344 $(info NtbTLS .. ......: $(ntbtls_ver))
345 $(info GPGME ..........: $(gpgme_ver))
346 $(info Pinentry .......: $(pinentry_ver))
347 $(info GPA ............: $(gpa_ver))
348 $(info GpgEX.... ......: $(gpgex_ver))
351 # Version number for external packages
352 pkg_config_ver = 0.23
354 gettext_ver = 0.18.2.1
358 gdk_pixbuf_ver = 2.26.5
365 # The GIT repository. Using a local repo is much faster.
366 #gitrep = git://git.gnupg.org
369 # The tarball directories
370 pkgrep = ftp://ftp.gnupg.org/gcrypt
371 pkg10rep = ftp://ftp.g10code.com/g10code
372 pkg2rep = $(TARBALLS)
374 # For each package, the following variables can be defined:
376 # speedo_pkg_PACKAGE_git: The GIT repository that should be built.
377 # speedo_pkg_PACKAGE_gitref: The GIT revision to checkout
379 # speedo_pkg_PACKAGE_tar: URL to the tar file that should be built.
381 # Exactly one of the above variables is required. Note that this
382 # version of speedo does not cache repositories or tar files, and does
383 # not test the integrity of the downloaded software. If you care
384 # about this, you can also specify filenames to locally verified files.
385 # Filenames are differentiated from URLs by starting with a slash '/'.
387 # speedo_pkg_PACKAGE_configure: Extra arguments to configure.
389 # speedo_pkg_PACKAGE_make_args: Extra arguments to make.
391 # speedo_pkg_PACKAGE_make_args_inst: Extra arguments to make install.
393 # Note that you can override the defaults in this file in a local file
397 else ifeq ($(WHAT),git)
398 speedo_pkg_libgpg_error_git = $(gitrep)/libgpg-error
399 speedo_pkg_libgpg_error_gitref = master
400 speedo_pkg_npth_git = $(gitrep)/npth
401 speedo_pkg_npth_gitref = master
402 speedo_pkg_libassuan_git = $(gitrep)/libassuan
403 speedo_pkg_libassuan_gitref = master
404 speedo_pkg_libgcrypt_git = $(gitrep)/libgcrypt
405 speedo_pkg_libgcrypt_gitref = master
406 speedo_pkg_libksba_git = $(gitrep)/libksba
407 speedo_pkg_libksba_gitref = master
408 speedo_pkg_ntbtls_git = $(gitrep)/ntbtls
409 speedo_pkg_ntbtls_gitref = master
410 speedo_pkg_gpgme_git = $(gitrep)/gpgme
411 speedo_pkg_gpgme_gitref = master
412 speedo_pkg_pinentry_git = $(gitrep)/pinentry
413 speedo_pkg_pinentry_gitref = master
414 speedo_pkg_gpa_git = $(gitrep)/gpa
415 speedo_pkg_gpa_gitref = master
416 speedo_pkg_gpgex_git = $(gitrep)/gpgex
417 speedo_pkg_gpgex_gitref = master
418 else ifeq ($(WHAT),release)
419 speedo_pkg_libgpg_error_tar = \
420 $(pkgrep)/libgpg-error/libgpg-error-$(libgpg_error_ver).tar.bz2
421 speedo_pkg_npth_tar = \
422 $(pkgrep)/npth/npth-$(npth_ver).tar.bz2
423 speedo_pkg_libassuan_tar = \
424 $(pkgrep)/libassuan/libassuan-$(libassuan_ver).tar.bz2
425 speedo_pkg_libgcrypt_tar = \
426 $(pkgrep)/libgcrypt/libgcrypt-$(libgcrypt_ver).tar.bz2
427 speedo_pkg_libksba_tar = \
428 $(pkgrep)/libksba/libksba-$(libksba_ver).tar.bz2
429 speedo_pkg_ntbtls_tar = \
430 $(pkgrep)/ntbtls/ntbtls-$(ntbtls_ver).tar.bz2
431 speedo_pkg_gpgme_tar = \
432 $(pkgrep)/gpgme/gpgme-$(gpgme_ver).tar.bz2
433 speedo_pkg_pinentry_tar = \
434 $(pkgrep)/pinentry/pinentry-$(pinentry_ver).tar.bz2
435 speedo_pkg_gpa_tar = \
436 $(pkgrep)/gpa/gpa-$(gpa_ver).tar.bz2
437 speedo_pkg_gpgex_tar = \
438 $(pkg10rep)/gpgex/gpgex-$(gpgex_ver).tar.bz2
440 $(error invalid value for WHAT (use on of: git release this))
443 speedo_pkg_pkg_config_tar = $(pkg2rep)/pkg-config-$(pkg_config_ver).tar.gz
444 speedo_pkg_zlib_tar = $(pkgrep)/zlib/zlib-$(zlib_ver).tar.gz
445 speedo_pkg_bzip2_tar = $(pkgrep)/bzip2/bzip2-$(bzip2_ver).tar.gz
446 speedo_pkg_sqlite_tar = $(pkgrep)/sqlite/sqlite-autoconf-$(sqlite_ver).tar.gz
447 speedo_pkg_libiconv_tar = $(pkg2rep)/libiconv-$(libiconv_ver).tar.gz
448 speedo_pkg_gettext_tar = $(pkg2rep)/gettext-$(gettext_ver).tar.gz
449 speedo_pkg_libffi_tar = $(pkg2rep)/libffi-$(libffi_ver).tar.gz
450 speedo_pkg_glib_tar = $(pkg2rep)/glib-$(glib_ver).tar.xz
451 speedo_pkg_libpng_tar = $(pkg2rep)/libpng-$(libpng_ver).tar.bz2
452 speedo_pkg_gdk_pixbuf_tar = $(pkg2rep)/gdk-pixbuf-$(gdk_pixbuf_ver).tar.xz
453 speedo_pkg_atk_tar = $(pkg2rep)/atk-$(atk_ver).tar.bz2
454 speedo_pkg_pango_tar = $(pkg2rep)/pango-$(pango_ver).tar.bz2
455 speedo_pkg_pixman_tar = $(pkg2rep)/pixman-$(pixman_ver).tar.gz
456 speedo_pkg_cairo_tar = $(pkg2rep)/cairo-$(cairo_ver).tar.xz
457 speedo_pkg_gtk__tar = $(pkg2rep)/gtk+-$(gtk__ver).tar.xz
461 # Package build options
464 speedo_pkg_libgpg_error_configure = --enable-static
465 speedo_pkg_w64_libgpg_error_configure = --enable-static
467 speedo_pkg_libassuan_configure = --enable-static
468 speedo_pkg_w64_libassuan_configure = --enable-static
470 speedo_pkg_libgcrypt_configure = --disable-static
472 speedo_pkg_libksba_configure = --disable-static
474 # For now we build ntbtls only static
475 speedo_pkg_ntbtls_configure = --enable-static --disable-shared
477 ifeq ($(TARGETOS),w32)
478 speedo_pkg_gnupg_configure = \
479 --disable-g13 --enable-ntbtls \
480 --enable-build-timestamp
482 speedo_pkg_gnupg_configure = --disable-g13
484 speedo_pkg_gnupg_extracflags = -g
486 # Create the version info files only for W32 so that they won't get
487 # installed if for example INSTALL_PREFIX=/usr/local is used.
488 ifeq ($(TARGETOS),w32)
489 define speedo_pkg_gnupg_post_install
491 sed -n 's/.*PACKAGE_VERSION "\(.*\)"/\1/p' config.h >$(idir)/INST_VERSION; \
492 sed -n 's/.*W32INFO_VI_PRODUCTVERSION \(.*\)/\1/p' common/w32info-rc.h \
493 |sed 's/,/./g' >$(idir)/INST_PROD_VERSION )
497 # The LDFLAGS is needed for -lintl for glib.
499 speedo_pkg_gpgme_configure = \
500 --enable-static --enable-w32-glib --disable-w32-qt \
501 --with-gpg-error-prefix=$(idir) \
502 LDFLAGS=-L$(idir)/lib
504 speedo_pkg_gpgme_configure = \
505 --disable-static --disable-w32-glib --disable-w32-qt \
506 --with-gpg-error-prefix=$(idir) \
507 LDFLAGS=-L$(idir)/lib
511 ifeq ($(TARGETOS),w32)
512 speedo_pkg_pinentry_configure = --disable-pinentry-gtk2
514 speedo_pkg_pinentry_configure = --enable-pinentry-gtk2
516 speedo_pkg_pinentry_configure += \
517 --disable-pinentry-qt4 \
518 CPPFLAGS=-I$(idir)/include \
519 LDFLAGS=-L$(idir)/lib \
520 CXXFLAGS=-static-libstdc++
523 speedo_pkg_gpa_configure = \
524 --with-libiconv-prefix=$(idir) --with-libintl-prefix=$(idir) \
525 --with-gpgme-prefix=$(idir) --with-zlib=$(idir) \
526 --with-libassuan-prefix=$(idir) --with-gpg-error-prefix=$(idir)
528 speedo_pkg_gpgex_configure = \
529 --with-gpg-error-prefix=$(idir) \
530 --with-libassuan-prefix=$(idir) \
533 speedo_pkg_w64_gpgex_configure = \
534 --with-gpg-error-prefix=$(idir6) \
535 --with-libassuan-prefix=$(idir6) \
543 ifeq ($(TARGETOS),w32)
544 speedo_pkg_zlib_make_args = \
545 -fwin32/Makefile.gcc PREFIX=$(host)- IMPLIB=libz.dll.a
547 speedo_pkg_zlib_make_args_inst = \
548 -fwin32/Makefile.gcc \
549 BINARY_PATH=$(idir)/bin INCLUDE_PATH=$(idir)/include \
550 LIBRARY_PATH=$(idir)/lib SHARED_MODE=1 IMPLIB=libz.dll.a
552 # Zlib needs some special magic to generate a libtool file.
553 # We also install the pc file here.
554 define speedo_pkg_zlib_post_install
555 (set -e; mkdir $(idir)/lib/pkgconfig || true; \
556 cp $(auxsrc)/zlib.pc $(idir)/lib/pkgconfig/; \
558 echo "# Generated by libtool" > lib/libz.la \
559 echo "dlname='../bin/zlib1.dll'" >> lib/libz.la; \
560 echo "library_names='libz.dll.a'" >> lib/libz.la; \
561 echo "old_library='libz.a'" >> lib/libz.la; \
562 echo "dependency_libs=''" >> lib/libz.la; \
563 echo "current=1" >> lib/libz.la; \
564 echo "age=2" >> lib/libz.la; \
565 echo "revision=5" >> lib/libz.la; \
566 echo "installed=yes" >> lib/libz.la; \
567 echo "shouldnotlink=no" >> lib/libz.la; \
568 echo "dlopen=''" >> lib/libz.la; \
569 echo "dlpreopen=''" >> lib/libz.la; \
570 echo "libdir=\"$(idir)/lib\"" >> lib/libz.la)
575 ifeq ($(TARGETOS),w32)
576 speedo_pkg_bzip2_make_args = \
577 CC="$(host)-gcc" AR="$(host)-ar" RANLIB="$(host)-ranlib"
579 speedo_pkg_bzip2_make_args_inst = \
580 PREFIX=$(idir) CC="$(host)-gcc" AR="$(host)-ar" RANLIB="$(host)-ranlib"
583 speedo_pkg_w64_libiconv_configure = \
584 --enable-shared=no --enable-static=yes
586 speedo_pkg_gettext_configure = \
587 --with-lib-prefix=$(idir) --with-libiconv-prefix=$(idir) \
588 CPPFLAGS=-I$(idir)/include LDFLAGS=-L$(idir)/lib
589 speedo_pkg_w64_gettext_configure = \
590 --with-lib-prefix=$(idir) --with-libiconv-prefix=$(idir) \
591 CPPFLAGS=-I$(idir6)/include LDFLAGS=-L$(idir6)/lib
592 speedo_pkg_gettext_extracflags = -O2
593 # We only need gettext-runtime and there is sadly no top level
594 # configure option for this
595 speedo_pkg_gettext_make_dir = gettext-runtime
598 speedo_pkg_glib_configure = \
599 --disable-modular-tests \
600 --with-libiconv=gnu \
601 CPPFLAGS=-I$(idir)/include \
602 LDFLAGS=-L$(idir)/lib \
604 LIBFFI_CFLAGS=-I$(idir)/lib/libffi-$(libffi_ver)/include \
605 LIBFFI_LIBS=\"-L$(idir)/lib -lffi\"
606 ifeq ($(TARGETOS),w32)
607 speedo_pkg_glib_extracflags = -march=i486
610 ifeq ($(TARGETOS),w32)
611 speedo_pkg_libpng_configure = \
612 CPPFLAGS=\"-I$(idir)/include -DPNG_BUILD_DLL\" \
613 LDFLAGS=\"-L$(idir)/lib\" LIBPNG_DEFINES=\"-DPNG_BUILD_DLL\"
615 speedo_pkg_libpng_configure = \
616 CPPFLAGS=\"-I$(idir)/include\" \
617 LDFLAGS=\"-L$(idir)/lib\"
620 ifneq ($(TARGETOS),w32)
621 speedo_pkg_gdk_pixbuf_configure = --without-libtiff --without-libjpeg
624 speedo_pkg_pixman_configure = \
625 CPPFLAGS=-I$(idir)/include \
626 LDFLAGS=-L$(idir)/lib
628 ifeq ($(TARGETOS),w32)
629 speedo_pkg_cairo_configure = \
630 --disable-qt --disable-ft --disable-fc \
631 --enable-win32 --enable-win32-font \
632 CPPFLAGS=-I$(idir)/include \
633 LDFLAGS=-L$(idir)/lib
635 speedo_pkg_cairo_configure = \
637 CPPFLAGS=-I$(idir)/include \
638 LDFLAGS=-L$(idir)/lib
641 speedo_pkg_pango_configure = \
643 CPPFLAGS=-I$(idir)/include \
644 LDFLAGS=-L$(idir)/lib
646 speedo_pkg_gtk__configure = \
648 CPPFLAGS=-I$(idir)/include \
649 LDFLAGS=-L$(idir)/lib
656 report: report-speedo
660 ifeq ($(TARGETOS),w32)
661 STRIP = i686-w64-mingw32-strip
665 W32CC = i686-w64-mingw32-gcc
670 # The generic speedo code
675 SHA1SUM := $(shell $(topsrc)/build-aux/getswdb.sh --find-sha1sum)
676 ifeq ($(SHA1SUM),false)
677 $(error The sha1sum tool is missing)
679 SHA2SUM := $(shell $(topsrc)/build-aux/getswdb.sh --find-sha256sum)
680 ifeq ($(SHA2SUM),false)
681 $(error The sha256sum tool is missing)
685 BUILD_ISODATE=$(shell date -u +%Y-%m-%d)
686 BUILD_DATESTR=$(subst -,,$(BUILD_ISODATE))
688 # The next two macros will work only after gnupg has been build.
689 ifeq ($(TARGETOS),w32)
690 INST_VERSION=$(shell head -1 $(idir)/INST_VERSION)
691 INST_PROD_VERSION=$(shell head -1 $(idir)/INST_PROD_VERSION)
695 speedo_build_list = $(speedo_spkgs)
696 speedo_w64_build_list = $(speedo_w64_spkgs)
698 # To avoid running external commands during the read phase (":=" style
699 # assignments), we check that the targetos has been given
702 # Determine build and host system
703 build := $(shell $(topsrc)/autogen.sh --silent --print-build)
704 ifeq ($(TARGETOS),w32)
705 speedo_autogen_buildopt := --build-w32
706 speedo_autogen_buildopt6 := --build-w64
707 host := $(shell $(topsrc)/autogen.sh --silent --print-host --build-w32)
708 host6:= $(shell $(topsrc)/autogen.sh --silent --print-host --build-w64)
709 speedo_host_build_option := --host=$(host) --build=$(build)
710 speedo_host_build_option6 := --host=$(host6) --build=$(build)
711 speedo_w32_cflags := -mms-bitfields
713 speedo_autogen_buildopt :=
715 speedo_host_build_option :=
722 speedo_makeopt=-j$(MAKE_J)
725 # End non-empty TARGETOS
730 # The playground area is our scratch area, where we unpack, build and
731 # install the packages.
732 $(stampdir)/stamp-directories:
733 $(MKDIR) $(root) || true
734 $(MKDIR) $(stampdir) || true
735 $(MKDIR) $(sdir) || true
736 $(MKDIR) $(bdir) || true
737 $(MKDIR) $(idir) || true
738 ifeq ($(TARGETOS),w32)
739 $(MKDIR) $(bdir6) || true
740 $(MKDIR) $(idir6) || true
742 touch $(stampdir)/stamp-directories
744 # Frob the name $1 by converting all '-' and '+' characters to '_'.
746 $(subst +,_,$(subst -,_,$(1)))
749 # Get the variable $(1) (which may contain '-' and '+' characters).
751 $($(call FROB_macro,$(1)))
754 # Set a couple of common variables.
757 git="$(call GETVAR,speedo_pkg_$(1)_git)"; \
758 gitref="$(call GETVAR,speedo_pkg_$(1)_gitref)"; \
759 tar="$(call GETVAR,speedo_pkg_$(1)_tar)"; \
760 ver="$(call GETVAR,$(1)_ver)"; \
761 sha2="$(call GETVAR,$(1)_sha2)"; \
762 sha1="$(call GETVAR,$(1)_sha1)"; \
763 pkgsdir="$(sdir)/$(1)"; \
764 if [ "$(1)" = "gnupg" ]; then \
768 pkgsdir="$(topsrc)"; \
770 pkgbdir="$(bdir)/$(1)"; \
771 pkgcfg="$(call GETVAR,speedo_pkg_$(1)_configure)"; \
772 tmp="$(speedo_w32_cflags) \
773 $(call GETVAR,speedo_pkg_$(1)_extracflags)"; \
774 if [ x$$$$(echo "$$$$tmp" | tr -d '[:space:]')x != xx ]; then \
775 pkgextracflags="CFLAGS=\"$$$$tmp\""; \
779 pkgmkdir="$(call GETVAR,speedo_pkg_$(1)_make_dir)"; \
780 pkgmkargs="$(call GETVAR,speedo_pkg_$(1)_make_args)"; \
781 pkgmkargs_inst="$(call GETVAR,speedo_pkg_$(1)_make_args_inst)"; \
782 pkgmkargs_uninst="$(call GETVAR,speedo_pkg_$(1)_make_args_uninst)"; \
783 export PKG_CONFIG="/usr/bin/pkg-config"; \
784 export PKG_CONFIG_PATH="$(idir)/lib/pkgconfig"; \
785 [ "$(TARGETOS)" != native ] && export PKG_CONFIG_LIBDIR=""; \
786 export SYSROOT="$(idir)"; \
787 export PATH="$(idir)/bin:$${PATH}"; \
788 export LD_LIBRARY_PATH="$(idir)/lib:$${LD_LIBRARY_PATH}"
793 git="$(call GETVAR,speedo_pkg_$(1)_git)"; \
794 gitref="$(call GETVAR,speedo_pkg_$(1)_gitref)"; \
795 tar="$(call GETVAR,speedo_pkg_$(1)_tar)"; \
796 ver="$(call GETVAR,$(1)_ver)"; \
797 sha2="$(call GETVAR,$(1)_sha2)"; \
798 sha1="$(call GETVAR,$(1)_sha1)"; \
799 pkgsdir="$(sdir)/$(1)"; \
800 if [ "$(1)" = "gnupg" ]; then \
804 pkgsdir="$(topsrc)"; \
806 pkgbdir="$(bdir6)/$(1)"; \
807 pkgcfg="$(call GETVAR,speedo_pkg_w64_$(1)_configure)"; \
808 tmp="$(speedo_w32_cflags) \
809 $(call GETVAR,speedo_pkg_$(1)_extracflags)"; \
810 if [ x$$$$(echo "$$$$tmp" | tr -d '[:space:]')x != xx ]; then \
811 pkgextracflags="CFLAGS=\"$$$$tmp\""; \
815 pkgmkdir="$(call GETVAR,speedo_pkg_$(1)_make_dir)"; \
816 pkgmkargs="$(call GETVAR,speedo_pkg_$(1)_make_args)"; \
817 pkgmkargs_inst="$(call GETVAR,speedo_pkg_$(1)_make_args_inst)"; \
818 pkgmkargs_uninst="$(call GETVAR,speedo_pkg_$(1)_make_args_uninst)"; \
819 export PKG_CONFIG="/usr/bin/pkg-config"; \
820 export PKG_CONFIG_PATH="$(idir6)/lib/pkgconfig"; \
821 [ "$(TARGETOS)" != native ] && export PKG_CONFIG_LIBDIR=""; \
822 export SYSROOT="$(idir6)"; \
823 export PATH="$(idir6)/bin:$${PATH}"; \
824 export LD_LIBRARY_PATH="$(idir6)/lib:$${LD_LIBRARY_PATH}"
828 # Template for source packages.
830 # Note that the gnupg package is special: The package source dir is
831 # the same as the topsrc dir and thus we need to detect the gnupg
832 # package and cd to that directory. We also test that no in-source build
833 # has been done. autogen.sh is not run for gnupg.
837 $(stampdir)/stamp-$(1)-00-unpack: $(stampdir)/stamp-directories
839 @echo "speedo: * $(1)"
841 @(set -e; cd $(sdir); \
842 $(call SETVARS,$(1)); \
843 if [ "$(WHAT)" = "this" ]; then \
844 echo "speedo: using included source"; \
845 elif [ "$(1)" = "gnupg" ]; then \
847 if [ -f config.log ]; then \
848 echo "GnuPG has already been build in-source" >&2 ;\
849 echo "Please run \"make distclean\" and retry" >&2 ;\
852 echo "speedo: unpacking gnupg not needed"; \
853 elif [ -n "$$$${git}" ]; then \
854 echo "speedo: unpacking $(1) from $$$${git}:$$$${gitref}"; \
855 git clone -b "$$$${gitref}" "$$$${git}" "$$$${pkg}"; \
857 AUTOGEN_SH_SILENT=1 ./autogen.sh; \
858 elif [ -n "$$$${tar}" ]; then \
859 echo "speedo: unpacking $(1) from $$$${tar}"; \
860 case "$$$${tar}" in \
861 *.gz) pretar=zcat ;; \
862 *.bz2) pretar=bzcat ;; \
863 *.xz) pretar=xzcat ;; \
866 [ -f tmp.tgz ] && rm tmp.tgz; \
867 case "$$$${tar}" in \
868 /*) $$$${pretar} < $$$${tar} | tar xf - ;; \
869 *) wget -q -O - $$$${tar} | tee tmp.tgz \
870 | $$$${pretar} | tar x$$$${opt}f - ;; \
872 if [ -f tmp.tgz ]; then \
873 if [ -n "$$$${sha2}" ]; then \
874 tmp=$$$$($(SHA2SUM) <tmp.tgz|cut -d' ' -f1);\
875 if [ "$$$${tmp}" != "$$$${sha2}" ]; then \
877 echo "speedo: ERROR: SHA-256 checksum mismatch for $(1)";\
881 elif [ -n "$$$${sha1}" ]; then \
882 tmp=$$$$($(SHA1SUM) <tmp.tgz|cut -d' ' -f1);\
883 if [ "$$$${tmp}" != "$$$${sha1}" ]; then \
885 echo "speedo: ERROR: SHA-1 checksum mismatch for $(1)";\
891 echo "speedo: Warning: No checksum known for $(1)";\
896 base=`echo "$$$${tar}" | sed -e 's,^.*/,,' \
897 | sed -e 's,\.tar.*$$$$,,'`; \
898 mv $$$${base} $(1); \
899 patch="$(patdir)/$(1)-$$$${base#$(1)-}.patch";\
900 patchx="$(patdir)/$(1).patch"; \
901 if [ -x "$$$${patch}" ]; then \
902 echo "speedo: applying patch $$$${patch}"; \
903 cd $(1); "$$$${patch}"; \
904 elif [ -x "$$$${patchx}" ]; then \
905 echo "speedo: applying patch $$$${patchx}";\
906 cd $(1); "$$$${patchx}"; \
907 elif [ -f "$$$${patch}" ]; then \
908 echo "speedo: warning: $$$${patch} is not executable"; \
911 echo "speedo: unpacking $(1) from UNKNOWN"; \
913 @touch $(stampdir)/stamp-$(1)-00-unpack
915 $(stampdir)/stamp-$(1)-01-configure: $(stampdir)/stamp-$(1)-00-unpack
916 @echo "speedo: configuring $(1)"
917 ifneq ($(findstring $(1),$(speedo_make_only_style)),)
918 @echo "speedo: configure run not required"
919 else ifneq ($(findstring $(1),$(speedo_gnupg_style)),)
920 @($(call SETVARS,$(1)); \
921 mkdir "$$$${pkgbdir}"; \
922 cd "$$$${pkgbdir}"; \
923 if [ -n "$(speedo_autogen_buildopt)" ]; then \
924 eval AUTOGEN_SH_SILENT=1 w32root="$(idir)" \
925 "$$$${pkgsdir}/autogen.sh" \
926 $(speedo_autogen_buildopt) \
927 $$$${pkgcfg} $$$${pkgextracflags}; \
929 eval "$$$${pkgsdir}/configure" \
931 --enable-maintainer-mode \
933 $$$${pkgcfg} $$$${pkgextracflags}; \
936 @($(call SETVARS,$(1)); \
937 mkdir "$$$${pkgbdir}"; \
938 cd "$$$${pkgbdir}"; \
939 eval "$$$${pkgsdir}/configure" \
940 --silent $(speedo_host_build_option) \
942 $$$${pkgcfg} $$$${pkgextracflags}; \
945 @touch $(stampdir)/stamp-$(1)-01-configure
947 # Note that unpack has no 64 bit version becuase it is just the source.
948 # Fixme: We should use templates to create the standard and w64
949 # version of these rules.
950 $(stampdir)/stamp-w64-$(1)-01-configure: $(stampdir)/stamp-$(1)-00-unpack
951 @echo "speedo: configuring $(1) (64 bit)"
952 ifneq ($(findstring $(1),$(speedo_make_only_style)),)
953 @echo "speedo: configure run not required"
954 else ifneq ($(findstring $(1),$(speedo_gnupg_style)),)
955 @($(call SETVARS_W64,$(1)); \
956 mkdir "$$$${pkgbdir}"; \
957 cd "$$$${pkgbdir}"; \
958 if [ -n "$(speedo_autogen_buildopt)" ]; then \
959 eval AUTOGEN_SH_SILENT=1 w64root="$(idir6)" \
960 "$$$${pkgsdir}/autogen.sh" \
961 $(speedo_autogen_buildopt6) \
962 $$$${pkgcfg} $$$${pkgextracflags}; \
964 eval "$$$${pkgsdir}/configure" \
966 --enable-maintainer-mode \
967 --prefix="$(idir6)" \
968 $$$${pkgcfg} $$$${pkgextracflags}; \
971 @($(call SETVARS_W64,$(1)); \
972 mkdir "$$$${pkgbdir}"; \
973 cd "$$$${pkgbdir}"; \
974 eval "$$$${pkgsdir}/configure" \
975 --silent $(speedo_host_build_option6) \
976 --prefix="$(idir6)" \
977 $$$${pkgcfg} $$$${pkgextracflags}; \
980 @touch $(stampdir)/stamp-w64-$(1)-01-configure
983 $(stampdir)/stamp-$(1)-02-make: $(stampdir)/stamp-$(1)-01-configure
984 @echo "speedo: making $(1)"
985 ifneq ($(findstring $(1),$(speedo_make_only_style)),)
986 @($(call SETVARS,$(1)); \
987 cd "$$$${pkgsdir}"; \
988 test -n "$$$${pkgmkdir}" && cd "$$$${pkgmkdir}"; \
989 if test "$$$${pkg}" = zlib -a "$(TARGETOS)" != w32 ; then \
990 ./configure --prefix="$(idir)" ; \
992 $(MAKE) --no-print-directory $(speedo_makeopt) $$$${pkgmkargs} V=0)
994 @($(call SETVARS,$(1)); \
995 cd "$$$${pkgbdir}"; \
996 test -n "$$$${pkgmkdir}" && cd "$$$${pkgmkdir}"; \
997 $(MAKE) --no-print-directory $(speedo_makeopt) $$$${pkgmkargs} V=0)
999 @touch $(stampdir)/stamp-$(1)-02-make
1001 $(stampdir)/stamp-w64-$(1)-02-make: $(stampdir)/stamp-w64-$(1)-01-configure
1002 @echo "speedo: making $(1) (64 bit)"
1003 ifneq ($(findstring $(1),$(speedo_make_only_style)),)
1004 @($(call SETVARS_W64,$(1)); \
1005 cd "$$$${pkgsdir}"; \
1006 test -n "$$$${pkgmkdir}" && cd "$$$${pkgmkdir}"; \
1007 $(MAKE) --no-print-directory $(speedo_makeopt) $$$${pkgmkargs} V=0)
1009 @($(call SETVARS_W64,$(1)); \
1010 cd "$$$${pkgbdir}"; \
1011 test -n "$$$${pkgmkdir}" && cd "$$$${pkgmkdir}"; \
1012 $(MAKE) --no-print-directory $(speedo_makeopt) $$$${pkgmkargs} V=0)
1014 @touch $(stampdir)/stamp-w64-$(1)-02-make
1016 # Note that post_install must come last because it may be empty and
1017 # "; ;" is a syntax error.
1018 $(stampdir)/stamp-$(1)-03-install: $(stampdir)/stamp-$(1)-02-make
1019 @echo "speedo: installing $(1)"
1020 ifneq ($(findstring $(1),$(speedo_make_only_style)),)
1021 @($(call SETVARS,$(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,$(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-$(1)-03-install
1035 $(stampdir)/stamp-w64-$(1)-03-install: $(stampdir)/stamp-w64-$(1)-02-make
1036 @echo "speedo: installing $(1) (64 bit)"
1037 ifneq ($(findstring $(1),$(speedo_make_only_style)),)
1038 @($(call SETVARS_W64,$(1)); \
1039 cd "$$$${pkgsdir}"; \
1040 test -n "$$$${pkgmkdir}" && cd "$$$${pkgmkdir}"; \
1041 $(MAKE) --no-print-directory $$$${pkgmkargs_inst} install V=0;\
1042 $(call speedo_pkg_$(call FROB_macro,$(1))_post_install))
1044 @($(call SETVARS_W64,$(1)); \
1045 cd "$$$${pkgbdir}"; \
1046 test -n "$$$${pkgmkdir}" && cd "$$$${pkgmkdir}"; \
1047 $(MAKE) --no-print-directory $$$${pkgmkargs_inst} install-strip V=0;\
1048 $(call speedo_pkg_$(call FROB_macro,$(1))_post_install))
1050 touch $(stampdir)/stamp-w64-$(1)-03-install
1052 $(stampdir)/stamp-final-$(1): $(stampdir)/stamp-$(1)-03-install
1053 @($(call SETVARS,$(1)); \
1054 printf "%-14s %-12s %s\n" $(1) "$$$${ver}" "$$$${sha1}" \
1055 >> $(bdir)/pkg-versions.txt)
1056 @echo "speedo: $(1) done"
1057 @touch $(stampdir)/stamp-final-$(1)
1059 $(stampdir)/stamp-w64-final-$(1): $(stampdir)/stamp-w64-$(1)-03-install
1060 @echo "speedo: $(1) (64 bit) done"
1061 @touch $(stampdir)/stamp-w64-final-$(1)
1065 @echo "speedo: uninstalling $(1)"
1066 @($(call SETVARS,$(1)); \
1067 (cd "$$$${pkgbdir}" 2>/dev/null && \
1068 $(MAKE) --no-print-directory \
1069 $$$${pkgmkargs_uninst} uninstall V=0 ) || true;\
1070 if [ "$(1)" = "gnupg" ]; then \
1071 rm -fR "$$$${pkgbdir}" || true ;\
1073 rm -fR "$$$${pkgsdir}" "$$$${pkgbdir}" || true;\
1075 -rm -f $(stampdir)/stamp-final-$(1) $(stampdir)/stamp-$(1)-*
1079 build-$(1): $(stampdir)/stamp-final-$(1)
1082 .PHONY : report-$(1)
1084 @($(call SETVARS,$(1)); \
1086 if [ -n "$$$${git}" ]; then \
1087 if [ -e "$$$${pkgsdir}/.git" ]; then \
1088 cd "$$$${pkgsdir}" && \
1093 elif [ -n "$$$${tar}" ]; then \
1094 base=`echo "$$$${tar}" | sed -e 's,^.*/,,' \
1095 | sed -e 's,\.tar.*$$$$,,'`; \
1102 # Insert the template for each source package.
1103 $(foreach spkg, $(speedo_spkgs), $(eval $(call SPKG_template,$(spkg))))
1105 $(stampdir)/stamp-final: $(stampdir)/stamp-directories clean-pkg-versions
1106 ifeq ($(TARGETOS),w32)
1107 $(stampdir)/stamp-final: $(addprefix $(stampdir)/stamp-w64-final-,$(speedo_w64_build_list))
1109 $(stampdir)/stamp-final: $(addprefix $(stampdir)/stamp-final-,$(speedo_build_list))
1110 touch $(stampdir)/stamp-final
1113 @: >$(bdir)/pkg-versions.txt
1115 all-speedo: $(stampdir)/stamp-final
1117 report-speedo: $(addprefix report-,$(speedo_build_list))
1119 # Just to check if we catched all stamps.
1121 $(RM) -fR $(stampdir)
1131 ifeq ($(TARGETOS),w32)
1133 dist-source: installer
1134 for i in 00 01 02 03; do sleep 1;touch PLAY/stamps/stamp-*-${i}-*;done
1136 tarname="$(INST_NAME)-$(INST_VERSION)_$(BUILD_DATESTR).tar" ;\
1137 [ -f "$$tarname" ] && rm "$$tarname" ;\
1138 tar -C $(topsrc) -cf "$$tarname" --exclude-backups --exclude-vcs \
1139 --transform='s,^\./,$(INST_NAME)-$(INST_VERSION)/,' \
1140 --anchored --exclude './PLAY' . ;\
1141 tar --totals -rf "$$tarname" --exclude-backups --exclude-vcs \
1142 --transform='s,^,$(INST_NAME)-$(INST_VERSION)/,' \
1143 PLAY/stamps/stamp-*-00-unpack PLAY/src swdb.lst swdb.lst.sig ;\
1144 [ -f "$$tarname".xz ] && rm "$$tarname".xz;\
1149 # Extract the two latest news entries. */
1150 $(bdir)/NEWS.tmp: $(topsrc)/NEWS
1151 awk '/^Notewo/ {if(okay>1){exit}; okay++};okay {print $0}' \
1152 <$(topsrc)/NEWS >$(bdir)/NEWS.tmp
1154 # Sort the file with the package versions.
1155 $(bdir)/pkg-versions.sorted: $(bdir)/pkg-versions.txt
1156 grep -v '^gnupg ' <$(bdir)/pkg-versions.txt \
1157 | sort | uniq >$(bdir)/pkg-versions.sorted
1159 $(bdir)/README.txt: $(bdir)/NEWS.tmp $(topsrc)/README $(w32src)/README.txt \
1160 $(w32src)/pkg-copyright.txt $(bdir)/pkg-versions.sorted
1162 -e '/!NEWSFILE!/{r $(bdir)/NEWS.tmp' -e 'd;}' \
1163 -e '/!GNUPGREADME!/{r $(topsrc)/README' -e 'd;}' \
1164 -e '/!PKG-COPYRIGHT!/{r $(w32src)/pkg-copyright.txt' -e 'd;}' \
1165 -e '/!PKG-VERSIONS!/{r $(bdir)/pkg-versions.sorted' -e 'd;}' \
1166 -e 's,!VERSION!,$(INST_VERSION),g' \
1167 < $(w32src)/README.txt \
1169 | awk '{printf "%s\r\n", $$0}' >$(bdir)/README.txt
1171 $(bdir)/g4wihelp.dll: $(w32src)/g4wihelp.c $(w32src)/exdll.h
1172 (set -e; cd $(bdir); \
1173 $(W32CC) -I. -shared -O2 -o g4wihelp.dll $(w32src)/g4wihelp.c \
1175 $(STRIP) g4wihelp.dll)
1177 w32_insthelpers: $(bdir)/g4wihelp.dll
1179 $(bdir)/inst-options.ini: $(w32src)/inst-options.ini
1180 cat $(w32src)/inst-options.ini >$(bdir)/inst-options.ini
1182 extra_installer_options =
1183 ifeq ($(WITH_GUI),1)
1184 extra_installer_options += -DWITH_GUI=1
1187 installer: all w32_insthelpers $(w32src)/inst-options.ini $(bdir)/README.txt
1189 -DINST_DIR=$(idir) \
1190 -DINST6_DIR=$(idir6) \
1191 -DBUILD_DIR=$(bdir) \
1192 -DTOP_SRCDIR=$(topsrc) \
1193 -DW32_SRCDIR=$(w32src) \
1194 -DBUILD_ISODATE=$(BUILD_ISODATE) \
1195 -DBUILD_DATESTR=$(BUILD_DATESTR) \
1196 -DNAME=$(INST_NAME) \
1197 -DVERSION=$(INST_VERSION) \
1198 -DPROD_VERSION=$(INST_PROD_VERSION) \
1199 $(extra_installer_options) $(w32src)/inst.nsi
1200 @echo "Ready: $(idir)/$(INST_NAME)-$(INST_VERSION)_$(BUILD_DATESTR).exe"
1203 define MKSWDB_commands
1204 ( pref="#+macro: gnupg22_w32_" ;\
1205 echo "$${pref}ver $(INST_VERSION)_$(BUILD_DATESTR)" ;\
1206 echo "$${pref}date $(2)" ;\
1207 echo "$${pref}size $$(wc -c <$(1)|awk '{print int($$1/1024)}')k";\
1208 echo "$${pref}sha1 $$(sha1sum <$(1)|cut -d' ' -f1)" ;\
1209 echo "$${pref}sha2 $$(sha256sum <$(1)|cut -d' ' -f1)" ;\
1214 # Build the installer from the source tarball.
1215 installer-from-source: dist-source
1217 [ -d PLAY-release ] && rm -rf PLAY-release; \
1218 mkdir PLAY-release;\
1220 tar xJf "../$(INST_NAME)-$(INST_VERSION)_$(BUILD_DATESTR).tar.xz";\
1221 cd $(INST_NAME)-$(INST_VERSION); \
1222 $(MAKE) -f build-aux/speedo.mk this-w32-installer SELFCHECK=0;\
1223 reldate="$$(date -u +%Y-%m-%d)" ;\
1224 exefile="$(INST_NAME)-$(INST_VERSION)_$(BUILD_DATESTR).exe" ;\
1225 cp "PLAY/inst/$$exefile" ../.. ;\
1226 exefile="../../$$exefile" ;\
1227 $(call MKSWDB_commands,$${exefile},$${reldate}); \
1230 # This target repeats some of the installer-from-source steps but it
1231 # is intended to be called interactively, so that the passphrase can be
1236 cd $(INST_NAME)-$(INST_VERSION); \
1237 reldate="$$(date -u +%Y-%m-%d)" ;\
1238 exefile="$(INST_NAME)-$(INST_VERSION)_$(BUILD_DATESTR).exe" ;\
1239 echo "speedo: /*" ;\
1240 echo "speedo: * Signing installer" ;\
1241 echo "speedo: * Key: $(AUTHENTICODE_KEY)";\
1242 echo "speedo: */" ;\
1243 osslsigncode sign -pkcs12 $(AUTHENTICODE_KEY) -askpass \
1244 -h sha256 -in "PLAY/inst/$$exefile" -out "../../$$exefile" ;\
1245 exefile="../../$$exefile" ;\
1246 $(call MKSWDB_commands,$${exefile},$${reldate}); \
1247 echo "speedo: /*" ;\
1248 echo "speedo: * Verification result" ;\
1249 echo "speedo: */" ;\
1250 osslsigncode verify $${exefile} \
1260 # Check availibility of standard tools
1266 # Mark phony targets
1268 .PHONY: all all-speedo report-speedo clean-stamps clean-speedo installer \
1269 w32_insthelpers check-tools clean-pkg-versions