summaryrefslogtreecommitdiff
path: root/src/Makefile.am
blob: cd01a03ca15fb22c6de663059c65246952953042 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
# Assuan Makefile
# Copyright (C) 2001, 2002, 2003, 2009, 2010 Free Software Foundation, Inc.
#
# This file is part of Assuan.
#
# Assuan is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation; either version 2.1 of
# the License, or (at your option) any later version.
#
# Assuan is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this program; if not, see <http://www.gnu.org/licenses/>.
## Process this file with automake to produce Makefile.in

EXTRA_DIST = libassuan-config.in libassuan.m4 libassuan.vers \
             versioninfo.rc.in libassuan.def mkheader.c gpgcedev.def
INCLUDES = -I.. -I$(top_srcdir)/include

bin_SCRIPTS = libassuan-config
m4datadir = $(datadir)/aclocal
m4data_DATA = libassuan.m4
lib_LTLIBRARIES = libassuan.la
if HAVE_W32CE_SYSTEM
lib_LTLIBRARIES += libgpgcedev.la
bin_PROGRAMS = gpgcemgr
endif
nodist_include_HEADERS = assuan.h

if HAVE_LD_VERSION_SCRIPT
libassuan_version_script_cmd = -Wl,--version-script=$(srcdir)/libassuan.vers
else
libassuan_version_script_cmd =
endif

CLEANFILES = mkheader assuan.h

BUILT_SOURCES = assuan.h

parts_of_assuan_h = \
	posix-includes.inc.h   w32-includes.inc.h \
	posix-types.inc.h      w32-types.inc.h \
	posix-fd-t.inc.h       w32-fd-t.inc.h  w32ce-fd-t.inc.h \
	posix-sock-nonce.inc.h w32-sock-nonce.inc.h \
	posix-sys-pth-impl.h   w32-sys-pth-impl.h \
        w32ce-add.h 

common_sources = \
	assuan.h.in $(parts_of_assuan_h) \
	assuan-defs.h \
	assuan.c context.c system.c \
	debug.c debug.h conversion.c sysutils.c \
	client.c server.c \
	assuan-error.c \
	assuan-buffer.c \
	assuan-handler.c \
	assuan-inquire.c \
	assuan-listen.c \
	assuan-pipe-server.c \
	assuan-socket-server.c \
	assuan-pipe-connect.c \
	assuan-socket-connect.c \
	assuan-uds.c \
	assuan-logging.c \
	assuan-socket.c

if HAVE_W32_SYSTEM
if HAVE_W32CE_SYSTEM
common_sources += system-w32ce.c
else
common_sources += system-w32.c
endif
else
common_sources += system-posix.c
endif


if HAVE_W32_SYSTEM

LTRCCOMPILE = $(LIBTOOL) --mode=compile $(RC) \
     `echo $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) | \
     sed -e 's/-I/--include-dir /g;s/-D/--define /g'`

SUFFIXES: .rc .lo

.rc.lo:
	$(LTRCCOMPILE) -i $< -o $@

libassuan_res = versioninfo.lo
libassuan_res_ldflag = -Wl,.libs/versioninfo.o

no_undefined = -no-undefined
export_symbols = -export-symbols $(srcdir)/libassuan.def

install-def-file:
	$(INSTALL) $(srcdir)/libassuan.def $(DESTDIR)$(libdir)/libassuan.def

uninstall-def-file:
	-rm $(DESTDIR)$(libdir)/libassuan.def

libassuan_deps = $(libassuan_res) libassuan.def

else
libassuan_res =
libassuan_res_ldflag =
no_undefined =
export_symbols =
install-def-file:
uninstall-def-file:

libassuan_deps =
endif


libassuan_la_SOURCES = $(common_sources) assuan-io.c
nodist_libassuan_la_SOURCES = assuan.h
libassuan_la_CPPFLAGS = $(AM_CPPFLAGS) @GPG_ERROR_CFLAGS@
libassuan_la_LDFLAGS = $(libassuan_res_ldflag) $(no_undefined) \
	$(export_symbols) $(libassuan_version_script_cmd) -version-info \
	@LIBASSUAN_LT_CURRENT@:@LIBASSUAN_LT_REVISION@:@LIBASSUAN_LT_AGE@
libassuan_la_DEPENDENCIES = @LTLIBOBJS@ \
	$(srcdir)/libassuan.vers $(libassuan_deps)
libassuan_la_LIBADD = @LTLIBOBJS@ @NETLIBS@ @GPG_ERROR_LIBS@

if HAVE_W32CE_SYSTEM
libgpgcedev_la_SOURCES = gpgcedev.c
libgpgcedev_la_CPPFLAGS = $(AM_CPPFLAGS)
libgpgcedev_la_LDFLAGS = $(no_undefined) -export-symbols $(srcdir)/gpgcedev.def
libgpgcedev_la_DEPENDENCIES = gpgcedev.def
gpgcemgr_SOURCES = gpgcemgr.c
gpgcemgr_CPPFLAGS = $(AM_CPPFLAGS)
endif

mkheader: mkheader.c Makefile
	$(CC_FOR_BUILD) -I. -I$(srcdir) -o $@ $(srcdir)/mkheader.c

assuan.h: assuan.h.in mkheader $(parts_of_assuan_h)
	./mkheader $(host_os) $(srcdir)/assuan.h.in >$@