Rework status table to be less dynamically generated.
[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_GPGSM
70 gpgsm_components = engine-gpgsm.c
71 else
72 gpgsm_components =
73 endif
74
75 if HAVE_ASSUAN
76 assuan_components = assuan-support.c engine-assuan.c
77 else
78 assuan_components =
79 endif
80
81 if HAVE_GPGCONF
82 gpgconf_components = engine-gpgconf.c
83 else
84 gpgconf_components =
85 endif
86
87 if HAVE_G13
88 g13_components = engine-g13.c
89 else
90 g13_components =
91 endif
92
93 if HAVE_UISERVER
94 uiserver_components = engine-uiserver.c
95 else
96 uiserver_components =
97 endif
98
99 # These are the source files common to all library versions.  We used
100 # to build a non-installed library for that, but that does not work
101 # correctly on all platforms (in particular, one can not specify the
102 # right linking order with libtool, as the non-installed version has
103 # unresolved symbols to the thread module.
104 main_sources =                                                          \
105         util.h conversion.c get-env.c context.h ops.h                   \
106         data.h data.c data-fd.c data-stream.c data-mem.c data-user.c    \
107         data-compat.c                                                   \
108         signers.c sig-notation.c                                        \
109         wait.c wait-global.c wait-private.c wait-user.c wait.h          \
110         op-support.c                                                    \
111         encrypt.c encrypt-sign.c decrypt.c decrypt-verify.c verify.c    \
112         sign.c passphrase.c progress.c                                  \
113         key.c keylist.c trust-item.c trustlist.c                        \
114         import.c export.c genkey.c delete.c edit.c getauditlog.c        \
115         opassuan.c passwd.c                                             \
116         engine.h engine-backend.h engine.c engine-gpg.c status-table.c  \
117         $(gpgsm_components) $(assuan_components) $(gpgconf_components)  \
118         $(uiserver_components)                                          \
119         $(g13_components) vfs-mount.c vfs-create.c                      \
120         gpgconf.c                                                       \
121         sema.h priv-io.h $(system_components) dirinfo.c                 \
122         debug.c debug.h gpgme.c version.c error.c
123
124 libgpgme_la_SOURCES = $(main_sources)                                   \
125         ath.h ath.c $(system_components_not_extra)
126 libgpgme_pthread_la_SOURCES = $(main_sources)                           \
127         ath.h ath-pthread.c $(system_components_not_extra)
128
129 if BUILD_W32_GLIB
130 libgpgme_glib_la_SOURCES = $(main_sources) ath.h ath.c w32-glib-io.c
131 endif
132
133 if BUILD_W32_QT
134 libgpgme_qt_la_SOURCES = $(main_sources) ath.h ath.c w32-qt-io.cpp \
135         kdpipeiodevice.h kdpipeiodevice.cpp kdpipeiodevice.moc
136 # FIXME: Add extra depedency: moc_kdpipeiodevice.cpp
137
138 # These are built sources (normally).
139 # moc_kdpipeiodevice.cpp: kdpipeiodevice.h
140 #       $(MOC4) -o $@ $<
141 #
142 # kdpipeiodevice.moc: kdpipeiodevice.cpp
143 #       $(MOC4) -o $@ $<
144 endif
145
146 # We use a global CFLAGS and CPPFLAGS setting for all library
147 # versions, because then every object file is only compiled once.
148 AM_CPPFLAGS = @GPG_ERROR_CFLAGS@ @QT4_CORE_CFLAGS@
149 AM_CFLAGS = @LIBASSUAN_CFLAGS@ @GLIB_CFLAGS@ @QT4_CORE_CFLAGS@
150
151 if HAVE_W32_SYSTEM
152 # Windows provides us with an endless stream of Tough Love.  To spawn
153 # processes with a controlled set of inherited handles, we need a
154 # wrapper process.
155 # Except on Windows CE.  There nothing is inheritable anyway.
156 if HAVE_W32CE_SYSTEM
157 libexec_PROGRAMS =
158 else
159 libexec_PROGRAMS = gpgme-w32spawn
160 endif
161
162 RCCOMPILE = $(RC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES)
163 LTRCCOMPILE = $(LIBTOOL) --mode=compile --tag=RC $(RCCOMPILE)
164
165 SUFFIXES = .rc .lo
166
167 .rc.lo:
168         $(LTRCCOMPILE) -i "$<" -o "$@"
169
170 gpgme_res = versioninfo.lo
171 no_undefined = -no-undefined
172 export_symbols = -export-symbols $(srcdir)/gpgme.def
173
174 install-def-file:
175         $(INSTALL) $(srcdir)/gpgme.def $(DESTDIR)$(libdir)/gpgme.def
176
177 uninstall-def-file:
178         -rm $(DESTDIR)$(libdir)/gpgme.def
179
180 gpgme_deps = $(gpgme_res) gpgme.def
181
182 else
183 gpgme_res =
184 no_undefined =
185 export_symbols =
186 install-def-file:
187 uninstall-def-file:
188
189 gpgme_deps =
190 endif
191
192 libgpgme_la_LDFLAGS = $(no_undefined) $(export_symbols) \
193         $(libgpgme_version_script_cmd) -version-info \
194         @LIBGPGME_LT_CURRENT@:@LIBGPGME_LT_REVISION@:@LIBGPGME_LT_AGE@
195 libgpgme_la_DEPENDENCIES = @LTLIBOBJS@ $(srcdir)/libgpgme.vers $(gpgme_deps)
196 libgpgme_la_LIBADD = $(gpgme_res) @LIBASSUAN_LIBS@ @LTLIBOBJS@ \
197                      @GPG_ERROR_LIBS@
198
199 libgpgme_pthread_la_LDFLAGS = $(no_undefined) $(export_symbols) \
200         $(libgpgme_version_script_cmd) -version-info \
201         @LIBGPGME_LT_CURRENT@:@LIBGPGME_LT_REVISION@:@LIBGPGME_LT_AGE@
202 libgpgme_pthread_la_DEPENDENCIES = @LTLIBOBJS@ $(srcdir)/libgpgme.vers
203 libgpgme_pthread_la_LIBADD = $(gpgme_res) @LIBASSUAN_LIBS@ @LTLIBOBJS@ \
204         -lpthread @GPG_ERROR_LIBS@
205
206 if BUILD_W32_GLIB
207 libgpgme_glib_la_LDFLAGS = $(no_undefined) \
208         $(export_symbols) $(libgpgme_version_script_cmd) -version-info \
209         @LIBGPGME_LT_CURRENT@:@LIBGPGME_LT_REVISION@:@LIBGPGME_LT_AGE@
210 libgpgme_glib_la_DEPENDENCIES = @LTLIBOBJS@ \
211         $(srcdir)/libgpgme.vers $(gpgme_deps)
212 libgpgme_glib_la_LIBADD = $(gpgme_res) @LIBASSUAN_LIBS@ @LTLIBOBJS@ \
213         @GPG_ERROR_LIBS@ @GLIB_LIBS@
214 endif
215
216 if BUILD_W32_QT
217 libgpgme_qt_la_LDFLAGS = $(no_undefined) \
218         $(export_symbols) $(libgpgme_version_script_cmd) -version-info \
219         @LIBGPGME_LT_CURRENT@:@LIBGPGME_LT_REVISION@:@LIBGPGME_LT_AGE@
220 libgpgme_qt_la_DEPENDENCIES = @LTLIBOBJS@ $(srcdir)/libgpgme.vers $(gpgme_deps)
221 libgpgme_qt_la_LIBADD = $(gpgme_res) @LIBASSUAN_LIBS@ @LTLIBOBJS@ \
222         @GPG_ERROR_LIBS@ @QT4_CORE_LIBS@
223 endif
224
225 noinst_PROGRAMS = gpgme-tool
226 gpgme_tool_LDADD = libgpgme.la @LIBASSUAN_LIBS@
227
228 install-data-local: install-def-file
229
230 uninstall-local: uninstall-def-file