82f5327a1ceebbc9cccefb1ebb553eb4ad6b970c
[gpgme.git] / src / Makefile.am
1 # Copyright (C) 2000 Werner Koch (dd9jn)
2 # Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007 g10 Code GmbH
3 #
4 # This file is part of GPGME.
5 #
6 # GPGME is free software; you can redistribute it and/or modify it
7 # under the terms of the GNU Lesser General Public License as
8 # published by the Free Software Foundation; either version 2.1 of the
9 # License, or (at your option) any later version.
10 #
11 # GPGME is distributed in the hope that it will be useful, but WITHOUT
12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 # or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General
14 # Public License for more details.
15 #
16 # You should have received a copy of the GNU Lesser General Public
17 # License along with this program; if not, see <http://www.gnu.org/licenses/>.
18
19 ## Process this file with automake to produce Makefile.in
20
21 # Note: moc_kdpipeiodevice should actually be a dependcy below.
22 EXTRA_DIST = gpgme-config.in gpgme.m4 libgpgme.vers ChangeLog-2011 \
23              gpgme.h.in versioninfo.rc.in gpgme.def moc_kdpipeiodevice.cpp
24
25 bin_SCRIPTS = gpgme-config
26 m4datadir = $(datadir)/aclocal
27 m4data_DATA = gpgme.m4
28 nodist_include_HEADERS = gpgme.h
29
30 if HAVE_PTHREAD
31 ltlib_gpgme_pthread = libgpgme-pthread.la
32 else
33 ltlib_gpgme_pthread =
34 endif
35
36 if BUILD_W32_GLIB
37 ltlib_gpgme_glib = libgpgme-glib.la
38 else
39 ltlib_gpgme_glib =
40 endif
41
42 if BUILD_W32_QT
43 ltlib_gpgme_qt = libgpgme-qt.la
44 else
45 ltlib_gpgme_qt =
46 endif
47
48 lib_LTLIBRARIES = libgpgme.la $(ltlib_gpgme_glib) $(ltlib_gpgme_qt) \
49         $(ltlib_gpgme_pthread)
50
51 if HAVE_LD_VERSION_SCRIPT
52 libgpgme_version_script_cmd = -Wl,--version-script=$(srcdir)/libgpgme.vers
53 else
54 libgpgme_version_script_cmd =
55 endif
56
57 if HAVE_DOSISH_SYSTEM
58 system_components = w32-util.c w32-sema.c
59 system_components_not_extra = w32-io.c
60 else
61 system_components = ath.h posix-util.c posix-sema.c posix-io.c
62 system_components_not_extra =
63 endif
64
65 if HAVE_W32CE_SYSTEM
66 system_components += w32-ce.h w32-ce.c
67 endif
68
69 if HAVE_UISERVER
70 uiserver_components = engine-uiserver.c
71 else
72 uiserver_components =
73 endif
74
75 # These are the source files common to all library versions.  We used
76 # to build a non-installed library for that, but that does not work
77 # correctly on all platforms (in particular, one can not specify the
78 # right linking order with libtool, as the non-installed version has
79 # unresolved symbols to the thread module.
80 main_sources =                                                          \
81         util.h conversion.c get-env.c context.h ops.h                   \
82         parsetlv.c parsetlv.h                                           \
83         data.h data.c data-fd.c data-stream.c data-mem.c data-user.c    \
84         data-compat.c data-identify.c                                   \
85         signers.c sig-notation.c                                        \
86         wait.c wait-global.c wait-private.c wait-user.c wait.h          \
87         op-support.c                                                    \
88         encrypt.c encrypt-sign.c decrypt.c decrypt-verify.c verify.c    \
89         sign.c passphrase.c progress.c                                  \
90         key.c keylist.c trust-item.c trustlist.c                        \
91         import.c export.c genkey.c delete.c edit.c getauditlog.c        \
92         opassuan.c passwd.c spawn.c assuan-support.c                    \
93         engine.h engine-backend.h engine.c engine-gpg.c status-table.c  \
94         engine-gpgsm.c engine-assuan.c engine-gpgconf.c                 \
95         $(uiserver_components)                                          \
96         engine-g13.c vfs-mount.c vfs-create.c                           \
97         engine-spawn.c                                                  \
98         gpgconf.c                                                       \
99         sema.h priv-io.h $(system_components) sys-util.h dirinfo.c      \
100         debug.c debug.h gpgme.c version.c error.c
101
102 libgpgme_la_SOURCES = $(main_sources)                                   \
103         ath.h ath.c $(system_components_not_extra)
104 libgpgme_pthread_la_SOURCES = $(main_sources)                           \
105         ath.h ath-pthread.c $(system_components_not_extra)
106
107 if BUILD_W32_GLIB
108 libgpgme_glib_la_SOURCES = $(main_sources) ath.h ath.c w32-glib-io.c
109 endif
110
111 if BUILD_W32_QT
112 libgpgme_qt_la_SOURCES = $(main_sources) ath.h ath.c w32-qt-io.cpp \
113         kdpipeiodevice.h kdpipeiodevice.cpp kdpipeiodevice.moc
114 # FIXME: Add extra depedency: moc_kdpipeiodevice.cpp
115
116 # These are built sources (normally).
117 # moc_kdpipeiodevice.cpp: kdpipeiodevice.h
118 #       $(MOC4) -o $@ $<
119 #
120 # kdpipeiodevice.moc: kdpipeiodevice.cpp
121 #       $(MOC4) -o $@ $<
122 endif
123
124 # We use a global CFLAGS and CPPFLAGS setting for all library
125 # versions, because then every object file is only compiled once.
126 AM_CPPFLAGS = @GPG_ERROR_CFLAGS@ @QT4_CORE_CFLAGS@
127 AM_CFLAGS = @LIBASSUAN_CFLAGS@ @GLIB_CFLAGS@ @QT4_CORE_CFLAGS@
128
129 if HAVE_W32_SYSTEM
130 # Windows provides us with an endless stream of Tough Love.  To spawn
131 # processes with a controlled set of inherited handles, we need a
132 # wrapper process.
133 # Except on Windows CE.  There nothing is inheritable anyway.
134 if HAVE_W32CE_SYSTEM
135 libexec_PROGRAMS =
136 else
137 libexec_PROGRAMS = gpgme-w32spawn
138 endif
139
140 RCCOMPILE = $(RC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES)
141 LTRCCOMPILE = $(LIBTOOL) --mode=compile --tag=RC $(RCCOMPILE)
142
143 SUFFIXES = .rc .lo
144
145 .rc.lo:
146         $(LTRCCOMPILE) -i "$<" -o "$@"
147
148 gpgme_res = versioninfo.lo
149 no_undefined = -no-undefined
150 export_symbols = -export-symbols $(srcdir)/gpgme.def
151
152 install-def-file:
153         -$(INSTALL) -d $(DESTDIR)$(libdir)
154         $(INSTALL) $(srcdir)/gpgme.def $(DESTDIR)$(libdir)/gpgme.def
155
156 uninstall-def-file:
157         -rm $(DESTDIR)$(libdir)/gpgme.def
158
159 gpgme_deps = $(gpgme_res) gpgme.def
160
161 else
162 gpgme_res =
163 no_undefined =
164 export_symbols =
165 install-def-file:
166 uninstall-def-file:
167
168 gpgme_deps =
169 endif
170
171 libgpgme_la_LDFLAGS = $(no_undefined) $(export_symbols) \
172         $(libgpgme_version_script_cmd) -version-info \
173         @LIBGPGME_LT_CURRENT@:@LIBGPGME_LT_REVISION@:@LIBGPGME_LT_AGE@
174 libgpgme_la_DEPENDENCIES = @LTLIBOBJS@ $(srcdir)/libgpgme.vers $(gpgme_deps)
175 libgpgme_la_LIBADD = $(gpgme_res) @LIBASSUAN_LIBS@ @LTLIBOBJS@ \
176                      @GPG_ERROR_LIBS@
177
178 libgpgme_pthread_la_LDFLAGS = $(no_undefined) $(export_symbols) \
179         $(libgpgme_version_script_cmd) -version-info \
180         @LIBGPGME_LT_CURRENT@:@LIBGPGME_LT_REVISION@:@LIBGPGME_LT_AGE@
181 libgpgme_pthread_la_DEPENDENCIES = @LTLIBOBJS@ $(srcdir)/libgpgme.vers
182 libgpgme_pthread_la_LIBADD = $(gpgme_res) @LIBASSUAN_LIBS@ @LTLIBOBJS@ \
183         -lpthread @GPG_ERROR_LIBS@
184
185 if BUILD_W32_GLIB
186 libgpgme_glib_la_LDFLAGS = $(no_undefined) \
187         $(export_symbols) $(libgpgme_version_script_cmd) -version-info \
188         @LIBGPGME_LT_CURRENT@:@LIBGPGME_LT_REVISION@:@LIBGPGME_LT_AGE@
189 libgpgme_glib_la_DEPENDENCIES = @LTLIBOBJS@ \
190         $(srcdir)/libgpgme.vers $(gpgme_deps)
191 libgpgme_glib_la_LIBADD = $(gpgme_res) @LIBASSUAN_LIBS@ @LTLIBOBJS@ \
192         @GPG_ERROR_LIBS@ @GLIB_LIBS@
193 endif
194
195 if BUILD_W32_QT
196 libgpgme_qt_la_LDFLAGS = $(no_undefined) \
197         $(export_symbols) $(libgpgme_version_script_cmd) -version-info \
198         @LIBGPGME_LT_CURRENT@:@LIBGPGME_LT_REVISION@:@LIBGPGME_LT_AGE@
199 libgpgme_qt_la_DEPENDENCIES = @LTLIBOBJS@ $(srcdir)/libgpgme.vers $(gpgme_deps)
200 libgpgme_qt_la_LIBADD = $(gpgme_res) @LIBASSUAN_LIBS@ @LTLIBOBJS@ \
201         @GPG_ERROR_LIBS@ @QT4_CORE_LIBS@
202 endif
203
204 noinst_PROGRAMS = gpgme-tool
205 gpgme_tool_LDADD = libgpgme.la @LIBASSUAN_LIBS@
206
207 install-data-local: install-def-file
208
209 uninstall-local: uninstall-def-file