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