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