common: Add a global variable to for the default error source.
[gnupg.git] / agent / Makefile.am
1 # Copyright (C) 2001, 2003, 2004, 2005 Free Software Foundation, Inc.
2 #
3 # This file is part of GnuPG.
4 #
5 # GnuPG is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
9 #
10 # GnuPG is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, see <http://www.gnu.org/licenses/>.
17
18 ## Process this file with automake to produce Makefile.in
19
20 bin_PROGRAMS = gpg-agent
21 libexec_PROGRAMS = gpg-protect-tool
22 if !HAVE_W32CE_SYSTEM
23 # fixme: Do no use simple-pwquery for preset-passphrase.
24 libexec_PROGRAMS += gpg-preset-passphrase
25 endif
26 noinst_PROGRAMS = $(TESTS)
27
28 EXTRA_DIST = ChangeLog-2011
29
30
31 AM_CPPFLAGS = -I$(top_srcdir)/gl -I$(top_srcdir)/common -I$(top_srcdir)/intl
32
33 include $(top_srcdir)/am/cmacros.am
34
35 AM_CFLAGS = $(LIBGCRYPT_CFLAGS) $(GPG_ERROR_CFLAGS)
36
37 gpg_agent_SOURCES = \
38         gpg-agent.c agent.h \
39         command.c command-ssh.c \
40         call-pinentry.c \
41         cache.c \
42         trans.c \
43         findkey.c \
44         pksign.c \
45         pkdecrypt.c \
46         genkey.c \
47         protect.c \
48         trustlist.c \
49         divert-scd.c \
50         cvt-openpgp.c cvt-openpgp.h \
51         call-scd.c \
52         learncard.c
53
54 common_libs = $(libcommon) ../gl/libgnu.a
55 commonpth_libs = $(libcommonpth) ../gl/libgnu.a
56 if HAVE_W32CE_SYSTEM
57 pwquery_libs =
58 else
59 pwquery_libs = ../common/libsimple-pwquery.a
60 endif
61
62 #if HAVE_W32_SYSTEM
63 #.rc.o:
64 #       $(WINDRES) `echo $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) | \
65 #        sed -e 's/-I/--include-dir /g;s/-D/--define /g'` -i $< -o $@
66 #
67 #gpg_agent_res_ldflags = -Wl,gpg-agent-resource.o -Wl,--subsystem,windows
68 #gpg_agent_res_deps = gpg-agent-resource.o
69 #else
70 gpg_agent_res_ldflags =
71 gpg_agent_res_deps =
72 #endif
73
74
75 gpg_agent_CFLAGS = $(AM_CFLAGS) $(LIBASSUAN_CFLAGS) $(NPTH_CFLAGS)
76 gpg_agent_LDADD = $(commonpth_libs) \
77                 $(LIBGCRYPT_LIBS) $(LIBASSUAN_LIBS) $(NPTH_LIBS) \
78                 $(GPG_ERROR_LIBS) $(LIBINTL) $(NETLIBS) $(LIBICONV)
79 gpg_agent_LDFLAGS = $(extra_bin_ldflags) $(gpg_agent_res_ldflags)
80 gpg_agent_DEPENDENCIES = $(gpg_agent_res_deps)
81
82 gpg_protect_tool_SOURCES = \
83         protect-tool.c \
84         protect.c
85
86 gpg_protect_tool_CFLAGS = $(AM_CFLAGS) $(LIBASSUAN_CFLAGS)
87 gpg_protect_tool_LDADD = $(common_libs) $(LIBGCRYPT_LIBS) $(LIBASSUAN_LIBS) \
88          $(GPG_ERROR_LIBS) $(LIBINTL) $(NETLIBS) $(LIBICONV)
89
90 gpg_preset_passphrase_SOURCES = \
91         preset-passphrase.c
92
93 # Needs $(NETLIBS) for libsimple-pwquery.la.
94 gpg_preset_passphrase_LDADD = \
95          $(pwquery_libs) $(common_libs) \
96          $(LIBGCRYPT_LIBS) $(GPG_ERROR_LIBS) $(LIBINTL) $(NETLIBS) $(LIBICONV)
97
98
99 # Make sure that all libs are build before we use them.  This is
100 # important for things like make -j2.
101 $(PROGRAMS): $(common_libs) $(commonpth_libs) $(pwquery_libs)
102
103
104
105 #
106 # Module tests
107 #
108 TESTS = t-protect
109
110 t_common_ldadd = $(common_libs)  $(LIBGCRYPT_LIBS) $(GPG_ERROR_LIBS) \
111                   $(LIBINTL) $(LIBICONV) $(NETLIBS)
112
113 t_protect_SOURCES = t-protect.c protect.c
114 t_protect_LDADD = $(t_common_ldadd)