tools: Call sendmail directly from the wks tools.
[gnupg.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 no-libgcrypt.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 if BUILD_WKS_TOOLS
55   gpg_wks_server = gpg-wks-server
56   gpg_wks_client = gpg-wks-client
57 else
58   gpg_wks_server =
59   gpg_wks_client =
60 endif
61
62 bin_PROGRAMS = gpgconf gpg-connect-agent ${symcryptrun}
63 if !HAVE_W32_SYSTEM
64 bin_PROGRAMS += watchgnupg gpgparsemail ${gpg_wks_server} ${gpg_wks_client}
65 endif
66 if !HAVE_W32CE_SYSTEM
67 bin_PROGRAMS += ${gpgtar}
68 endif
69
70 if !DISABLE_REGEX
71 libexec_PROGRAMS = gpg-check-pattern
72 endif
73
74 if !HAVE_W32CE_SYSTEM
75 noinst_PROGRAMS = clean-sat mk-tdata make-dns-cert gpgsplit
76 endif
77
78 common_libs = $(libcommon)
79 commonpth_libs = $(libcommonpth)
80
81 # Some modules require PTH under W32CE.
82 if HAVE_W32CE_SYSTEM
83 maybe_commonpth_libs = $(commonpth_libs)
84 else
85 maybe_commonpth_libs = $(common_libs)
86 endif
87
88 if HAVE_W32CE_SYSTEM
89 pwquery_libs =
90 else
91 pwquery_libs = ../common/libsimple-pwquery.a
92 endif
93
94 if HAVE_W32CE_SYSTEM
95 opt_libassuan_libs = $(LIBASSUAN_LIBS)
96 endif
97
98 gpgsplit_LDADD = $(common_libs) \
99                  $(LIBGCRYPT_LIBS) $(GPG_ERROR_LIBS) \
100                  $(ZLIBS) $(LIBINTL) $(NETLIBS) $(LIBICONV)
101
102 gpgconf_SOURCES = gpgconf.c gpgconf.h gpgconf-comp.c
103
104 # common sucks in gpg-error, will they, nil they (some compilers
105 # do not eliminate the supposed-to-be-unused-inline-functions).
106 gpgconf_LDADD = $(maybe_commonpth_libs) $(opt_libassuan_libs) \
107                 $(LIBINTL) $(LIBGCRYPT_LIBS) $(GPG_ERROR_LIBS) $(NETLIBS) \
108                 $(LIBICONV) $(W32SOCKLIBS)
109 gpgconf_LDFLAGS = $(extra_bin_ldflags)
110
111 gpgparsemail_SOURCES = gpgparsemail.c rfc822parse.c rfc822parse.h
112 gpgparsemail_LDADD =
113
114 symcryptrun_SOURCES = symcryptrun.c
115 symcryptrun_LDADD = $(LIBUTIL_LIBS) $(common_libs) $(pwquery_libs) \
116                     $(LIBGCRYPT_LIBS) $(GPG_ERROR_LIBS) $(LIBINTL) \
117                     $(LIBICONV) $(NETLIBS) $(W32SOCKLIBS)
118
119 watchgnupg_SOURCES = watchgnupg.c
120 watchgnupg_LDADD = $(NETLIBS)
121
122 gpg_connect_agent_SOURCES = gpg-connect-agent.c
123 # FIXME: remove NPTH_LIBS (why do we need them at all?)
124 gpg_connect_agent_LDADD = ../common/libgpgrl.a $(common_libs) \
125                           $(LIBASSUAN_LIBS) $(LIBGCRYPT_LIBS) \
126                           $(NPTH_LIBS) $(GPG_ERROR_LIBS) \
127                           $(LIBREADLINE) $(LIBINTL) $(NETLIBS) $(LIBICONV) \
128                           $(resource_objs)
129
130
131 if !DISABLE_REGEX
132 gpg_check_pattern_SOURCES = gpg-check-pattern.c
133 gpg_check_pattern_CFLAGS = $(LIBGCRYPT_CFLAGS) $(GPG_ERROR_CFLAGS)
134 gpg_check_pattern_LDADD = $(common_libs) $(LIBGCRYPT_LIBS) $(GPG_ERROR_LIBS) \
135                           $(LIBINTL) $(NETLIBS) $(LIBICONV) $(W32SOCKLIBS)
136 endif
137
138 gpgtar_SOURCES = \
139         gpgtar.c gpgtar.h \
140         gpgtar-create.c \
141         gpgtar-extract.c \
142         gpgtar-list.c
143 gpgtar_CFLAGS = $(GPG_ERROR_CFLAGS)
144 gpgtar_LDADD = $(libcommon) $(LIBGCRYPT_LIBS) $(GPG_ERROR_LIBS) \
145                $(LIBINTL) $(NETLIBS) $(LIBICONV) $(W32SOCKLIBS)
146
147 gpg_wks_server_SOURCES = \
148         gpg-wks-server.c \
149         gpg-wks.h \
150         wks-util.c \
151         wks-receive.c \
152         rfc822parse.c rfc822parse.h \
153         mime-parser.c mime-parser.h \
154         mime-maker.c  mime-maker.h  \
155         send-mail.c   send-mail.h
156
157 gpg_wks_server_CFLAGS = $(GPG_ERROR_CFLAGS)
158 gpg_wks_server_LDADD = $(libcommon) $(LIBGCRYPT_LIBS) $(GPG_ERROR_LIBS)
159
160 gpg_wks_client_SOURCES = \
161         gpg-wks-client.c \
162         gpg-wks.h  \
163         wks-util.c \
164         wks-receive.c \
165         rfc822parse.c rfc822parse.h \
166         mime-parser.c mime-parser.h \
167         mime-maker.h  mime-maker.c  \
168         send-mail.c   send-mail.h   \
169         call-dirmngr.c call-dirmngr.h
170
171 gpg_wks_client_CFLAGS = $(LIBASSUAN_CFLAGS) $(GPG_ERROR_CFLAGS)
172 gpg_wks_client_LDADD = $(libcommon) \
173                        $(LIBASSUAN_LIBS) $(LIBGCRYPT_LIBS) $(GPG_ERROR_LIBS)
174
175
176 # Make sure that all libs are build before we use them.  This is
177 # important for things like make -j2.
178 $(PROGRAMS): $(common_libs) $(pwquery_libs) ../common/libgpgrl.a