gpg: Add function to extract the mailbox.
[gnupg.git] / g10 / Makefile.am
1 # Copyright (C) 1998, 1999, 2000, 2001, 2002,
2 #               2003, 2006, 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 <http://www.gnu.org/licenses/>.
18
19 ## Process this file with automake to produce Makefile.in
20
21 EXTRA_DIST = options.skel distsigkey.gpg ChangeLog-2011 gpg-w32info.rc \
22              gpg.w32-manifest.in
23
24 AM_CPPFLAGS = -I$(top_srcdir)/gl -I$(top_srcdir)/common \
25               -I$(top_srcdir)/include -I$(top_srcdir)/intl
26
27 include $(top_srcdir)/am/cmacros.am
28
29 AM_CFLAGS = $(LIBGCRYPT_CFLAGS) $(LIBASSUAN_CFLAGS) $(GPG_ERROR_CFLAGS)
30
31 needed_libs = ../kbx/libkeybox.a $(libcommon)
32
33 bin_PROGRAMS = gpg2
34 if !HAVE_W32CE_SYSTEM
35 bin_PROGRAMS += gpgv2
36 endif
37 noinst_PROGRAMS = $(module_tests)
38 TESTS = $(module_tests)
39
40 if ENABLE_BZIP2_SUPPORT
41 bzip2_source = compress-bz2.c
42 else
43 bzip2_source =
44 endif
45
46 if ENABLE_CARD_SUPPORT
47 card_source = card-util.c
48 else
49 card_source =
50 endif
51
52 if NO_TRUST_MODELS
53 trust_source =
54 else
55 trust_source = trustdb.c trustdb.h tdbdump.c tdbio.c tdbio.h
56 endif
57
58
59 if HAVE_W32_SYSTEM
60 resource_objs += gpg-w32info.o
61
62 gpg-w32info.o : gpg.w32-manifest
63
64 endif
65
66 common_source =  \
67               gpg.h             \
68               dek.h             \
69               build-packet.c    \
70               compress.c        \
71               $(bzip2_source)   \
72               filter.h          \
73               free-packet.c     \
74               getkey.c          \
75               keydb.c keydb.h    \
76               keyring.c keyring.h \
77               seskey.c          \
78               kbnode.c          \
79               main.h            \
80               mainproc.c        \
81               armor.c           \
82               mdfilter.c        \
83               textfilter.c      \
84               progress.c        \
85               misc.c            \
86               mailbox.c         \
87               rmd160.c rmd160.h \
88               options.h         \
89               openfile.c        \
90               keyid.c           \
91               packet.h          \
92               parse-packet.c    \
93               cpr.c             \
94               plaintext.c       \
95               sig-check.c       \
96               keylist.c         \
97               pkglue.c pkglue.h \
98               ecdh.c
99
100 gpg2_SOURCES  = gpg.c           \
101               server.c          \
102               $(common_source)  \
103               pkclist.c         \
104               skclist.c         \
105               pubkey-enc.c      \
106               passphrase.c      \
107               decrypt.c         \
108               decrypt-data.c    \
109               cipher.c          \
110               encrypt.c         \
111               sign.c            \
112               verify.c          \
113               revoke.c          \
114               keyedit.c         \
115               dearmor.c         \
116               import.c          \
117               export.c          \
118               migrate.c         \
119               delkey.c          \
120               keygen.c          \
121               helptext.c        \
122               keyserver.c       \
123               keyserver-internal.h \
124               call-dirmngr.c call-dirmngr.h \
125               photoid.c photoid.h \
126               call-agent.c call-agent.h \
127               trust.c $(trust_source) \
128               $(card_source) \
129               exec.c exec.h
130
131 gpgv2_SOURCES = gpgv.c           \
132               $(common_source)  \
133               verify.c
134
135 #gpgd_SOURCES = gpgd.c \
136 #              ks-proto.h \
137 #              ks-proto.c \
138 #              ks-db.c \
139 #              ks-db.h \
140 #              $(common_source)
141
142 # FIXME: Libkeybox.a links to libksba thus we need to add libksba
143 # here, even that it is not used by gpg.  A proper solution would
144 # either to split up libkeybox.a or to use a separate keybox daemon.
145 LDADD =  $(needed_libs) ../common/libgpgrl.a \
146          $(ZLIBS) $(DNSLIBS) \
147          $(LIBINTL) $(CAPLIBS) $(NETLIBS)
148 gpg2_LDADD = $(LDADD) $(LIBGCRYPT_LIBS) $(LIBREADLINE) \
149              $(KSBA_LIBS) $(LIBASSUAN_LIBS) $(GPG_ERROR_LIBS) \
150              $(LIBICONV) $(resource_objs) $(extra_sys_libs)
151 gpg2_LDFLAGS = $(extra_bin_ldflags)
152 gpgv2_LDADD = $(LDADD) $(LIBGCRYPT_LIBS) \
153               $(KSBA_LIBS) $(GPG_ERROR_LIBS) \
154               $(LIBICONV) $(resource_objs) $(extra_sys_libs)
155 gpgv2_LDFLAGS = $(extra_bin_ldflags)
156
157 t_common_ldadd =
158 module_tests = t-rmd160 t-mailbox
159 t_rmd160_SOURCES = t-rmd160.c rmd160.c
160 t_rmd160_LDADD = $(t_common_ldadd)
161 t_mailbox_SOURCES = t-mailbox.c mailbox.c
162 t_mailbox_LDADD = $(t_common_ldadd)
163
164
165 $(PROGRAMS): $(needed_libs) ../common/libgpgrl.a
166
167 install-data-local:
168         $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)
169         $(INSTALL_DATA) $(srcdir)/options.skel \
170                                 $(DESTDIR)$(pkgdatadir)/gpg-conf.skel
171         $(INSTALL_DATA) $(srcdir)/distsigkey.gpg \
172                                 $(DESTDIR)$(pkgdatadir)/distsigkey.gpg
173
174 uninstall-local:
175         -@rm $(DESTDIR)$(pkgdatadir)/gpg-conf.skel
176         -@rm $(DESTDIR)$(pkgdatadir)/distsigkey.gpg
177
178
179 # There has never been a gpg for WindowsCE, thus we don't need a gpg2 here
180 if HAVE_W32CE_SYSTEM
181 install-exec-hook:
182         mv -f $(DESTDIR)$(bindir)/gpg2$(EXEEXT) \
183               $(DESTDIR)$(bindir)/gpg$(EXEEXT)
184 endif