Imported Upstream version 2.1.7
[platform/upstream/gpg2.git] / tools / Makefile.am
1 # Makefile.am - Tools directory
2 #       Copyright (C) 2003, 2007 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 EXTRA_DIST = \
20         Manifest watchgnupg.c \
21         addgnupghome applygnupgdefaults \
22         lspgpot mail-signed-keys convert-from-106 sockprox.c \
23         ccidmon.c ChangeLog-2011 gpg-connect-agent-w32info.rc
24
25
26 AM_CPPFLAGS = -I$(top_srcdir)/common
27 include $(top_srcdir)/am/cmacros.am
28
29 if HAVE_W32_SYSTEM
30 resource_objs += gpg-connect-agent-w32info.o
31 endif
32
33 AM_CFLAGS = $(LIBGCRYPT_CFLAGS) $(GPG_ERROR_CFLAGS) $(LIBASSUAN_CFLAGS)
34
35 sbin_SCRIPTS = addgnupghome applygnupgdefaults
36
37 if HAVE_USTAR
38 # bin_SCRIPTS += gpg-zip
39 noinst_SCRIPTS = gpg-zip
40 endif
41
42 if BUILD_SYMCRYPTRUN
43   symcryptrun = symcryptrun
44 else
45   symcryptrun =
46 endif
47
48 if BUILD_GPGTAR
49   gpgtar = gpgtar
50 else
51   gpgtar =
52 endif
53
54 # Fixme: We should remove the gpgkey2ssh tool.
55 bin_PROGRAMS = gpgconf gpg-connect-agent ${symcryptrun}
56 if !HAVE_W32_SYSTEM
57 bin_PROGRAMS += watchgnupg gpgparsemail
58 endif
59 if !HAVE_W32CE_SYSTEM
60 bin_PROGRAMS += gpgkey2ssh ${gpgtar}
61 endif
62
63 if !DISABLE_REGEX
64 libexec_PROGRAMS = gpg-check-pattern
65 endif
66
67 if !HAVE_W32CE_SYSTEM
68 noinst_PROGRAMS = clean-sat mk-tdata make-dns-cert gpgsplit
69 endif
70
71 common_libs = $(libcommon)
72 commonpth_libs = $(libcommonpth)
73
74 # Some modules require PTH under W32CE.
75 if HAVE_W32CE_SYSTEM
76 maybe_commonpth_libs = $(commonpth_libs)
77 else
78 maybe_commonpth_libs = $(common_libs)
79 endif
80
81 if HAVE_W32CE_SYSTEM
82 pwquery_libs =
83 else
84 pwquery_libs = ../common/libsimple-pwquery.a
85 endif
86
87 if HAVE_W32CE_SYSTEM
88 opt_libassuan_libs = $(LIBASSUAN_LIBS)
89 endif
90
91 gpgsplit_LDADD = $(common_libs) \
92                  $(LIBGCRYPT_LIBS) $(GPG_ERROR_LIBS) \
93                  $(ZLIBS) $(LIBINTL) $(NETLIBS) $(LIBICONV)
94
95 gpgconf_SOURCES = gpgconf.c gpgconf.h gpgconf-comp.c no-libgcrypt.c
96
97 # common sucks in gpg-error, will they, nil they (some compilers
98 # do not eliminate the supposed-to-be-unused-inline-functions).
99 gpgconf_LDADD = $(maybe_commonpth_libs) $(opt_libassuan_libs) \
100                 $(LIBINTL) $(GPG_ERROR_LIBS) $(NETLIBS) \
101                 $(LIBICONV) $(W32SOCKLIBS)
102 gpgconf_LDFLAGS = $(extra_bin_ldflags)
103
104 gpgparsemail_SOURCES = gpgparsemail.c rfc822parse.c rfc822parse.h
105 gpgparsemail_LDADD =
106
107 symcryptrun_SOURCES = symcryptrun.c
108 symcryptrun_LDADD = $(LIBUTIL_LIBS) $(common_libs) $(pwquery_libs) \
109                     $(LIBGCRYPT_LIBS) $(GPG_ERROR_LIBS) $(LIBINTL) \
110                     $(LIBICONV) $(NETLIBS) $(W32SOCKLIBS)
111
112 watchgnupg_SOURCES = watchgnupg.c
113 watchgnupg_LDADD = $(NETLIBS)
114
115 gpg_connect_agent_SOURCES = gpg-connect-agent.c no-libgcrypt.c
116 # FIXME: remove PTH_LIBS (why do we need them at all?)
117 gpg_connect_agent_LDADD = ../common/libgpgrl.a $(common_libs) \
118                           $(LIBASSUAN_LIBS) $(NPTH_LIBS) $(GPG_ERROR_LIBS) \
119                           $(LIBREADLINE) $(LIBINTL) $(NETLIBS) $(LIBICONV) \
120                           $(resource_objs)
121
122 if !HAVE_W32CE_SYSTEM
123 gpgkey2ssh_SOURCES = gpgkey2ssh.c
124 gpgkey2ssh_CFLAGS = $(LIBGCRYPT_CFLAGS) $(GPG_ERROR_CFLAGS)
125 # common via use of BUG() in an inline function, which
126 # some compilers do not eliminate.
127 gpgkey2ssh_LDADD = $(common_libs) \
128                    $(LIBGCRYPT_LIBS) $(GPG_ERROR_LIBS) $(LIBINTL) $(LIBICONV) \
129                    $(NETLIBS)
130 endif
131
132 if !DISABLE_REGEX
133 gpg_check_pattern_SOURCES = gpg-check-pattern.c
134 gpg_check_pattern_CFLAGS = $(LIBGCRYPT_CFLAGS) $(GPG_ERROR_CFLAGS)
135 gpg_check_pattern_LDADD = $(common_libs) $(LIBGCRYPT_LIBS) $(GPG_ERROR_LIBS) \
136                           $(LIBINTL) $(NETLIBS) $(LIBICONV) $(W32SOCKLIBS)
137 endif
138
139 gpgtar_SOURCES = \
140         gpgtar.c gpgtar.h \
141         gpgtar-create.c \
142         gpgtar-extract.c \
143         gpgtar-list.c \
144         no-libgcrypt.c
145 gpgtar_CFLAGS = $(GPG_ERROR_CFLAGS) $(PTH_CFLAGS)
146 #gpgtar_LDADD = $(commonpth_libs) $(PTH_LIBS) $(GPG_ERROR_LIBS)
147 gpgtar_LDADD = $(common_libs) $(GPG_ERROR_LIBS) \
148                $(LIBINTL) $(NETLIBS) $(LIBICONV) $(W32SOCKLIBS)
149
150
151 # Make sure that all libs are build before we use them.  This is
152 # important for things like make -j2.
153 $(PROGRAMS): $(common_libs) $(pwquery_libs) ../common/libgpgrl.a