Merge branch 'seckey-sync-work' into master
[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 <https://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 =
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 BUILD_SYMCRYPTRUN
38   symcryptrun = symcryptrun
39 else
40   symcryptrun =
41 endif
42
43 if BUILD_WKS_TOOLS
44   gpg_wks_server = gpg-wks-server
45 else
46   gpg_wks_server =
47 endif
48
49 libexec_PROGRAMS = gpg-wks-client gpg-pair-tool
50
51 bin_PROGRAMS = gpgconf gpg-connect-agent ${symcryptrun}
52 if !HAVE_W32_SYSTEM
53 bin_PROGRAMS += watchgnupg gpgparsemail ${gpg_wks_server}
54 endif
55
56 if !DISABLE_REGEX
57 libexec_PROGRAMS += gpg-check-pattern
58 endif
59
60 if !HAVE_W32CE_SYSTEM
61 noinst_PROGRAMS = clean-sat make-dns-cert gpgsplit
62 endif
63
64 if !HAVE_W32CE_SYSTEM
65 if BUILD_GPGTAR
66   bin_PROGRAMS += gpgtar
67 else
68   noinst_PROGRAMS += gpgtar
69 endif
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
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) $(LIBGCRYPT_LIBS) $(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) $(LIBASSUAN_LIBS)
112
113 watchgnupg_SOURCES = watchgnupg.c
114 watchgnupg_LDADD = $(NETLIBS)
115
116 gpg_connect_agent_SOURCES = gpg-connect-agent.c
117 gpg_connect_agent_LDADD = ../common/libgpgrl.a $(common_libs) \
118                           $(LIBASSUAN_LIBS) $(LIBGCRYPT_LIBS) \
119                           $(GPG_ERROR_LIBS) \
120                           $(LIBREADLINE) $(LIBINTL) $(NETLIBS) $(LIBICONV) \
121                           $(resource_objs)
122
123
124 if !DISABLE_REGEX
125 gpg_check_pattern_SOURCES = gpg-check-pattern.c
126 gpg_check_pattern_CFLAGS = $(LIBGCRYPT_CFLAGS) $(GPG_ERROR_CFLAGS) $(INCICONV)
127 gpg_check_pattern_LDADD = $(common_libs) $(LIBGCRYPT_LIBS) $(GPG_ERROR_LIBS) \
128                           $(LIBINTL) $(NETLIBS) $(LIBICONV) $(W32SOCKLIBS) \
129                           $(LIBICONV)
130 endif
131
132 gpgtar_SOURCES = \
133         gpgtar.c gpgtar.h \
134         gpgtar-create.c \
135         gpgtar-extract.c \
136         gpgtar-list.c
137 gpgtar_CFLAGS = $(GPG_ERROR_CFLAGS)
138 gpgtar_LDADD = $(libcommon) $(LIBGCRYPT_LIBS) $(GPG_ERROR_LIBS) \
139                $(LIBINTL) $(NETLIBS) $(LIBICONV) $(W32SOCKLIBS)
140
141 gpg_wks_server_SOURCES = \
142         gpg-wks-server.c \
143         gpg-wks.h \
144         wks-util.c \
145         wks-receive.c \
146         rfc822parse.c rfc822parse.h \
147         mime-parser.c mime-parser.h \
148         mime-maker.c  mime-maker.h  \
149         send-mail.c   send-mail.h
150
151 gpg_wks_server_CFLAGS = $(GPG_ERROR_CFLAGS) $(INCICONV)
152 gpg_wks_server_LDADD = $(libcommon) $(LIBGCRYPT_LIBS) $(GPG_ERROR_LIBS) \
153                        $(LIBINTL) $(LIBICONV)
154
155 gpg_wks_client_SOURCES = \
156         gpg-wks-client.c \
157         gpg-wks.h  \
158         wks-util.c \
159         wks-receive.c \
160         rfc822parse.c rfc822parse.h \
161         mime-parser.c mime-parser.h \
162         mime-maker.h  mime-maker.c  \
163         send-mail.c   send-mail.h   \
164         call-dirmngr.c call-dirmngr.h
165
166 gpg_wks_client_CFLAGS = $(LIBASSUAN_CFLAGS) $(GPG_ERROR_CFLAGS) $(INCICONV)
167 gpg_wks_client_LDADD = $(libcommon) \
168                        $(LIBASSUAN_LIBS) $(LIBGCRYPT_LIBS) $(GPG_ERROR_LIBS) \
169                        $(LIBINTL) $(LIBICONV)
170
171 gpg_pair_tool_SOURCES = \
172         gpg-pair-tool.c
173
174 gpg_pair_tool_CFLAGS = $(GPG_ERROR_CFLAGS) $(INCICONV)
175 gpg_pair_tool_LDADD =  $(libcommon) \
176                        $(LIBGCRYPT_LIBS) $(GPG_ERROR_LIBS) \
177                        $(LIBINTL) $(LIBICONV)
178
179
180 # Make sure that all libs are build before we use them.  This is
181 # important for things like make -j2.
182 $(PROGRAMS): $(common_libs) $(pwquery_libs) ../common/libgpgrl.a