1 # Makefile.am - main makefile for GnuPG
2 # Copyright (C) 2001, 2004, 2010 Free Software Foundation, Inc.
4 # This file is part of GnuPG.
6 # GnuPG is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 3 of the License, or
9 # (at your option) any later version.
11 # GnuPG is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, see <https://www.gnu.org/licenses/>.
19 ## Process this file with automake to produce Makefile.in
21 # To include the wixlibs for building an MSI installer in a release use
22 # make release WITH_MSI=1
24 # Location of the released tarball archives. This is prefixed by
25 # the variable RELEASE_ARCHIVE in ~/.gnupg-autogen.rc. For example:
26 # RELEASE_ARCHIVE=user@host:archive/tarballs
27 RELEASE_ARCHIVE_SUFFIX = gnupg/v2.4
28 # The variable RELEASE_SIGNKEY in ~/.gnupg-autogen.rc is used
29 # to specify the key for signing. For example:
30 # RELEASE_SIGNKEY=D8692123C4065DEA5E0F3AB5249B39D24F25E3B6
34 ACLOCAL_AMFLAGS = -I m4
35 AM_DISTCHECK_DVI_TARGET = pdf
36 AM_DISTCHECK_CONFIGURE_FLAGS = --enable-gnupg-builddir-envvar \
37 --enable-all-tests --enable-g13 \
38 --enable-gpgtar --enable-wks-tools --disable-ntbtls
40 GITLOG_TO_CHANGELOG=gitlog-to-changelog
42 EXTRA_DIST = build-aux/config.rpath build-aux/potomo autogen.sh autogen.rc \
43 ChangeLog-2011 po/ChangeLog-2011 build-aux/ChangeLog-2011 \
44 VERSION README.GIT build-aux/gitlog-to-changelog \
45 COPYING.GPL2 COPYING.LGPL21 COPYING.LGPL3 \
46 COPYING.CC0 COPYING.other \
47 build-aux/git-log-fix build-aux/git-log-footer \
48 build-aux/getswdb.sh \
50 build-aux/speedo/zlib.pc \
51 build-aux/speedo/w32/inst-options.ini \
52 build-aux/speedo/w32/inst.nsi \
53 build-aux/speedo/w32/pkg-copyright.txt \
54 build-aux/speedo/w32/g4wihelp.c \
55 build-aux/speedo/w32/pango.modules \
56 build-aux/speedo/w32/gdk-pixbuf-loaders.cache \
57 build-aux/speedo/w32/exdll.h \
58 build-aux/speedo/w32/README.txt \
59 build-aux/speedo/w32/gnupg-logo-150x57.bmp \
60 build-aux/speedo/w32/gnupg-logo-164x314.bmp \
61 build-aux/speedo/w32/wixlib.wxs \
62 build-aux/speedo/patches/atk-1.32.0.patch \
63 build-aux/speedo/patches/libiconv-1.14.patch \
64 build-aux/speedo/patches/pango-1.29.4.patch \
65 build-aux/speedo/patches/sqlite.patch
68 DISTCLEANFILES = g10defs.h
116 SUBDIRS = m4 common regexp kbx \
117 ${gpg} ${sm} ${agent} ${scd} ${g13} ${dirmngr} \
118 tools po ${doc} ${tests} ${tpm2d}
120 dist_doc_DATA = README
123 # Create test directory etc/gnupg so that we have an
124 # empty sysconfdir and bin where we put out gpgconf.ctl.
125 # we also put symlinks to the actual binaries there.
126 # Unfortunately there is no all-hook, but symlinks have the
127 # nice property that they can be created even for not yet
130 @-$(MKDIR_P) bin etc/gnupg libexec
131 @cat $(srcdir)/tests/gpgconf.ctl.in > bin/gpgconf.ctl
134 do ln -sf ../g10/$$i$(EXEEXT) .; done; \
136 do ln -sf ../sm/$$i$(EXEEXT) .; done; \
137 for i in gpg-agent; \
138 do ln -sf ../agent/$$i$(EXEEXT) .; done; \
140 do ln -sf ../dirmngr/$$i$(EXEEXT) .; done; \
141 for i in gpgconf gpg-connect-agent gpgtar gpg-card; \
142 do ln -sf ../tools/$$i$(EXEEXT) .; done; \
145 do ln -sf ../kbx/$$i$(EXEEXT) .; done; \
147 do ln -sf ../scd/$$i$(EXEEXT) .; done; \
148 for i in gpg-preset-passphrase; \
149 do ln -sf ../agent/$$i$(EXEEXT) .; done; \
150 for i in tpm2daemon; \
151 do [ -f ../tpm2d/$$i$(EXEEXT) ] && ln -sf ../tpm2d/$$i$(EXEEXT) .; done; \
152 echo "created links to binaries" )
155 # Clean up our test directories but take care that this is never
156 # called from / or /usr/local
158 @if pwd | grep gnupg 2>/dev/null; then rm -rf etc bin libexec; fi
161 dist-hook: gen-ChangeLog
165 pref="#+macro: gnupg24_" ;\
166 reldate="$$(date -u +%Y-%m-%d)" ;\
167 echo "$${pref}ver $(PACKAGE_VERSION)" ;\
168 echo "$${pref}date $${reldate}" ;\
169 list='$(DIST_ARCHIVES)'; for i in $$list; do \
170 case "$$i" in *.tar.bz2) \
171 echo "$${pref}size $$(wc -c <$$i|awk '{print int($$1/1024)}')k" ;\
172 echo "$${pref}sha1 $$(sha1sum <$$i|cut -d' ' -f1)" ;\
173 echo "$${pref}sha2 $$(sha256sum <$$i|cut -d' ' -f1)" ;;\
175 done ) | tee $(distdir).swdb
181 for i in $$($(top_srcdir)/build-aux/potomo \
182 --get-linguas $(top_srcdir)/po) ; do \
183 $(MKDIR_P) "$(DESTDIR)$(localedir)/$$i/LC_MESSAGES" || true; \
184 rm -f "$(DESTDIR)$(localedir)/$$i/LC_MESSAGES/gnupg2.mo" \
185 2>/dev/null || true; \
186 $(top_srcdir)/build-aux/potomo $(top_srcdir)/po/$$i.po \
187 "$(DESTDIR)$(localedir)/$$i/LC_MESSAGES/gnupg2.mo" ; \
192 gen_start_date = 2011-12-01T06:00:00
193 .PHONY: gen-ChangeLog
195 if test -e $(top_srcdir)/.git; then \
196 (cd $(top_srcdir) && \
197 $(GITLOG_TO_CHANGELOG) --append-dot --tear-off \
198 --amend=build-aux/git-log-fix \
199 --since=$(gen_start_date) ) > $(distdir)/cl-t; \
200 cat $(top_srcdir)/build-aux/git-log-footer >> $(distdir)/cl-t; \
201 rm -f $(distdir)/ChangeLog; \
202 mv $(distdir)/cl-t $(distdir)/ChangeLog; \
207 $(MAKE) $(AM_MAKEFLAGS) install prefix=/usr/local/stow/gnupg
209 TESTS_ENVIRONMENT = \
212 PATH=$(abs_top_builddir)/tests/gpgscm:$(PATH) \
213 abs_top_srcdir=$(abs_top_srcdir) \
214 objdir=$(abs_top_builddir) \
215 GNUPG_BUILD_ROOT="$(abs_top_builddir)" \
216 GNUPG_IN_TEST_SUITE=fact \
217 GPGSCM_PATH=$(abs_top_srcdir)/tests/gpgscm
219 .PHONY: check-all release sign-release
221 $(TESTS_ENVIRONMENT) \
222 $(abs_top_builddir)/tests/gpgscm/gpgscm$(EXEEXT) \
223 $(abs_srcdir)/tests/run-tests.scm $(TESTFLAGS) $(TESTS)
225 # Names of to help the release target.
226 RELEASE_NAME = $(PACKAGE_TARNAME)-$(PACKAGE_VERSION)
227 RELEASE_W32_STEM_NAME = $(PACKAGE_TARNAME)-w32-$(PACKAGE_VERSION)
231 if [ "$(abs_top_builddir)" = "$(abs_top_srcdir)" ]; then \
232 echo "error: build directory must not be the source directory" >&2;\
235 echo "/* Build started at $$(date -uIseconds) */" ;\
236 [ -n "$(WITH_MSI)" ] && echo "/* (with MSI build support) */" ;\
238 ./autogen.sh --force; \
239 cd $(abs_top_builddir); \
240 rm -rf dist; mkdir dist ; cd dist ; \
242 if [ -n "$$CUSTOM_SWDB" ]; then \
243 mkopt="CUSTOM_SWB=1"; \
244 x=$$(grep '^OVERRIDE_TARBALLS=' \
245 $$HOME/.gnupg-autogen.rc|cut -d= -f2);\
246 if [ -f "$$x/swdb.lst" ]; then \
247 echo "/* Copying swdb.lst from the overrides directory */"; \
248 cp "$$x/swdb.lst" . ; \
249 cp "$$x/swdb.lst.sig" . ; \
252 echo "/* Running configure */";\
253 $(abs_top_srcdir)/configure --enable-maintainer-mode; \
254 echo "/* Running make distcheck */";\
255 $(MAKE) distcheck TESTFLAGS=--parallel; \
256 echo "/* Unpacking release */";\
257 $(AMTAR) xjf $(RELEASE_NAME).tar.bz2 ;\
258 target=w32-release ;\
259 [ -n "$(WITH_MSI)" ] && target=w32-msi-release ;\
260 echo "/* Running $(MAKE) -f $(RELEASE_NAME)/build-aux/speedo.mk $${target} */";\
261 $(MAKE) -f $(RELEASE_NAME)/build-aux/speedo.mk $${target} ;\
262 echo "/* Build finished at $$(date -uIseconds) */" ;\
264 echo " * Please run the final step interactively:" ;\
265 echo " * make sign-release $${WITH_MSI:+WITH_MSI=1}" ;\
267 ) 2>&1 | tee "$(RELEASE_NAME).buildlog"
271 test $$(pwd | sed 's,.*/,,') = dist || cd dist; \
272 x=$$(grep '^RELEASE_ARCHIVE=' $$HOME/.gnupg-autogen.rc|cut -d= -f2);\
273 if [ -z "$$x" ]; then \
274 echo "error: RELEASE_ARCHIVE missing in ~/.gnupg-autogen.rc">&2; \
277 myarchive="$$x/$(RELEASE_ARCHIVE_SUFFIX)";\
278 x=$$(grep '^RELEASE_SIGNKEY=' $$HOME/.gnupg-autogen.rc|cut -d= -f2);\
279 if [ -z "$$x" ]; then \
280 echo "error: RELEASE_SIGNKEY missing in ~/.gnupg-autogen.rc">&2; \
284 release_w32_name="$(RELEASE_W32_STEM_NAME)_$$(date -u +%Y%m%d)" ;\
285 files1="$(RELEASE_NAME).tar.bz2 \
286 $${release_w32_name}.tar.xz \
287 $${release_w32_name}.exe" ;\
288 files2="$(RELEASE_NAME).tar.bz2.sig \
289 $(RELEASE_NAME).swdb \
290 $(RELEASE_NAME).buildlog \
291 $${release_w32_name}.tar.xz.sig \
292 $${release_w32_name}.exe.sig \
293 $${release_w32_name}.exe.swdb" ;\
294 wixlibfile="$${release_w32_name}.wixlib";\
295 $(MAKE) -f $(RELEASE_NAME)/build-aux/speedo.mk w32-sign-installer ;\
296 echo "/* Signing the source tarball ..." ;\
297 gpg -sbu $$mysignkey $(RELEASE_NAME).tar.bz2 ;\
298 echo "/* Signing the W32 source tarball ..." ;\
299 gpg -sbu $$mysignkey $${release_w32_name}.tar.xz ;\
300 echo "/* Signing the W32 installer ..." ;\
301 gpg -sbu $$mysignkey $${release_w32_name}.exe ;\
302 if [ -e $${wixlibfile} ]; then \
303 echo "/* Signing the Wixlib ..." ;\
304 gpg -sbu $$mysignkey $${wixlibfile} ;\
306 cat $(RELEASE_NAME).swdb >swdb.snippet;\
307 echo '#+macro: gnupg24_branch STABLE-BRANCH-2-4' >>swdb.snippet;\
308 cat $${release_w32_name}.exe.swdb >>swdb.snippet;\
309 echo >>swdb.snippet ;\
310 sha1sum $${files1} >>swdb.snippet ;\
311 cat "../$(RELEASE_NAME).buildlog" swdb.snippet \
312 | gzip >$(RELEASE_NAME).buildlog ;\
313 echo "Release created - copying it to the archive ..." ;\
314 scp -p $${files1} $${files2} $$myarchive/ \
315 || echo "/* Error copying files to the archive - ignored */" ;\
316 if [ -e $${wixlibfile} ]; then\
317 scp -p $${wixlibfile} $${wixlibfile}.sig $$myarchive/ \
318 || echo "/* Error copying wixlib to the archive - ignored. */" ;\
321 echo ' * All done; for checksums see dist/swdb.snippet' ;\