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)))
49 # Set this to "git" or "release".
52 # Set target to "native" or "w32"
55 # Set to the location of the directory with traballs of
57 TARBALLS=$(shell pwd)/../tarballs
59 # Number of parallel make jobs
62 # =====BEGIN LIST OF PACKAGES=====
63 # The packages that should be built. The order is also the build order.
64 # Fixme: Do we need to build pkg-config for cross-building?
67 libgpg-error npth libgcrypt
69 ifeq ($(TARGETOS),w32)
75 libassuan libksba gnupg
77 ifeq ($(TARGETOS),w32)
79 libffi glib pkg-config
85 ifeq ($(TARGETOS),w32)
88 gdk-pixbuf atk pixman cairo pango gtk+
94 ifeq ($(TARGETOS),w32)
99 # =====END LIST OF PACKAGES=====
102 # Packages which are additionally build for 64 bit Windows
104 libgpg-error libiconv gettext libassuan gpgex
106 # Packages which use the gnupg autogen.sh build style
107 speedo_gnupg_style = \
108 libgpg-error npth libgcrypt \
109 libassuan libksba gnupg gpgme \
112 # Packages which use only make and no build directory
113 speedo_make_only_style = \
116 # Version numbers of the released packages
117 # Fixme: Take the version numbers from gnupg-doc/web/swdb.mac
118 libgpg_error_ver = 1.13
120 libgcrypt_ver = 1.6.1
121 libassuan_ver = 2.1.1
129 # Version number for external packages
130 pkg_config_ver = 0.23
133 gettext_ver = 0.18.2.1
137 gdk_pixbuf_ver = 2.26.5
145 # The GIT repository. Using a local repo is much faster.
146 #gitrep = git://git.gnupg.org
149 # The tarball directories
150 pkgrep = ftp://ftp.gnupg.org/gcrypt
151 pkg2rep = $(TARBALLS)
153 # For each package, the following variables can be defined:
155 # speedo_pkg_PACKAGE_git: The GIT repository that should be built.
156 # speedo_pkg_PACKAGE_gitref: The GIT revision to checkout
158 # speedo_pkg_PACKAGE_tar: URL to the tar file that should be built.
160 # Exactly one of the above variables is required. Note that this
161 # version of speedo does not cache repositories or tar files, and does
162 # not test the integrity of the downloaded software. If you care
163 # about this, you can also specify filenames to locally verified files.
164 # Filenames are differentiated from URLs by starting with a slash '/'.
166 # speedo_pkg_PACKAGE_configure: Extra arguments to configure.
168 # speedo_pkg_PACKAGE_make_args: Extra arguments to make.
170 # speedo_pkg_PACKAGE_make_args_inst: Extra arguments to make install.
172 # Note that you can override the defaults in this file in a local file
176 speedo_pkg_libgpg_error_git = $(gitrep)/libgpg-error
177 speedo_pkg_libgpg_error_gitref = master
178 speedo_pkg_npth_git = $(gitrep)/npth
179 speedo_pkg_npth_gitref = master
180 speedo_pkg_libassuan_git = $(gitrep)/libassuan
181 speedo_pkg_libassuan_gitref = master
182 speedo_pkg_libgcrypt_git = $(gitrep)/libgcrypt
183 speedo_pkg_libgcrypt_gitref = LIBGCRYPT-1-6-BRANCH
184 speedo_pkg_libksba_git = $(gitrep)/libksba
185 speedo_pkg_libksba_gitref = master
186 speedo_pkg_gpgme_git = $(gitrep)/gpgme
187 speedo_pkg_gpgme_gitref = master
188 speedo_pkg_pinentry_git = $(gitrep)/pinentry
189 speedo_pkg_pinentry_gitref = master
190 speedo_pkg_gpa_git = $(gitrep)/gpa
191 speedo_pkg_gpa_gitref = master
192 speedo_pkg_gpgex_git = $(gitrep)/gpgex
193 speedo_pkg_gpgex_gitref = master
195 speedo_pkg_libgpg_error_tar = \
196 $(pkgrep)/libgpg-error/libgpg-error-$(libgpg_error_ver).tar.bz2
197 speedo_pkg_npth_tar = \
198 $(pkgrep)/npth/npth-$(npth_ver).tar.bz2
199 speedo_pkg_libassuan_tar = \
200 $(pkgrep)/libassuan/libassuan-$(libassuan_ver).tar.bz2
201 speedo_pkg_libgcrypt_tar = \
202 $(pkgrep)/libgcrypt/libgcrypt-$(libgcrypt_ver).tar.bz2
203 speedo_pkg_libksba_tar = \
204 $(pkgrep)/libksba/libksba-$(libksba_ver).tar.bz2
205 speedo_pkg_gpgme_tar = \
206 $(pkgrep)/gpgme/gpgme-$(gpgme_ver).tar.bz2
207 speedo_pkg_pinentry_tar = \
208 $(pkgrep)/pinentry/pinentry-$(pinentry_ver).tar.bz2
209 speedo_pkg_gpa_tar = \
210 $(pkgrep)/gpa/gpa-$(gpa_ver).tar.bz2
211 speedo_pkg_gpgex_tar = \
212 $(pkgrep)/gpex/gpgex-$(gpa_ver).tar.bz2
215 speedo_pkg_pkg_config_tar = $(pkg2rep)/pkg-config-$(pkg_config_ver).tar.gz
216 speedo_pkg_zlib_tar = $(pkg2rep)/zlib-$(zlib_ver).tar.gz
217 speedo_pkg_libiconv_tar = $(pkg2rep)/libiconv-$(libiconv_ver).tar.gz
218 speedo_pkg_gettext_tar = $(pkg2rep)/gettext-$(gettext_ver).tar.gz
219 speedo_pkg_libffi_tar = $(pkg2rep)/libffi-$(libffi_ver).tar.gz
220 speedo_pkg_glib_tar = $(pkg2rep)/glib-$(glib_ver).tar.xz
221 speedo_pkg_libpng_tar = $(pkg2rep)/libpng-$(libpng_ver).tar.bz2
222 speedo_pkg_gdk_pixbuf_tar = $(pkg2rep)/gdk-pixbuf-$(gdk_pixbuf_ver).tar.xz
223 speedo_pkg_atk_tar = $(pkg2rep)/atk-$(atk_ver).tar.bz2
224 speedo_pkg_pango_tar = $(pkg2rep)/pango-$(pango_ver).tar.bz2
225 speedo_pkg_pixman_tar = $(pkg2rep)/pixman-$(pixman_ver).tar.gz
226 speedo_pkg_cairo_tar = $(pkg2rep)/cairo-$(cairo_ver).tar.xz
227 speedo_pkg_gtk__tar = $(pkg2rep)/gtk+-$(gtk__ver).tar.xz
231 # Package build options
234 speedo_pkg_libgpg_error_configure = --enable-static
235 speedo_pkg_w64_libgpg_error_configure = --enable-static
237 speedo_pkg_libassuan_configure = --enable-static
238 speedo_pkg_w64_libassuan_configure = --enable-static
240 speedo_pkg_libgcrypt_configure = --disable-static
242 speedo_pkg_libksba_configure = --disable-static
244 speedo_pkg_gnupg_configure = --enable-gpg2-is-gpg --disable-g13
245 speedo_pkg_gnupg_extracflags = -g
247 define speedo_pkg_gnupg_post_install
249 sed -n 's/.*PACKAGE_VERSION "\(.*\)"/\1/p' config.h >$(idir)/INST_VERSION; \
250 sed -n 's/.*W32INFO_VI_PRODUCTVERSION \(.*\)/\1/p' common/w32info-rc.h \
251 |sed 's/,/./g' >$(idir)/INST_PROD_VERSION )
255 # The LDFLAGS is needed for -lintl for glib.
256 speedo_pkg_gpgme_configure = \
257 --enable-static --enable-w32-glib --disable-w32-qt \
258 --with-gpg-error-prefix=$(idir) \
259 LDFLAGS=-L$(idir)/lib
261 speedo_pkg_pinentry_configure = \
262 --disable-pinentry-qt --disable-pinentry-qt4 --disable-pinentry-gtk \
263 --enable-pinentry-gtk2 \
264 --with-glib-prefix=$(idir) --with-gtk-prefix=$(idir) \
265 CPPFLAGS=-I$(idir)/include \
266 LDFLAGS=-L$(idir)/lib \
267 CXXFLAGS=-static-libstdc++
269 speedo_pkg_gpa_configure = \
270 --with-libiconv-prefix=$(idir) --with-libintl-prefix=$(idir) \
271 --with-gpgme-prefix=$(idir) --with-zlib=$(idir) \
272 --with-libassuan-prefix=$(idir) --with-gpg-error-prefix=$(idir)
274 speedo_pkg_gpgex_configure = \
275 --with-gpg-error-prefix=$(idir) \
276 --with-libassuan-prefix=$(idir)
278 speedo_pkg_w64_gpgex_configure = \
279 --with-gpg-error-prefix=$(idir6) \
280 --with-libassuan-prefix=$(idir6)
287 speedo_pkg_zlib_make_args = \
288 -fwin32/Makefile.gcc PREFIX=$(host)- IMPLIB=libz.dll.a
290 speedo_pkg_zlib_make_args_inst = \
291 -fwin32/Makefile.gcc \
292 BINARY_PATH=$(idir)/bin INCLUDE_PATH=$(idir)/include \
293 LIBRARY_PATH=$(idir)/lib SHARED_MODE=1 IMPLIB=libz.dll.a
295 # Zlib needs some special magic to generate a libtool file.
296 # We also install the pc file here.
297 define speedo_pkg_zlib_post_install
298 (set -e; mkdir $(idir)/lib/pkgconfig || true; \
299 cp $(auxsrc)/zlib.pc $(idir)/lib/pkgconfig/; \
301 echo "# Generated by libtool" > lib/libz.la \
302 echo "dlname='../bin/zlib1.dll'" >> lib/libz.la; \
303 echo "library_names='libz.dll.a'" >> lib/libz.la; \
304 echo "old_library='libz.a'" >> lib/libz.la; \
305 echo "dependency_libs=''" >> lib/libz.la; \
306 echo "current=1" >> lib/libz.la; \
307 echo "age=2" >> lib/libz.la; \
308 echo "revision=5" >> lib/libz.la; \
309 echo "installed=yes" >> lib/libz.la; \
310 echo "shouldnotlink=no" >> lib/libz.la; \
311 echo "dlopen=''" >> lib/libz.la; \
312 echo "dlpreopen=''" >> lib/libz.la; \
313 echo "libdir=\"$(idir)/lib\"" >> lib/libz.la)
316 speedo_pkg_w64_libiconv_configure = \
317 --enable-shared=no --enable-static=yes
319 speedo_pkg_gettext_configure = \
320 --with-lib-prefix=$(idir) --with-libiconv-prefix=$(idir) \
321 CPPFLAGS=-I$(idir)/include LDFLAGS=-L$(idir)/lib
322 speedo_pkg_w64_gettext_configure = \
323 --with-lib-prefix=$(idir) --with-libiconv-prefix=$(idir) \
324 CPPFLAGS=-I$(idir6)/include LDFLAGS=-L$(idir6)/lib
325 speedo_pkg_gettext_extracflags = -O2
326 # We only need gettext-runtime and there is sadly no top level
327 # configure option for this
328 speedo_pkg_gettext_make_dir = gettext-runtime
331 speedo_pkg_glib_configure = \
332 --disable-modular-tests \
333 --with-lib-prefix=$(idir) --with-libiconv-prefix=$(idir) \
334 CPPFLAGS=-I$(idir)/include \
335 LDFLAGS=-L$(idir)/lib \
337 LIBFFI_CFLAGS=-I$(idir)/lib/libffi-$(libffi_ver)/include \
338 LIBFFI_LIBS=\"-L$(idir)/lib -lffi\"
339 speedo_pkg_glib_extracflags = -march=i486
342 speedo_pkg_libpng_configure = \
343 CPPFLAGS=\"-I$(idir)/include -DPNG_BUILD_DLL\" \
344 LDFLAGS=\"-L$(idir)/lib\" LIBPNG_DEFINES=\"-DPNG_BUILD_DLL\"
346 speedo_pkg_pixman_configure = \
347 CPPFLAGS=-I$(idir)/include \
348 LDFLAGS=-L$(idir)/lib
350 speedo_pkg_cairo_configure = \
351 --disable-qt --disable-ft --disable-fc \
352 --enable-win32 --enable-win32-font \
353 CPPFLAGS=-I$(idir)/include \
354 LDFLAGS=-L$(idir)/lib
356 speedo_pkg_pango_configure = \
358 CPPFLAGS=-I$(idir)/include \
359 LDFLAGS=-L$(idir)/lib
361 speedo_pkg_gtk__configure = \
363 CPPFLAGS=-I$(idir)/include \
364 LDFLAGS=-L$(idir)/lib
371 report: report-speedo
375 ifeq ($(TARGETOS),w32)
376 STRIP = i686-w64-mingw32-strip
380 W32CC = i686-w64-mingw32-gcc
385 # The generic speedo code
390 BUILD_ISODATE=$(shell date -u +%Y-%m-%d)
392 # These paths must be absolute, as we switch directories pretty often.
393 root := $(shell pwd)/PLAY
395 bdir := $(root)/build
396 bdir6:= $(root)/build-w64
398 idir6:= $(root)/inst-w64
399 stampdir := $(root)/stamps
400 topsrc := $(shell cd $(dir $(SPEEDO_MK)).. && pwd)
401 auxsrc := $(topsrc)/build-aux/speedo
402 patdir := $(topsrc)/build-aux/speedo/patches
403 w32src := $(topsrc)/build-aux/speedo/w32
405 # The next two macros will work only after gnupg has been build.
406 INST_VERSION=$(shell head -1 $(idir)/INST_VERSION)
407 INST_PROD_VERSION=$(shell head -1 $(idir)/INST_PROD_VERSION)
410 speedo_build_list = $(speedo_spkgs)
411 speedo_w64_build_list = $(speedo_w64_spkgs)
413 # Determine build and host system
414 build := $(shell $(topsrc)/autogen.sh --silent --print-build)
415 ifeq ($(TARGETOS),w32)
416 speedo_autogen_buildopt := --build-w32
417 speedo_autogen_buildopt6 := --build-w64
418 host := $(shell $(topsrc)/autogen.sh --silent --print-host --build-w32)
419 host6:= $(shell $(topsrc)/autogen.sh --silent --print-host --build-w64)
420 speedo_host_build_option := --host=$(host) --build=$(build)
421 speedo_host_build_option6 := --host=$(host6) --build=$(build)
422 speedo_w32_cflags := -mms-bitfields
424 speedo_autogen_buildopt :=
426 speedo_host_build_option :=
433 speedo_makeopt=-j$(MAKE_J)
439 # The playground area is our scratch area, where we unpack, build and
440 # install the packages.
441 $(stampdir)/stamp-directories:
442 $(MKDIR) $(root) || true
443 $(MKDIR) $(stampdir) || true
444 $(MKDIR) $(sdir) || true
445 $(MKDIR) $(bdir) || true
446 $(MKDIR) $(idir) || true
447 ifeq ($(TARGETOS),w32)
448 $(MKDIR) $(bdir6) || true
449 $(MKDIR) $(idir6) || true
451 touch $(stampdir)/stamp-directories
453 # Frob the name $1 by converting all '-' and '+' characters to '_'.
455 $(subst +,_,$(subst -,_,$(1)))
458 # Get the variable $(1) (which may contain '-' and '+' characters).
460 $($(call FROB_macro,$(1)))
463 # Set a couple of common variables.
466 git="$(call GETVAR,speedo_pkg_$(1)_git)"; \
467 gitref="$(call GETVAR,speedo_pkg_$(1)_gitref)"; \
468 tar="$(call GETVAR,speedo_pkg_$(1)_tar)"; \
469 pkgsdir="$(sdir)/$(1)"; \
470 if [ "$(1)" = "gnupg" ]; then \
474 pkgsdir="$(topsrc)"; \
476 pkgbdir="$(bdir)/$(1)"; \
477 pkgcfg="$(call GETVAR,speedo_pkg_$(1)_configure)"; \
478 pkgextracflags="$(call GETVAR,speedo_pkg_$(1)_extracflags)"; \
479 pkgmkdir="$(call GETVAR,speedo_pkg_$(1)_make_dir)"; \
480 pkgmkargs="$(call GETVAR,speedo_pkg_$(1)_make_args)"; \
481 pkgmkargs_inst="$(call GETVAR,speedo_pkg_$(1)_make_args_inst)"; \
482 export PKG_CONFIG="/usr/bin/pkg-config"; \
483 export PKG_CONFIG_PATH="$(idir)/lib/pkgconfig"; \
484 export PKG_CONFIG_LIBDIR=""; \
485 export SYSROOT="$(idir)"; \
486 export PATH="$(idir)/bin:$${PATH}"; \
487 export LD_LIBRARY_PATH="$(idir)/lib:$${LD_LIBRARY_PATH}"
492 git="$(call GETVAR,speedo_pkg_$(1)_git)"; \
493 gitref="$(call GETVAR,speedo_pkg_$(1)_gitref)"; \
494 tar="$(call GETVAR,speedo_pkg_$(1)_tar)"; \
495 pkgsdir="$(sdir)/$(1)"; \
496 if [ "$(1)" = "gnupg" ]; then \
500 pkgsdir="$(topsrc)"; \
502 pkgbdir="$(bdir6)/$(1)"; \
503 pkgcfg="$(call GETVAR,speedo_pkg_w64_$(1)_configure)"; \
504 pkgextracflags="$(call GETVAR,speedo_pkg_$(1)_extracflags)"; \
505 pkgmkdir="$(call GETVAR,speedo_pkg_$(1)_make_dir)"; \
506 pkgmkargs="$(call GETVAR,speedo_pkg_$(1)_make_args)"; \
507 pkgmkargs_inst="$(call GETVAR,speedo_pkg_$(1)_make_args_inst)"; \
508 export PKG_CONFIG="/usr/bin/pkg-config"; \
509 export PKG_CONFIG_PATH="$(idir6)/lib/pkgconfig"; \
510 export PKG_CONFIG_LIBDIR=""; \
511 export SYSROOT="$(idir6)"; \
512 export PATH="$(idir6)/bin:$${PATH}"; \
513 export LD_LIBRARY_PATH="$(idir6)/lib:$${LD_LIBRARY_PATH}"
517 # Template for source packages.
519 # Note that the gnupg package is special: The package source dir is
520 # the same as the topsrc dir and thus we need to detect the gnupg
521 # package and cd to that directory. We also test that no in-source build
522 # has been done. autogen.sh is not run for gnupg.
526 $(stampdir)/stamp-$(1)-00-unpack: $(stampdir)/stamp-directories
528 @echo "speedo: * $(1)"
530 @(set -e; cd $(sdir); \
531 $(call SETVARS,$(1)); \
532 if [ "$(1)" = "gnupg" ]; then \
534 if [ -f config.log ]; then \
535 echo "GnuPG has already been build in-source" >&2 ;\
536 echo "Please run \"make distclean\" and retry" >&2 ;\
539 echo "speedo: unpacking gnupg not needed"; \
540 elif [ -n "$$$${git}" ]; then \
541 echo "speedo: unpacking $(1) from $$$${git}:$$$${gitref}"; \
542 git clone -b "$$$${gitref}" "$$$${git}" "$$$${pkg}"; \
544 AUTOGEN_SH_SILENT=1 ./autogen.sh; \
545 elif [ -n "$$$${tar}" ]; then \
546 echo "speedo: unpacking $(1) from $$$${tar}"; \
547 case "$$$${tar}" in \
553 case "$$$${tar}" in \
555 *) cmd="wget -q -O -" ;; \
557 $$$${cmd} "$$$${tar}" | tar x$$$${opt}f - ; \
558 base=`echo "$$$${tar}" | sed -e 's,^.*/,,' \
559 | sed -e 's,\.tar.*$$$$,,'`; \
560 mv $$$${base} $(1); \
561 patch="$(patdir)/$(1)-$$$${base#$(1)-}.patch";\
562 if [ -x "$$$${patch}" ]; then \
563 echo "speedo: applying patch $$$${patch}"; \
564 cd $(1); "$$$${patch}"; \
565 elif [ -f "$$$${patch}" ]; then \
566 echo "speedo: warning: $$$${patch} is not executable"; \
569 echo "speedo: unpacking $(1) from UNKNOWN"; \
571 @touch $(stampdir)/stamp-$(1)-00-unpack
573 $(stampdir)/stamp-$(1)-01-configure: $(stampdir)/stamp-$(1)-00-unpack
574 @echo "speedo: configuring $(1)"
575 ifneq ($(findstring $(1),$(speedo_make_only_style)),)
576 @echo "speedo: configure run not required"
577 else ifneq ($(findstring $(1),$(speedo_gnupg_style)),)
578 @($(call SETVARS,$(1)); \
579 mkdir "$$$${pkgbdir}"; \
580 cd "$$$${pkgbdir}"; \
581 if [ -n "$(speedo_autogen_buildopt)" ]; then \
582 eval AUTOGEN_SH_SILENT=1 w32root="$(idir)" \
583 "$$$${pkgsdir}/autogen.sh" \
584 $(speedo_autogen_buildopt) \
586 CFLAGS=\"$(speedo_w32_cflags) $$$${pkgextracflags}\";\
588 eval "$$$${pkgsdir}/configure" \
590 --enable-maintainer-mode \
593 CFLAGS=\"$(speedo_w32_cflags) $$$${pkgextracflags}\";\
596 @($(call SETVARS,$(1)); \
597 mkdir "$$$${pkgbdir}"; \
598 cd "$$$${pkgbdir}"; \
599 eval "$$$${pkgsdir}/configure" \
600 --silent $(speedo_host_build_option) \
603 CFLAGS=\"$(speedo_w32_cflags) $$$${pkgextracflags}\";\
606 @touch $(stampdir)/stamp-$(1)-01-configure
608 # Note that unpack has no 64 bit version becuase it is just the source.
609 # Fixme: We should use templates to create the standard and w64
610 # version of these rules.
611 $(stampdir)/stamp-w64-$(1)-01-configure: $(stampdir)/stamp-$(1)-00-unpack
612 @echo "speedo: configuring $(1) (64 bit)"
613 ifneq ($(findstring $(1),$(speedo_make_only_style)),)
614 @echo "speedo: configure run not required"
615 else ifneq ($(findstring $(1),$(speedo_gnupg_style)),)
616 @($(call SETVARS_W64,$(1)); \
617 mkdir "$$$${pkgbdir}"; \
618 cd "$$$${pkgbdir}"; \
619 if [ -n "$(speedo_autogen_buildopt)" ]; then \
620 eval AUTOGEN_SH_SILENT=1 w64root="$(idir6)" \
621 "$$$${pkgsdir}/autogen.sh" \
622 $(speedo_autogen_buildopt6) \
624 CFLAGS=\"$(speedo_w32_cflags) $$$${pkgextracflags}\";\
626 eval "$$$${pkgsdir}/configure" \
628 --enable-maintainer-mode \
629 --prefix="$(idir6)" \
631 CFLAGS=\"$(speedo_w32_cflags) $$$${pkgextracflags}\";\
634 @($(call SETVARS_W64,$(1)); \
635 mkdir "$$$${pkgbdir}"; \
636 cd "$$$${pkgbdir}"; \
637 eval "$$$${pkgsdir}/configure" \
638 --silent $(speedo_host_build_option6) \
639 --prefix="$(idir6)" \
641 CFLAGS=\"$(speedo_w32_cflags) $$$${pkgextracflags}\";\
644 @touch $(stampdir)/stamp-w64-$(1)-01-configure
647 $(stampdir)/stamp-$(1)-02-make: $(stampdir)/stamp-$(1)-01-configure
648 @echo "speedo: making $(1)"
649 ifneq ($(findstring $(1),$(speedo_make_only_style)),)
650 @($(call SETVARS,$(1)); \
651 cd "$$$${pkgsdir}"; \
652 test -n "$$$${pkgmkdir}" && cd "$$$${pkgmkdir}"; \
653 $(MAKE) --no-print-directory $(speedo_makeopt) $$$${pkgmkargs} V=0)
655 @($(call SETVARS,$(1)); \
656 cd "$$$${pkgbdir}"; \
657 test -n "$$$${pkgmkdir}" && cd "$$$${pkgmkdir}"; \
658 $(MAKE) --no-print-directory $(speedo_makeopt) $$$${pkgmkargs} V=1)
660 @touch $(stampdir)/stamp-$(1)-02-make
662 $(stampdir)/stamp-w64-$(1)-02-make: $(stampdir)/stamp-w64-$(1)-01-configure
663 @echo "speedo: making $(1) (64 bit)"
664 ifneq ($(findstring $(1),$(speedo_make_only_style)),)
665 @($(call SETVARS_W64,$(1)); \
666 cd "$$$${pkgsdir}"; \
667 test -n "$$$${pkgmkdir}" && cd "$$$${pkgmkdir}"; \
668 $(MAKE) --no-print-directory $(speedo_makeopt) $$$${pkgmkargs} V=0)
670 @($(call SETVARS_W64,$(1)); \
671 cd "$$$${pkgbdir}"; \
672 test -n "$$$${pkgmkdir}" && cd "$$$${pkgmkdir}"; \
673 $(MAKE) --no-print-directory $(speedo_makeopt) $$$${pkgmkargs} V=1)
675 @touch $(stampdir)/stamp-w64-$(1)-02-make
677 # Note that post_install must come last because it may be empty and
678 # "; ;" is a syntax error.
679 $(stampdir)/stamp-$(1)-03-install: $(stampdir)/stamp-$(1)-02-make
680 @echo "speedo: installing $(1)"
681 ifneq ($(findstring $(1),$(speedo_make_only_style)),)
682 @($(call SETVARS,$(1)); \
683 cd "$$$${pkgsdir}"; \
684 test -n "$$$${pkgmkdir}" && cd "$$$${pkgmkdir}"; \
685 $(MAKE) --no-print-directory $$$${pkgmkargs_inst} install V=1;\
686 $(call speedo_pkg_$(call FROB_macro,$(1))_post_install))
688 @($(call SETVARS,$(1)); \
689 cd "$$$${pkgbdir}"; \
690 test -n "$$$${pkgmkdir}" && cd "$$$${pkgmkdir}"; \
691 $(MAKE) --no-print-directory $$$${pkgmkargs_inst} install-strip V=0;\
692 $(call speedo_pkg_$(call FROB_macro,$(1))_post_install))
694 touch $(stampdir)/stamp-$(1)-03-install
696 $(stampdir)/stamp-w64-$(1)-03-install: $(stampdir)/stamp-w64-$(1)-02-make
697 @echo "speedo: installing $(1) (64 bit)"
698 ifneq ($(findstring $(1),$(speedo_make_only_style)),)
699 @($(call SETVARS_W64,$(1)); \
700 cd "$$$${pkgsdir}"; \
701 test -n "$$$${pkgmkdir}" && cd "$$$${pkgmkdir}"; \
702 $(MAKE) --no-print-directory $$$${pkgmkargs_inst} install V=1;\
703 $(call speedo_pkg_$(call FROB_macro,$(1))_post_install))
705 @($(call SETVARS_W64,$(1)); \
706 cd "$$$${pkgbdir}"; \
707 test -n "$$$${pkgmkdir}" && cd "$$$${pkgmkdir}"; \
708 $(MAKE) --no-print-directory $$$${pkgmkargs_inst} install-strip V=0;\
709 $(call speedo_pkg_$(call FROB_macro,$(1))_post_install))
711 touch $(stampdir)/stamp-w64-$(1)-03-install
713 $(stampdir)/stamp-final-$(1): $(stampdir)/stamp-$(1)-03-install
714 @echo "speedo: $(1) done"
715 @touch $(stampdir)/stamp-final-$(1)
717 $(stampdir)/stamp-w64-final-$(1): $(stampdir)/stamp-w64-$(1)-03-install
718 @echo "speedo: $(1) (64 bit) done"
719 @touch $(stampdir)/stamp-w64-final-$(1)
723 @echo "speedo: uninstalling $(1)"
724 @($(call SETVARS,$(1)); \
725 (cd "$$$${pkgbdir}" 2>/dev/null && \
726 $(MAKE) --no-print-directory \
727 $$$${pkgmkargs_inst} uninstall V=0 ) || true;\
728 rm -fR "$$$${pkgsdir}" "$$$${pkgbdir}" || true)
729 -rm -f $(stampdir)/stamp-final-$(1) $(stampdir)/stamp-$(1)-*
733 build-$(1): $(stampdir)/stamp-final-$(1)
738 @($(call SETVARS,$(1)); \
740 if [ -n "$$$${git}" ]; then \
741 if [ -e "$$$${pkgsdir}/.git" ]; then \
742 cd "$$$${pkgsdir}" && \
747 elif [ -n "$$$${tar}" ]; then \
748 base=`echo "$$$${tar}" | sed -e 's,^.*/,,' \
749 | sed -e 's,\.tar.*$$$$,,'`; \
756 # Insert the template for each source package.
757 $(foreach spkg, $(speedo_spkgs), $(eval $(call SPKG_template,$(spkg))))
759 $(stampdir)/stamp-final: $(stampdir)/stamp-directories
760 ifeq ($(TARGETOS),w32)
761 $(stampdir)/stamp-final: $(addprefix $(stampdir)/stamp-w64-final-,$(speedo_w64_build_list))
763 $(stampdir)/stamp-final: $(addprefix $(stampdir)/stamp-final-,$(speedo_build_list))
764 touch $(stampdir)/stamp-final
766 all-speedo: $(stampdir)/stamp-final
768 report-speedo: $(addprefix report-,$(speedo_build_list))
770 # Just to check if we catched all stamps.
772 $(RM) -fR $(stampdir)
783 for i in 00 01 02 03; do sleep 1;touch PLAY/stamps/stamp-*-${i}-*;done
785 tarname="gnupg-w32-$(INST_VERSION)_$(BUILD_ISODATE).tar" ;\
786 [ -f "$$tarname" ] && rm "$$tarname" ;\
787 tar -C $(topsrc) -cf "$$tarname" --exclude-backups --exclude-vc \
788 --anchored --exclude './PLAY' . ;\
789 tar --totals -rf "$$tarname" --exclude-backups --exclude-vc \
790 PLAY/stamps/stamp-*-00-unpack PLAY/src ;\
795 $(bdir)/NEWS.tmp: $(topsrc)/NEWS
796 sed -e '/^#/d' <$(topsrc)/NEWS >$(bdir)/NEWS.tmp
798 $(bdir)/README.txt: $(bdir)/NEWS.tmp $(w32src)/README.txt \
799 $(w32src)/pkg-copyright.txt
801 -e '/!NEWSFILE!/{r NEWS.tmp' -e 'd;}' \
802 -e '/!PKG-COPYRIGHT!/{r $(w32src)/pkg-copyright.txt' -e 'd;}' \
803 -e 's,!VERSION!,$(INST_VERSION),g' \
804 < $(w32src)/README.txt \
805 | awk '{printf "%s\r\n", $$0}' >$(bdir)/README.txt
807 $(bdir)/g4wihelp.dll: $(w32src)/g4wihelp.c $(w32src)/exdll.h
808 (set -e; cd $(bdir); \
809 $(W32CC) -I. -shared -O2 -o g4wihelp.dll $(w32src)/g4wihelp.c \
811 $(STRIP) g4wihelp.dll)
813 w32_insthelpers: $(bdir)/g4wihelp.dll
815 $(bdir)/inst-options.ini: $(w32src)/inst-options.ini
816 cat $(w32src)/inst-options.ini >$(bdir)/inst-options.ini
818 installer: all w32_insthelpers $(bdir)/inst-options.ini $(bdir)/README.txt
821 -DINST6_DIR=$(idir6) \
822 -DBUILD_DIR=$(bdir) \
823 -DTOP_SRCDIR=$(topsrc) \
824 -DW32_SRCDIR=$(w32src) \
825 -DBUILD_ISODATE=$(BUILD_ISODATE) \
826 -DVERSION=$(INST_VERSION) \
827 -DPROD_VERSION=$(INST_PROD_VERSION) \
829 @echo "Ready: $(idir)/gnupg-w32-$(INST_VERSION)"
834 .PHONY: all-speedo report-speedo clean-stamps clean-speedo installer \