card: Print the keyref also for non-initialized slots.
[gnupg.git] / Makefile.am
1 # Makefile.am - main makefile for GnuPG
2 #       Copyright (C) 2001, 2004, 2010 Free Software Foundation, Inc.
3 #
4 # This file is part of GnuPG.
5 #
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.
10 #
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.
15 #
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/>.
18
19 ## Process this file with automake to produce Makefile.in
20
21 # Location of the released tarball archives.  Note that this is an
22 # internal archive and before uploading this to the public server,
23 # manual tests should be run and the git release tat set and pushed.
24 # Adjust as needed.
25 RELEASE_ARCHIVE_DIR  = wk@vigenere:tarballs/gnupg/v2.2
26
27 # The key used to sign the released sources.  Adjust as needed.
28 RELEASE_SIGNING_KEY  = D8692123C4065DEA5E0F3AB5249B39D24F25E3B6
29
30
31 # Autoconf flags.
32 ACLOCAL_AMFLAGS = -I m4
33 AM_DISTCHECK_CONFIGURE_FLAGS = --enable-gnupg-builddir-envvar \
34   --enable-all-tests --enable-symcryptrun --enable-g13 \
35   --enable-gpgtar --enable-wks-tools --disable-ntbtls
36
37 GITLOG_TO_CHANGELOG=gitlog-to-changelog
38
39 EXTRA_DIST = build-aux/config.rpath build-aux/potomo autogen.sh autogen.rc \
40              ChangeLog-2011 po/ChangeLog-2011 build-aux/ChangeLog-2011     \
41              VERSION README.GIT build-aux/gitlog-to-changelog              \
42              COPYING.GPL2 COPYING.LGPL21 COPYING.LGPL3      \
43              COPYING.CC0 COPYING.other                      \
44              build-aux/git-log-fix build-aux/git-log-footer \
45              build-aux/getswdb.sh                           \
46              build-aux/speedo.mk                            \
47              build-aux/speedo/zlib.pc                       \
48              build-aux/speedo/w32/inst-options.ini          \
49              build-aux/speedo/w32/inst.nsi                  \
50              build-aux/speedo/w32/pkg-copyright.txt         \
51              build-aux/speedo/w32/g4wihelp.c                \
52              build-aux/speedo/w32/pango.modules             \
53              build-aux/speedo/w32/gdk-pixbuf-loaders.cache  \
54              build-aux/speedo/w32/exdll.h                   \
55              build-aux/speedo/w32/README.txt                \
56              build-aux/speedo/w32/gnupg-logo-150x57.bmp     \
57              build-aux/speedo/w32/gnupg-logo-164x314.bmp    \
58              build-aux/speedo/patches/atk-1.32.0.patch      \
59              build-aux/speedo/patches/libiconv-1.14.patch   \
60              build-aux/speedo/patches/pango-1.29.4.patch    \
61              build-aux/speedo/patches/sqlite.patch
62
63
64 DISTCLEANFILES = g10defs.h
65
66 if BUILD_GPG
67 gpg = g10
68 else
69 gpg =
70 endif
71 if BUILD_GPGSM
72 sm = sm
73 else
74 sm =
75 endif
76 if BUILD_AGENT
77 agent = agent
78 else
79 agent =
80 endif
81 if BUILD_SCDAEMON
82 scd = scd
83 else
84 scd =
85 endif
86 if BUILD_G13
87 g13 = g13
88 else
89 g13 =
90 endif
91 if BUILD_DIRMNGR
92 dirmngr = dirmngr
93 else
94 dirmngr =
95 endif
96 if BUILD_DOC
97 doc = doc
98 else
99 doc =
100 endif
101
102 SUBDIRS = m4 common kbx \
103           ${gpg} ${sm} ${agent} ${scd} ${g13} ${dirmngr} \
104           tools po ${doc} tests
105
106 dist_doc_DATA = README
107
108
109 dist-hook: gen-ChangeLog
110
111 distcheck-hook:
112         set -e; ( \
113         pref="#+macro: gnupg22_" ;\
114         reldate="$$(date -u +%Y-%m-%d)" ;\
115         echo "$${pref}ver  $(PACKAGE_VERSION)"  ;\
116         echo "$${pref}date $${reldate}" ;\
117         list='$(DIST_ARCHIVES)'; for i in $$list; do \
118           case "$$i" in *.tar.bz2) \
119             echo "$${pref}size $$(wc -c <$$i|awk '{print int($$1/1024)}')k" ;\
120             echo "$${pref}sha1 $$(sha1sum <$$i|cut -d' ' -f1)" ;\
121             echo "$${pref}sha2 $$(sha256sum <$$i|cut -d' ' -f1)" ;;\
122           esac;\
123         done ) | tee $(distdir).swdb
124
125
126 if HAVE_W32_SYSTEM
127 install-data-hook:
128         set -e; \
129         for i in $$($(top_srcdir)/build-aux/potomo \
130                      --get-linguas $(top_srcdir)/po) ; do \
131            $(MKDIR_P) "$(DESTDIR)$(localedir)/$$i/LC_MESSAGES" || true; \
132            rm -f "$(DESTDIR)$(localedir)/$$i/LC_MESSAGES/gnupg2.mo" \
133                                                  2>/dev/null || true; \
134            $(top_srcdir)/build-aux/potomo $(top_srcdir)/po/$$i.po \
135               "$(DESTDIR)$(localedir)/$$i/LC_MESSAGES/gnupg2.mo" ; \
136         done
137 endif
138
139
140 gen_start_date = 2011-12-01T06:00:00
141 .PHONY: gen-ChangeLog
142 gen-ChangeLog:
143         if test -e $(top_srcdir)/.git; then                             \
144           (cd $(top_srcdir) &&                                          \
145             $(GITLOG_TO_CHANGELOG) --append-dot --tear-off              \
146             --amend=build-aux/git-log-fix                               \
147             --since=$(gen_start_date) ) > $(distdir)/cl-t;              \
148           cat $(top_srcdir)/build-aux/git-log-footer >> $(distdir)/cl-t;  \
149           rm -f $(distdir)/ChangeLog;                                   \
150           mv $(distdir)/cl-t $(distdir)/ChangeLog;                      \
151         fi
152
153
154 stowinstall:
155         $(MAKE) $(AM_MAKEFLAGS) install prefix=/usr/local/stow/gnupg
156
157 TESTS_ENVIRONMENT = \
158         LC_ALL=C \
159         EXEEXT=$(EXEEXT) \
160         PATH=$(abs_top_builddir)/tests/gpgscm:$(PATH) \
161         abs_top_srcdir=$(abs_top_srcdir) \
162         objdir=$(abs_top_builddir) \
163         GPGSCM_PATH=$(abs_top_srcdir)/tests/gpgscm
164
165 .PHONY: check-all release sign-release
166 check-all:
167         $(TESTS_ENVIRONMENT) \
168           $(abs_top_builddir)/tests/gpgscm/gpgscm \
169           $(abs_srcdir)/tests/run-tests.scm $(TESTFLAGS) $(TESTS)
170
171 # Names of to help the release target.
172 RELEASE_NAME = $(PACKAGE_TARNAME)-$(PACKAGE_VERSION)
173 RELEASE_W32_STEM_NAME = $(PACKAGE_TARNAME)-w32-$(PACKAGE_VERSION)
174
175 release:
176         +(set -e;\
177          if [ "$(abs_top_builddir)" = "$(abs_top_srcdir)" ]; then \
178            echo "error: build directory must not be the source directory" >&2;\
179            exit 2;\
180          fi ;\
181          echo "/* Build started at $$(date -uIseconds) */" ;\
182          cd $(top_srcdir); \
183          ./autogen.sh --force; \
184          cd $(abs_top_builddir); \
185          rm -rf dist; mkdir dist ; cd dist ; \
186          $(abs_top_srcdir)/configure --enable-maintainer-mode; \
187          $(MAKE) distcheck TESTFLAGS=--parallel; \
188          $(TAR) xjf $(RELEASE_NAME).tar.bz2 ;\
189          $(MAKE) -f  $(RELEASE_NAME)/build-aux/speedo.mk w32-release ;\
190          echo "/* Build finished at $$(date -uIseconds) */" ;\
191          echo "/*" ;\
192          echo " * Please run the final step interactively:" ;\
193          echo " *   make sign-release" ;\
194          echo " */" ;\
195         ) 2>&1 | tee "$(RELEASE_NAME).buildlog"
196
197 sign-release:
198          +(set -e; \
199           cd dist; \
200           release_w32_name="$(RELEASE_W32_STEM_NAME)_$$(date -u +%Y%m%d)" ;\
201           files1="$(RELEASE_NAME).tar.bz2 \
202                   $${release_w32_name}.tar.xz \
203                   $${release_w32_name}.exe" ;\
204           files2="$(RELEASE_NAME).tar.bz2.sig \
205                   $(RELEASE_NAME).swdb \
206                   $(RELEASE_NAME).buildlog \
207                   $${release_w32_name}.tar.xz.sig \
208                   $${release_w32_name}.exe.sig    \
209                   $${release_w32_name}.exe.swdb" ;\
210           $(MAKE) -f $(RELEASE_NAME)/build-aux/speedo.mk w32-sign-installer ;\
211           echo "/* Signing the source tarball ..." ;\
212           gpg -sbu $(RELEASE_SIGNING_KEY) $(RELEASE_NAME).tar.bz2 ;\
213           echo "/* Signing the W32 source tarball ..." ;\
214           gpg -sbu $(RELEASE_SIGNING_KEY) $${release_w32_name}.tar.xz ;\
215           echo "/* Signing the W32 installer ..." ;\
216           gpg -sbu $(RELEASE_SIGNING_KEY) $${release_w32_name}.exe ;\
217           cat $(RELEASE_NAME).swdb >swdb.snippet;\
218           echo '#+macro: gnupg22_branch  STABLE-BRANCH-2-2' >>swdb.snippet;\
219           cat  $${release_w32_name}.exe.swdb >>swdb.snippet;\
220           echo >>swdb.snippet ;\
221           sha1sum $${files1} >>swdb.snippet ;\
222           cat "../$(RELEASE_NAME).buildlog" swdb.snippet \
223                | gzip >$(RELEASE_NAME).buildlog ;\
224           echo "Release created - copying it to the local archive ..." ;\
225           scp -p $${files1} $${files2} $(RELEASE_ARCHIVE_DIR)/ || true;\
226           echo '/*' ;\
227           echo ' * All done; for checksums see dist/swdb.snippet' ;\
228           echo ' */' ;\
229          )