4833bff5ef8cea396677b198d3e148c18a87bca4
[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 \
24         gpg-connect-agent-w32info.rc \
25         gpg-card-tool-w32info.rc
26
27 AM_CPPFLAGS =
28 include $(top_srcdir)/am/cmacros.am
29
30 if HAVE_W32_SYSTEM
31 gpg_connect_agent_rc_objs = gpg-connect-agent-w32info.o
32 gpg_card_tool_rc_objs     = gpg-card-tool-w32info.o
33 resource_objs += $(gpg_connect_agent_rc_objs) $(gpg_card_tool_rc_objs)
34 endif
35
36 AM_CFLAGS = $(LIBGCRYPT_CFLAGS) $(GPG_ERROR_CFLAGS) $(LIBASSUAN_CFLAGS)
37
38 sbin_SCRIPTS = addgnupghome applygnupgdefaults
39
40 if BUILD_SYMCRYPTRUN
41   symcryptrun = symcryptrun
42 else
43   symcryptrun =
44 endif
45
46 if BUILD_WKS_TOOLS
47   gpg_wks_server = gpg-wks-server
48 else
49   gpg_wks_server =
50 endif
51
52 libexec_PROGRAMS = gpg-wks-client gpg-pair-tool
53
54 bin_PROGRAMS = gpgconf gpg-connect-agent gpg-card-tool ${symcryptrun}
55 if !HAVE_W32_SYSTEM
56 bin_PROGRAMS += watchgnupg gpgparsemail ${gpg_wks_server}
57 endif
58
59 if !DISABLE_REGEX
60 libexec_PROGRAMS += gpg-check-pattern
61 endif
62
63 if !HAVE_W32CE_SYSTEM
64 noinst_PROGRAMS = clean-sat make-dns-cert gpgsplit
65 endif
66
67 if !HAVE_W32CE_SYSTEM
68 if BUILD_GPGTAR
69   bin_PROGRAMS += gpgtar
70 else
71   noinst_PROGRAMS += gpgtar
72 endif
73 endif
74
75 common_libs = $(libcommon)
76 commonpth_libs = $(libcommonpth)
77
78 # Some modules require PTH under W32CE.
79 if HAVE_W32CE_SYSTEM
80 maybe_commonpth_libs = $(commonpth_libs)
81 else
82 maybe_commonpth_libs = $(common_libs)
83 endif
84
85 if HAVE_W32CE_SYSTEM
86 pwquery_libs =
87 else
88 pwquery_libs = ../common/libsimple-pwquery.a
89 endif
90
91 if HAVE_W32CE_SYSTEM
92 opt_libassuan_libs = $(LIBASSUAN_LIBS)
93 endif
94
95 gpgsplit_LDADD = $(common_libs) \
96                  $(LIBGCRYPT_LIBS) $(GPG_ERROR_LIBS) \
97                  $(ZLIBS) $(LIBINTL) $(NETLIBS) $(LIBICONV)
98
99 gpgconf_SOURCES = gpgconf.c gpgconf.h gpgconf-comp.c
100
101 # common sucks in gpg-error, will they, nil they (some compilers
102 # do not eliminate the supposed-to-be-unused-inline-functions).
103 gpgconf_LDADD = $(maybe_commonpth_libs) $(opt_libassuan_libs) \
104                 $(LIBINTL) $(LIBGCRYPT_LIBS) $(GPG_ERROR_LIBS) $(NETLIBS) \
105                 $(LIBICONV) $(W32SOCKLIBS)
106 gpgconf_LDFLAGS = $(extra_bin_ldflags)
107
108 gpgparsemail_SOURCES = gpgparsemail.c rfc822parse.c rfc822parse.h
109 gpgparsemail_LDADD =
110
111 symcryptrun_SOURCES = symcryptrun.c
112 symcryptrun_LDADD = $(LIBUTIL_LIBS) $(common_libs) $(pwquery_libs) \
113                     $(LIBGCRYPT_LIBS) $(GPG_ERROR_LIBS) $(LIBINTL) \
114                     $(LIBICONV) $(NETLIBS) $(W32SOCKLIBS) $(LIBASSUAN_LIBS)
115
116 watchgnupg_SOURCES = watchgnupg.c
117 watchgnupg_LDADD = $(NETLIBS)
118
119 gpg_connect_agent_SOURCES = gpg-connect-agent.c
120 gpg_connect_agent_LDADD = ../common/libgpgrl.a $(common_libs) \
121                           $(LIBASSUAN_LIBS) $(LIBGCRYPT_LIBS) \
122                           $(GPG_ERROR_LIBS) \
123                           $(LIBREADLINE) $(LIBINTL) $(NETLIBS) $(LIBICONV) \
124                           $(gpg_connect_agent_rc_objs)
125
126 gpg_card_tool_SOURCES   = gpg-card-tool.c
127 gpg_card_tool_LDADD     = ../common/libgpgrl.a $(common_libs) \
128                           $(LIBASSUAN_LIBS) $(LIBGCRYPT_LIBS) \
129                           $(GPG_ERROR_LIBS) \
130                           $(LIBREADLINE) $(LIBINTL) $(NETLIBS) $(LIBICONV) \
131                           $(gpg_card_tool_rc_objs)
132
133
134 if !DISABLE_REGEX
135 gpg_check_pattern_SOURCES = gpg-check-pattern.c
136 gpg_check_pattern_CFLAGS = $(LIBGCRYPT_CFLAGS) $(GPG_ERROR_CFLAGS) $(INCICONV)
137 gpg_check_pattern_LDADD = $(common_libs) $(LIBGCRYPT_LIBS) $(GPG_ERROR_LIBS) \
138                           $(LIBINTL) $(NETLIBS) $(LIBICONV) $(W32SOCKLIBS) \
139                           $(LIBICONV)
140 endif
141
142 gpgtar_SOURCES = \
143         gpgtar.c gpgtar.h \
144         gpgtar-create.c \
145         gpgtar-extract.c \
146         gpgtar-list.c
147 gpgtar_CFLAGS = $(GPG_ERROR_CFLAGS)
148 gpgtar_LDADD = $(libcommon) $(LIBGCRYPT_LIBS) $(GPG_ERROR_LIBS) \
149                $(LIBINTL) $(NETLIBS) $(LIBICONV) $(W32SOCKLIBS)
150
151 gpg_wks_server_SOURCES = \
152         gpg-wks-server.c \
153         gpg-wks.h \
154         wks-util.c \
155         wks-receive.c \
156         rfc822parse.c rfc822parse.h \
157         mime-parser.c mime-parser.h \
158         mime-maker.c  mime-maker.h  \
159         send-mail.c   send-mail.h
160
161 gpg_wks_server_CFLAGS = $(GPG_ERROR_CFLAGS) $(INCICONV)
162 gpg_wks_server_LDADD = $(libcommon) $(LIBGCRYPT_LIBS) $(GPG_ERROR_LIBS) \
163                        $(LIBINTL) $(LIBICONV)
164
165 gpg_wks_client_SOURCES = \
166         gpg-wks-client.c \
167         gpg-wks.h  \
168         wks-util.c \
169         wks-receive.c \
170         rfc822parse.c rfc822parse.h \
171         mime-parser.c mime-parser.h \
172         mime-maker.h  mime-maker.c  \
173         send-mail.c   send-mail.h   \
174         call-dirmngr.c call-dirmngr.h
175
176 gpg_wks_client_CFLAGS = $(LIBASSUAN_CFLAGS) $(GPG_ERROR_CFLAGS) $(INCICONV)
177 gpg_wks_client_LDADD = $(libcommon) \
178                        $(LIBASSUAN_LIBS) $(LIBGCRYPT_LIBS) $(GPG_ERROR_LIBS) \
179                        $(LIBINTL) $(LIBICONV)
180
181 gpg_pair_tool_SOURCES = \
182         gpg-pair-tool.c
183
184 gpg_pair_tool_CFLAGS = $(GPG_ERROR_CFLAGS) $(INCICONV)
185 gpg_pair_tool_LDADD =  $(libcommon) \
186                        $(LIBGCRYPT_LIBS) $(GPG_ERROR_LIBS) \
187                        $(LIBINTL) $(LIBICONV) $(W32SOCKLIBS)
188
189
190 # Make sure that all libs are build before we use them.  This is
191 # important for things like make -j2.
192 $(PROGRAMS): $(common_libs) $(pwquery_libs) ../common/libgpgrl.a