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 # We want to also build the wixlib for use by GnuPG Desktop
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/exdll.c \
59 build-aux/speedo/w32/README.txt \
60 build-aux/speedo/w32/gnupg-logo-150x57.bmp \
61 build-aux/speedo/w32/gnupg-logo-164x314.bmp \
62 build-aux/speedo/w32/wixlib.wxs \
63 build-aux/speedo/patches/atk-1.32.0.patch \
64 build-aux/speedo/patches/libiconv-1.14.patch \
65 build-aux/speedo/patches/pango-1.29.4.patch \
66 build-aux/speedo/patches/sqlite.patch
69 DISTCLEANFILES = g10defs.h
117 SUBDIRS = m4 common regexp kbx \
118 ${gpg} ${sm} ${agent} ${scd} ${g13} ${dirmngr} \
119 tools po ${doc} ${tests} ${tpm2d}
121 dist_doc_DATA = README
124 # Create test directory etc/gnupg so that we have an
125 # empty sysconfdir and bin where we put out gpgconf.ctl.
126 # we also put symlinks to the actual binaries there.
127 # Unfortunately there is no all-hook, but symlinks have the
128 # nice property that they can be created even for not yet
131 @-$(MKDIR_P) bin etc/gnupg libexec
132 @cat $(srcdir)/tests/gpgconf.ctl.in > bin/gpgconf.ctl
135 do ln -sf ../g10/$$i$(EXEEXT) .; done; \
137 do ln -sf ../sm/$$i$(EXEEXT) .; done; \
138 for i in gpg-agent; \
139 do ln -sf ../agent/$$i$(EXEEXT) .; done; \
141 do ln -sf ../dirmngr/$$i$(EXEEXT) .; done; \
142 for i in gpgconf gpg-connect-agent gpgtar gpg-card; \
143 do ln -sf ../tools/$$i$(EXEEXT) .; done; \
146 do ln -sf ../kbx/$$i$(EXEEXT) .; done; \
148 do ln -sf ../scd/$$i$(EXEEXT) .; done; \
149 for i in gpg-preset-passphrase; \
150 do ln -sf ../agent/$$i$(EXEEXT) .; done; \
151 for i in tpm2daemon; \
152 do [ -f ../tpm2d/$$i$(EXEEXT) ] && ln -sf ../tpm2d/$$i$(EXEEXT) .; done; \
153 echo "created links to binaries" )
156 # Clean up our test directories but take care that this is never
157 # called from / or /usr/local
159 @if pwd | grep gnupg 2>/dev/null; then rm -rf etc bin libexec; fi
162 dist-hook: gen-ChangeLog
166 pref="#+macro: gnupg24_" ;\
167 reldate="$$(date -u +%Y-%m-%d)" ;\
168 echo "$${pref}ver $(PACKAGE_VERSION)" ;\
169 echo "$${pref}date $${reldate}" ;\
170 list='$(DIST_ARCHIVES)'; for i in $$list; do \
171 case "$$i" in *.tar.bz2) \
172 echo "$${pref}size $$(wc -c <$$i|awk '{print int($$1/1024)}')k" ;\
173 echo "$${pref}sha1 $$(sha1sum <$$i|cut -d' ' -f1)" ;\
174 echo "$${pref}sha2 $$(sha256sum <$$i|cut -d' ' -f1)" ;;\
176 done ) | tee $(distdir).swdb
182 for i in $$($(top_srcdir)/build-aux/potomo \
183 --get-linguas $(top_srcdir)/po) ; do \
184 $(MKDIR_P) "$(DESTDIR)$(localedir)/$$i/LC_MESSAGES" || true; \
185 rm -f "$(DESTDIR)$(localedir)/$$i/LC_MESSAGES/gnupg2.mo" \
186 2>/dev/null || true; \
187 $(top_srcdir)/build-aux/potomo $(top_srcdir)/po/$$i.po \
188 "$(DESTDIR)$(localedir)/$$i/LC_MESSAGES/gnupg2.mo" ; \
193 gen_start_date = 2011-12-01T06:00:00
194 .PHONY: gen-ChangeLog
196 if test -e $(top_srcdir)/.git; then \
197 (cd $(top_srcdir) && \
198 $(GITLOG_TO_CHANGELOG) --append-dot --tear-off \
199 --amend=build-aux/git-log-fix \
200 --since=$(gen_start_date) ) > $(distdir)/cl-t; \
201 cat $(top_srcdir)/build-aux/git-log-footer >> $(distdir)/cl-t; \
202 rm -f $(distdir)/ChangeLog; \
203 mv $(distdir)/cl-t $(distdir)/ChangeLog; \
208 $(MAKE) $(AM_MAKEFLAGS) install prefix=/usr/local/stow/gnupg
210 TESTS_ENVIRONMENT = \
213 PATH=$(abs_top_builddir)/tests/gpgscm:$(PATH) \
214 abs_top_srcdir=$(abs_top_srcdir) \
215 objdir=$(abs_top_builddir) \
216 GNUPG_BUILD_ROOT="$(abs_top_builddir)" \
217 GNUPG_IN_TEST_SUITE=fact \
218 GPGSCM_PATH=$(abs_top_srcdir)/tests/gpgscm
220 .PHONY: check-all release sign-release
222 $(TESTS_ENVIRONMENT) \
223 $(abs_top_builddir)/tests/gpgscm/gpgscm$(EXEEXT) \
224 $(abs_srcdir)/tests/run-tests.scm $(TESTFLAGS) $(TESTS)
226 # Names of to help the release target.
227 RELEASE_NAME = $(PACKAGE_TARNAME)-$(PACKAGE_VERSION)
228 RELEASE_W32_STEM_NAME = $(PACKAGE_TARNAME)-w32-$(PACKAGE_VERSION)
232 if [ "$(abs_top_builddir)" = "$(abs_top_srcdir)" ]; then \
233 echo "error: build directory must not be the source directory" >&2;\
236 echo "/* Build started at $$(date -uIseconds) */" ;\
237 [ -n "$(WITH_MSI)" ] && echo "/* (with MSI build support) */" ;\
239 ./autogen.sh --force; \
240 cd $(abs_top_builddir); \
241 rm -rf dist; mkdir dist ; cd dist ; \
243 if [ -n "$$CUSTOM_SWDB" ]; then \
244 mkopt="CUSTOM_SWB=1"; \
245 x=$$(grep '^OVERRIDE_TARBALLS=' \
246 $$HOME/.gnupg-autogen.rc|cut -d= -f2);\
247 if [ -f "$$x/swdb.lst" ]; then \
248 echo "/* Copying swdb.lst from the overrides directory */"; \
249 cp "$$x/swdb.lst" . ; \
250 cp "$$x/swdb.lst.sig" . ; \
253 echo "/* Running configure */";\
254 $(abs_top_srcdir)/configure --enable-maintainer-mode; \
255 echo "/* Running make distcheck */";\
256 $(MAKE) distcheck TESTFLAGS=--parallel; \
257 echo "/* Unpacking release */";\
258 $(AMTAR) xjf $(RELEASE_NAME).tar.bz2 ;\
259 target=w32-release ;\
260 [ -n "$(WITH_MSI)" ] && target=w32-msi-release ;\
261 echo "/* Running $(MAKE) -f $(RELEASE_NAME)/build-aux/speedo.mk $${target} */";\
262 $(MAKE) -f $(RELEASE_NAME)/build-aux/speedo.mk $${target} ;\
263 echo "/* Build finished at $$(date -uIseconds) */" ;\
265 echo " * Please run the final step interactively:" ;\
266 echo " * make sign-release $${WITH_MSI:+WITH_MSI=1}" ;\
268 ) 2>&1 | tee "$(RELEASE_NAME).buildlog"
272 test $$(pwd | sed 's,.*/,,') = dist || cd dist; \
273 x=$$(grep '^RELEASE_ARCHIVE=' $$HOME/.gnupg-autogen.rc|cut -d= -f2);\
274 if [ -z "$$x" ]; then \
275 echo "error: RELEASE_ARCHIVE missing in ~/.gnupg-autogen.rc">&2; \
278 myarchive="$$x/$(RELEASE_ARCHIVE_SUFFIX)";\
279 x=$$(grep '^RELEASE_SIGNKEY=' $$HOME/.gnupg-autogen.rc|cut -d= -f2);\
280 if [ -z "$$x" ]; then \
281 echo "error: RELEASE_SIGNKEY missing in ~/.gnupg-autogen.rc">&2; \
285 release_w32_name="$(RELEASE_W32_STEM_NAME)_$$(date -u +%Y%m%d)" ;\
286 files1="$(RELEASE_NAME).tar.bz2 \
287 $${release_w32_name}.tar.xz \
288 $${release_w32_name}.exe" ;\
289 files2="$(RELEASE_NAME).tar.bz2.sig \
290 $(RELEASE_NAME).swdb \
291 $(RELEASE_NAME).buildlog \
292 $${release_w32_name}.tar.xz.sig \
293 $${release_w32_name}.exe.sig \
294 $${release_w32_name}.exe.swdb" ;\
295 wixlibfile="$${release_w32_name}.wixlib";\
296 $(MAKE) -f $(RELEASE_NAME)/build-aux/speedo.mk w32-sign-installer ;\
297 echo "/* Signing the source tarball ..." ;\
298 gpg -sbu $$mysignkey $(RELEASE_NAME).tar.bz2 ;\
299 echo "/* Signing the W32 source tarball ..." ;\
300 gpg -sbu $$mysignkey $${release_w32_name}.tar.xz ;\
301 echo "/* Signing the W32 installer ..." ;\
302 gpg -sbu $$mysignkey $${release_w32_name}.exe ;\
303 if [ -e $${wixlibfile} ]; then \
304 echo "/* Signing the Wixlib ..." ;\
305 gpg -sbu $$mysignkey $${wixlibfile} ;\
307 cat $(RELEASE_NAME).swdb >swdb.snippet;\
308 echo '#+macro: gnupg24_branch STABLE-BRANCH-2-4' >>swdb.snippet;\
309 cat $${release_w32_name}.exe.swdb >>swdb.snippet;\
310 echo >>swdb.snippet ;\
311 sha1sum $${files1} >>swdb.snippet ;\
312 cat "../$(RELEASE_NAME).buildlog" swdb.snippet \
313 | gzip >$(RELEASE_NAME).buildlog ;\
314 echo "Release created - copying it to the archive ..." ;\
315 scp -p $${files1} $${files2} $$myarchive/ \
316 || echo "/* Error copying files to the archive - ignored */" ;\
317 if [ -e $${wixlibfile} ]; then\
318 scp -p $${wixlibfile} $${wixlibfile}.sig $$myarchive/ \
319 || echo "/* Error copying wixlib to the archive - ignored. */" ;\
322 echo ' * All done; for checksums see dist/swdb.snippet' ;\