b8f27f977ca0e0480ca93bb8b30ed2b0fd908324
[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                                                       \
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 libgpgme_la_LDFLAGS = $(libgpgme_version_script_cmd) -version-info \
93         @LIBGPGME_LT_CURRENT@:@LIBGPGME_LT_REVISION@:@LIBGPGME_LT_AGE@
94 libgpgme_la_DEPENDENCIES = libgpgme-real.la $(assuan_libobjs) \
95         @LTLIBOBJS@ $(srcdir)/libgpgme.vers
96 libgpgme_la_LIBADD = libgpgme-real.la $(assuan_libobjs) @LTLIBOBJS@ \
97         @GPG_ERROR_LIBS@
98
99 libgpgme_pthread_la_LDFLAGS = $(libgpgme_version_script_cmd) -version-info \
100         @LIBGPGME_LT_CURRENT@:@LIBGPGME_LT_REVISION@:@LIBGPGME_LT_AGE@
101 libgpgme_pthread_la_DEPENDENCIES = libgpgme-real.la $(assuan_libobjs) \
102         @LTLIBOBJS@ $(srcdir)/libgpgme.vers
103 libgpgme_pthread_la_LIBADD = libgpgme-real.la $(assuan_libobjs) @LTLIBOBJS@ \
104         -lpthread @GPG_ERROR_LIBS@
105
106 libgpgme_pth_la_CFLAGS = $(AM_CFLAGS) @PTH_CFLAGS@
107 libgpgme_pth_la_CPPFLAGS = $(AM_CPPFLAGS) @PTH_CPPFLAGS@
108 libgpgme_pth_la_LDFLAGS = @PTH_LDFLAGS@ \
109         $(libgpgme_version_script_cmd) -version-info \
110         @LIBGPGME_LT_CURRENT@:@LIBGPGME_LT_REVISION@:@LIBGPGME_LT_AGE@
111 libgpgme_pth_la_DEPENDENCIES = libgpgme-real.la $(assuan_libobjs) \
112         @LTLIBOBJS@ $(srcdir)/libgpgme.vers
113 libgpgme_pth_la_LIBADD = libgpgme-real.la $(assuan_libobjs) @LTLIBOBJS@ \
114         @PTH_LIBS@ @GPG_ERROR_LIBS@
115
116 status-table.h : gpgme.h
117         $(srcdir)/mkstatus < $(srcdir)/gpgme.h > status-table.h
118
119 # Special code to build a DLL.  The current libtool (1.5.6) is not
120 # able to do this properly; we better use gcc's built in magic.  
121 if HAVE_W32_SYSTEM
122
123 w32_o_files = ath.o conversion.o data-compat.o data-fd.o \
124               data-mem.o data-stream.o data-user.o data.o debug.o \
125               decrypt-verify.o decrypt.o delete.o edit.o encrypt-sign.o \
126               encrypt.o engine-gpgsm.o engine.o error.o export.o genkey.o \
127               get-env.o gpgme.o import.o key.o keylist.o memrchr.o \
128               op-support.o passphrase.o progress.o putc_unlocked.o \
129               rungpg.o sign.o signers.o trust-item.o trustlist.o \
130               ttyname_r.o vasprintf.o verify.o version.o \
131               w32-io.o w32-sema.o w32-util.o \
132               wait-global.o wait-private.o wait-user.o wait.o
133
134 all-local: gpgme.dll gpgme.dll.a
135
136 install-exec-hook:
137         cp gpgme.dll gpgme.dll.a $(DESTDIR)$(libdir)/
138         $(STRIP) $(DESTDIR)$(libdir)/gpgme.dll
139
140 gpgme.dll gpgme.dll.a: gpgme.def $(w32_o_files) versioninfo.o
141         $(CC) -shared -o gpgme.dll gpgme.def $(w32_o_files) \
142            versioninfo.o @GPG_ERROR_LIBS@ -Wl,--out-implib,gpgme.dll.a
143
144
145 .rc.o:
146         $(WINDRES) `test -f '$<' || echo '$(srcdir)/'`$< $@
147
148 endif