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