gpg: Add new program gpgcompose.
[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              t-keydb-get-keyblock.gpg
25
26 AM_CPPFLAGS = -I$(top_srcdir)/common
27
28 include $(top_srcdir)/am/cmacros.am
29
30 AM_CFLAGS = $(SQLITE3_CFLAGS) $(LIBGCRYPT_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 = gpgcompose $(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 if USE_TOFU
61 tofu_source = tofu.h tofu.c sqlite.c sqlite.h
62 else
63 tofu_source =
64 endif
65
66
67 if HAVE_W32_SYSTEM
68 resource_objs += gpg-w32info.o
69
70 gpg-w32info.o : gpg.w32-manifest
71
72 endif
73
74 common_source =  \
75               gpg.h             \
76               dek.h             \
77               build-packet.c    \
78               compress.c        \
79               $(bzip2_source)   \
80               filter.h          \
81               free-packet.c     \
82               getkey.c          \
83               keydb.c keydb.h    \
84               keyring.c keyring.h \
85               seskey.c          \
86               kbnode.c          \
87               main.h            \
88               mainproc.c        \
89               armor.c           \
90               mdfilter.c        \
91               textfilter.c      \
92               progress.c        \
93               misc.c            \
94               rmd160.c rmd160.h \
95               options.h         \
96               openfile.c        \
97               keyid.c           \
98               packet.h          \
99               parse-packet.c    \
100               cpr.c             \
101               plaintext.c       \
102               sig-check.c       \
103               keylist.c         \
104               pkglue.c pkglue.h \
105               ecdh.c
106
107 gpg_sources = 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               dearmor.c         \
121               import.c          \
122               export.c          \
123               migrate.c         \
124               delkey.c          \
125               keygen.c          \
126               helptext.c        \
127               keyserver.c       \
128               keyserver-internal.h \
129               call-dirmngr.c call-dirmngr.h \
130               photoid.c photoid.h \
131               call-agent.c call-agent.h \
132               trust.c $(trust_source) $(tofu_source) \
133               $(card_source) \
134               exec.c exec.h
135
136 gpg2_SOURCES  = gpg.c \
137         keyedit.c       \
138         $(gpg_sources)
139
140 gpgcompose_SOURCES  = gpgcompose.c  $(gpg_sources)
141 gpgv2_SOURCES = gpgv.c           \
142               $(common_source)  \
143               verify.c
144
145 #gpgd_SOURCES = gpgd.c \
146 #              ks-proto.h \
147 #              ks-proto.c \
148 #              ks-db.c \
149 #              ks-db.h \
150 #              $(common_source)
151
152 LDADD =  $(needed_libs) ../common/libgpgrl.a \
153          $(ZLIBS) $(LIBINTL) $(CAPLIBS) $(NETLIBS)
154 gpg2_LDADD = $(LDADD) $(SQLITE3_LIBS) $(LIBGCRYPT_LIBS) $(LIBREADLINE) \
155              $(LIBASSUAN_LIBS) $(GPG_ERROR_LIBS) \
156              $(LIBICONV) $(resource_objs) $(extra_sys_libs)
157 gpg2_LDFLAGS = $(extra_bin_ldflags)
158 gpgv2_LDADD = $(LDADD) $(LIBGCRYPT_LIBS) \
159               $(GPG_ERROR_LIBS) \
160               $(LIBICONV) $(resource_objs) $(extra_sys_libs)
161 gpgv2_LDFLAGS = $(extra_bin_ldflags)
162
163 gpgcompose_LDADD = $(LDADD) $(SQLITE3_LIBS) $(LIBGCRYPT_LIBS) $(LIBREADLINE) \
164              $(LIBASSUAN_LIBS) $(GPG_ERROR_LIBS) \
165              $(LIBICONV) $(resource_objs) $(extra_sys_libs)
166 gpgcompose_LDFLAGS = $(extra_bin_ldflags)
167
168 t_common_ldadd =
169 module_tests = t-rmd160 t-keydb t-keydb-get-keyblock
170 t_rmd160_SOURCES = t-rmd160.c rmd160.c
171 t_rmd160_LDADD = $(t_common_ldadd)
172 t_keydb_SOURCES = t-keydb.c test-stubs.c $(common_source)
173 t_keydb_LDADD = $(LDADD) $(LIBGCRYPT_LIBS) $(GPG_ERROR_LIBS) \
174               $(LIBICONV) $(t_common_ldadd)
175 t_keydb_get_keyblock_SOURCES = t-keydb-get-keyblock.c test-stubs.c \
176               $(common_source)
177 t_keydb_get_keyblock_LDADD = $(LDADD) $(LIBGCRYPT_LIBS) $(GPG_ERROR_LIBS) \
178               $(LIBICONV) $(t_common_ldadd)
179
180
181 $(PROGRAMS): $(needed_libs) ../common/libgpgrl.a
182
183 install-data-local:
184         $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)
185         $(INSTALL_DATA) $(srcdir)/options.skel \
186                                 $(DESTDIR)$(pkgdatadir)/gpg-conf.skel
187         $(INSTALL_DATA) $(srcdir)/dirmngr-conf.skel \
188                                 $(DESTDIR)$(pkgdatadir)/dirmngr-conf.skel
189         $(INSTALL_DATA) $(srcdir)/distsigkey.gpg \
190                                 $(DESTDIR)$(pkgdatadir)/distsigkey.gpg
191
192 uninstall-local:
193         -@rm $(DESTDIR)$(pkgdatadir)/gpg-conf.skel
194         -@rm $(DESTDIR)$(pkgdatadir)/dirmngr-conf.skel
195         -@rm $(DESTDIR)$(pkgdatadir)/distsigkey.gpg
196
197
198 # There has never been a gpg for WindowsCE, thus we don't need a gpg2 here
199 if HAVE_W32CE_SYSTEM
200 install-exec-hook:
201         mv -f $(DESTDIR)$(bindir)/gpg2$(EXEEXT) \
202               $(DESTDIR)$(bindir)/gpg$(EXEEXT)
203 endif