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