ece1adfd83e3f86c24418170bb8646a7837da17a
[gpgme.git] / gpgme / Makefile.am
1 # Copyright (C) 2000 Werner Koch (dd9jn)
2 # Copyright (C) 2001, 2002, 2003, 2004, 2005 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, write to the Free Software
18 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
19
20 ## Process this file with automake to produce Makefile.in
21
22 EXTRA_DIST = gpgme-config.in gpgme.m4 mkstatus libgpgme.vers \
23              versioninfo.rc.in gpgme.def
24 BUILT_SOURCES = status-table.h
25 MOSTLYCLEANFILES = status-table.h
26 bin_SCRIPTS = gpgme-config
27 m4datadir = $(datadir)/aclocal
28 m4data_DATA = gpgme.m4
29 include_HEADERS = gpgme.h
30
31 if HAVE_PTHREAD
32 ltlib_gpgme_pthread = libgpgme-pthread.la
33 else
34 ltlib_gpgme_pthread =
35 endif
36 if HAVE_PTH
37 ltlib_gpgme_pth = libgpgme-pth.la
38 else
39 ltlib_gpgme_pth =
40 endif
41
42 noinst_LTLIBRARIES = libgpgme-real.la
43 lib_LTLIBRARIES = libgpgme.la $(ltlib_gpgme_pthread) $(ltlib_gpgme_pth)
44
45 if HAVE_LD_VERSION_SCRIPT
46 libgpgme_version_script_cmd = -Wl,--version-script=$(srcdir)/libgpgme.vers
47 else
48 libgpgme_version_script_cmd =
49 endif
50
51 if BUILD_ASSUAN
52 assuan_cppflags = -I$(top_srcdir)/assuan
53 assuan_libobjs = ../assuan/libassuan.la
54 else
55 assuan_cppflags =
56 assuan_libobjs =
57 endif
58
59 if HAVE_DOSISH_SYSTEM
60 system_components = w32-util.c w32-sema.c w32-io.c
61 else
62 system_components = ath.h posix-util.c posix-sema.c posix-io.c
63 endif
64
65 if HAVE_GPGSM
66 gpgsm_components = engine-gpgsm.c
67 else
68 gpgsm_components =
69 endif
70
71 libgpgme_real_la_SOURCES =                                              \
72         gpgme.h util.h conversion.c get-env.c context.h ops.h           \
73         data.h data.c data-fd.c data-stream.c data-mem.c data-user.c    \
74         data-compat.c                                                   \
75         signers.c sig-notation.c                                        \
76         wait.c wait-global.c wait-private.c wait-user.c wait.h          \
77         op-support.c                                                    \
78         encrypt.c encrypt-sign.c decrypt.c decrypt-verify.c verify.c    \
79         sign.c passphrase.c progress.c                                  \
80         key.c keylist.c trust-item.c trustlist.c                        \
81         import.c export.c genkey.c delete.c edit.c                      \
82         engine.h engine-backend.h engine.c rungpg.c status-table.h      \
83         $(gpgsm_components) sema.h priv-io.h $(system_components)       \
84         debug.c debug.h gpgme.c version.c error.c
85
86 libgpgme_la_SOURCES = ath.h ath.c
87 libgpgme_pthread_la_SOURCES = ath.h ath-pthread.c
88 libgpgme_pth_la_SOURCES = ath.h ath-pth.c
89
90 AM_CPPFLAGS = $(assuan_cppflags) @GPG_ERROR_CFLAGS@
91
92
93 if HAVE_W32_SYSTEM
94
95 LTRCCOMPILE = $(LIBTOOL) --mode=compile $(RC) \
96      `echo $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) | \
97      sed -e 's/-I/--include-dir /g;s/-D/--define /g'`
98
99 %.lo : %.rc
100         $(LTRCCOMPILE) -i $< -o $@
101
102 gpgme_res = versioninfo.lo
103 gpgme_res_ldflag = -Wl,.libs/versioninfo.o
104 no_undefined = -no-undefined
105 export_symbols = -export-symbols $(srcdir)/gpgme.def
106
107 install-def-file:
108         $(INSTALL) $(srcdir)/gpgme.def $(DESTDIR)$(libdir)/gpgme.def
109
110 uninstall-def-file:
111         -rm $(DESTDIR)$(libdir)/gpgme.def
112
113 gpgme_deps = $(gpgme_res) gpgme.def
114
115 else
116 gpgme_res =
117 gpgme_res_ldflag =
118 no_undefined =
119 export_symbols =
120 install-def-file:
121 uninstall-def-file:
122
123 gpgme_deps =
124 endif
125
126 libgpgme_la_LDFLAGS = $(gpgme_res_ldflag) $(no_undefined) $(export_symbols) \
127         $(libgpgme_version_script_cmd) -version-info \
128         @LIBGPGME_LT_CURRENT@:@LIBGPGME_LT_REVISION@:@LIBGPGME_LT_AGE@
129 libgpgme_la_DEPENDENCIES = libgpgme-real.la $(assuan_libobjs) \
130         @LTLIBOBJS@ $(srcdir)/libgpgme.vers $(gpgme_deps)
131 libgpgme_la_LIBADD = libgpgme-real.la $(assuan_libobjs) @LTLIBOBJS@ \
132         @GPG_ERROR_LIBS@
133
134 libgpgme_pthread_la_LDFLAGS = $(libgpgme_version_script_cmd) -version-info \
135         @LIBGPGME_LT_CURRENT@:@LIBGPGME_LT_REVISION@:@LIBGPGME_LT_AGE@
136 libgpgme_pthread_la_DEPENDENCIES = libgpgme-real.la $(assuan_libobjs) \
137         @LTLIBOBJS@ $(srcdir)/libgpgme.vers
138 libgpgme_pthread_la_LIBADD = libgpgme-real.la $(assuan_libobjs) @LTLIBOBJS@ \
139         -lpthread @GPG_ERROR_LIBS@
140
141 libgpgme_pth_la_CFLAGS = $(AM_CFLAGS) @PTH_CFLAGS@
142 libgpgme_pth_la_CPPFLAGS = $(AM_CPPFLAGS) @PTH_CPPFLAGS@
143 libgpgme_pth_la_LDFLAGS = @PTH_LDFLAGS@ \
144         $(libgpgme_version_script_cmd) -version-info \
145         @LIBGPGME_LT_CURRENT@:@LIBGPGME_LT_REVISION@:@LIBGPGME_LT_AGE@
146 libgpgme_pth_la_DEPENDENCIES = libgpgme-real.la $(assuan_libobjs) \
147         @LTLIBOBJS@ $(srcdir)/libgpgme.vers
148 libgpgme_pth_la_LIBADD = libgpgme-real.la $(assuan_libobjs) @LTLIBOBJS@ \
149         @PTH_LIBS@ @GPG_ERROR_LIBS@
150
151 status-table.h : gpgme.h
152         $(srcdir)/mkstatus < $(srcdir)/gpgme.h > status-table.h
153
154 install-data-local: install-def-file
155   
156 uninstall-local: uninstall-def-file