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