ea4afc878e2fa63584ab88fdfeffbb6108e590f4
[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)/common
25
26 include $(top_srcdir)/am/cmacros.am
27
28 # We need KSBA_CFLAGS because that is included by keybox.h.  See also
29 # comments below for libksba.
30 AM_CFLAGS = $(LIBGCRYPT_CFLAGS) $(KSBA_CFLAGS) \
31             $(LIBASSUAN_CFLAGS) $(GPG_ERROR_CFLAGS)
32
33 needed_libs = ../kbx/libkeybox.a $(libcommon)
34
35 bin_PROGRAMS = gpg2
36 if !HAVE_W32CE_SYSTEM
37 bin_PROGRAMS += gpgv2
38 endif
39 noinst_PROGRAMS = $(module_tests)
40 TESTS = $(module_tests)
41
42 if ENABLE_BZIP2_SUPPORT
43 bzip2_source = compress-bz2.c
44 else
45 bzip2_source =
46 endif
47
48 if ENABLE_CARD_SUPPORT
49 card_source = card-util.c
50 else
51 card_source =
52 endif
53
54 if NO_TRUST_MODELS
55 trust_source =
56 else
57 trust_source = trustdb.c trustdb.h tdbdump.c tdbio.c tdbio.h
58 endif
59
60
61 if HAVE_W32_SYSTEM
62 resource_objs += gpg-w32info.o
63
64 gpg-w32info.o : gpg.w32-manifest
65
66 endif
67
68 common_source =  \
69               gpg.h             \
70               dek.h             \
71               build-packet.c    \
72               compress.c        \
73               $(bzip2_source)   \
74               filter.h          \
75               free-packet.c     \
76               getkey.c          \
77               keydb.c keydb.h    \
78               keyring.c keyring.h \
79               seskey.c          \
80               kbnode.c          \
81               main.h            \
82               mainproc.c        \
83               armor.c           \
84               mdfilter.c        \
85               textfilter.c      \
86               progress.c        \
87               misc.c            \
88               rmd160.c rmd160.h \
89               options.h         \
90               openfile.c        \
91               keyid.c           \
92               packet.h          \
93               parse-packet.c    \
94               cpr.c             \
95               plaintext.c       \
96               sig-check.c       \
97               keylist.c         \
98               pkglue.c pkglue.h \
99               ecdh.c
100
101 gpg2_SOURCES  = gpg.c           \
102               server.c          \
103               $(common_source)  \
104               pkclist.c         \
105               skclist.c         \
106               pubkey-enc.c      \
107               passphrase.c      \
108               decrypt.c         \
109               decrypt-data.c    \
110               cipher.c          \
111               encrypt.c         \
112               sign.c            \
113               verify.c          \
114               revoke.c          \
115               keyedit.c         \
116               dearmor.c         \
117               import.c          \
118               export.c          \
119               migrate.c         \
120               delkey.c          \
121               keygen.c          \
122               helptext.c        \
123               keyserver.c       \
124               keyserver-internal.h \
125               call-dirmngr.c call-dirmngr.h \
126               photoid.c photoid.h \
127               call-agent.c call-agent.h \
128               trust.c $(trust_source) \
129               $(card_source) \
130               exec.c exec.h
131
132 gpgv2_SOURCES = gpgv.c           \
133               $(common_source)  \
134               verify.c
135
136 #gpgd_SOURCES = gpgd.c \
137 #              ks-proto.h \
138 #              ks-proto.c \
139 #              ks-db.c \
140 #              ks-db.h \
141 #              $(common_source)
142
143 # FIXME: Libkeybox.a links to libksba thus we need to add libksba
144 # here, even that it is not used by gpg.  A proper solution would
145 # either to split up libkeybox.a or to use a separate keybox daemon.
146 LDADD =  $(needed_libs) ../common/libgpgrl.a \
147          $(ZLIBS) $(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
159 t_rmd160_SOURCES = t-rmd160.c rmd160.c
160 t_rmd160_LDADD = $(t_common_ldadd)
161
162
163 $(PROGRAMS): $(needed_libs) ../common/libgpgrl.a
164
165 install-data-local:
166         $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)
167         $(INSTALL_DATA) $(srcdir)/options.skel \
168                                 $(DESTDIR)$(pkgdatadir)/gpg-conf.skel
169         $(INSTALL_DATA) $(srcdir)/distsigkey.gpg \
170                                 $(DESTDIR)$(pkgdatadir)/distsigkey.gpg
171
172 uninstall-local:
173         -@rm $(DESTDIR)$(pkgdatadir)/gpg-conf.skel
174         -@rm $(DESTDIR)$(pkgdatadir)/distsigkey.gpg
175
176
177 # There has never been a gpg for WindowsCE, thus we don't need a gpg2 here
178 if HAVE_W32CE_SYSTEM
179 install-exec-hook:
180         mv -f $(DESTDIR)$(bindir)/gpg2$(EXEEXT) \
181               $(DESTDIR)$(bindir)/gpg$(EXEEXT)
182 endif