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