fixed c+p error and a typo
[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
105 no_undefined = -no-undefined
106 export_symbols = -export-symbols $(srcdir)/gpgme.def
107
108 install-def-file:
109         $(INSTALL) $(srcdir)/gpgme.def $(DESTDIR)$(libdir)/gpgme.def
110
111 uninstall-def-file:
112         -rm $(DESTDIR)$(libdir)/gpgme.def
113
114 gpgme_deps = $(gpgme_res) gpgme.def
115
116 else
117 gpgme_res =
118 gpgme_res_ldflag =
119 no_undefined =
120 export_symbols =
121 install-def-file:
122 uninstall-def-file:
123
124 gpgme_deps =
125 endif
126
127 libgpgme_la_LDFLAGS = $(gpgme_res_ldflag) $(no_undefined) $(export_symbols) \
128         $(libgpgme_version_script_cmd) -version-info \
129         @LIBGPGME_LT_CURRENT@:@LIBGPGME_LT_REVISION@:@LIBGPGME_LT_AGE@
130 libgpgme_la_DEPENDENCIES = libgpgme-real.la $(assuan_libobjs) \
131         @LTLIBOBJS@ $(srcdir)/libgpgme.vers $(gpgme_deps)
132 libgpgme_la_LIBADD = libgpgme-real.la $(assuan_libobjs) @LTLIBOBJS@ \
133         @GPG_ERROR_LIBS@
134
135 libgpgme_pthread_la_LDFLAGS = $(libgpgme_version_script_cmd) -version-info \
136         @LIBGPGME_LT_CURRENT@:@LIBGPGME_LT_REVISION@:@LIBGPGME_LT_AGE@
137 libgpgme_pthread_la_DEPENDENCIES = libgpgme-real.la $(assuan_libobjs) \
138         @LTLIBOBJS@ $(srcdir)/libgpgme.vers
139 libgpgme_pthread_la_LIBADD = libgpgme-real.la $(assuan_libobjs) @LTLIBOBJS@ \
140         -lpthread @GPG_ERROR_LIBS@
141
142 libgpgme_pth_la_CFLAGS = $(AM_CFLAGS) @PTH_CFLAGS@
143 libgpgme_pth_la_CPPFLAGS = $(AM_CPPFLAGS) @PTH_CPPFLAGS@
144 libgpgme_pth_la_LDFLAGS = @PTH_LDFLAGS@ \
145         $(libgpgme_version_script_cmd) -version-info \
146         @LIBGPGME_LT_CURRENT@:@LIBGPGME_LT_REVISION@:@LIBGPGME_LT_AGE@
147 libgpgme_pth_la_DEPENDENCIES = libgpgme-real.la $(assuan_libobjs) \
148         @LTLIBOBJS@ $(srcdir)/libgpgme.vers
149 libgpgme_pth_la_LIBADD = libgpgme-real.la $(assuan_libobjs) @LTLIBOBJS@ \
150         @PTH_LIBS@ @GPG_ERROR_LIBS@
151
152 status-table.h : gpgme.h
153         $(srcdir)/mkstatus < $(srcdir)/gpgme.h > status-table.h
154
155 install-data-local: install-def-file
156
157 uninstall-local: uninstall-def-file