0191e8472121438165085ced5c59bc8e8afda384
[crypto.git] / lib / Makefile.ad
1 #
2 #  Makefile.am
3 #
4 #  Author: Pekka Riikonen <priikone@silcnet.org>
5 #
6 #  Copyright (C) 2000 - 2008 Pekka Riikonen
7 #
8 #  This program is free software; you can redistribute it and/or modify
9 #  it under the terms of the GNU General Public License as published by
10 #  the Free Software Foundation; version 2 of the License.
11 #
12 #  This program is distributed in the hope that it will be useful,
13 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
14 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 #  GNU General Public License for more details.
16 #
17
18 AUTOMAKE_OPTIONS = 1.0 no-dependencies foreign
19
20 # Library dirs
21 CRYPTO_DIRS =           \
22         silccrypt       \
23         silcskr         \
24         silcmath        \
25         silcasn1        \
26         silcacc         \
27 #ifdef SILC_DIST_SSH
28         silcssh         \
29 #endif SILC_DIST_SSH
30 #ifdef SILC_DIST_PGP
31         silcpgp         \
32 #endif SILC_DIST_PGP
33
34 if SILC_ENABLE_SHARED
35 if SILC_WIN32
36 LIBTOOL_OPTS= -release $(CRYPTO_BASE_VERSION) -rpath $(DESTDIR)$(libdir) \
37                -export-dynamic -no-undefined
38 else
39 LIBTOOL_OPTS= -release $(CRYPTO_BASE_VERSION) -rpath $(DESTDIR)$(libdir)
40 endif
41 LIBTOOL_CRYPTO_VERSION = \
42    -version-info $(CRYPTO_CURRENT):$(CRYPTO_REVISION):$(CRYPTO_AGE)
43 else
44 LIBTOOL_OPTS=
45 LIBTOOL_CRYPTO_VERSION =
46 endif
47 if SILC_WIN32
48 CRYPTO_LINK_LIBS=$(LIBS)
49 else
50 CRYPTO_LINK_LIBS=
51 endif
52
53 CRYPTO_LIB = libsct.a
54
55 SUBDIRS = $(CRYPTO_DIRS)
56
57 CLEANFILES = $(CRYPTO_LIB)
58 DISTCLEANFILES = $(CRYPTO_LIB)
59
60 remove:
61         -rm -f $(CLEANFILES)
62
63 all:
64         $(MAKE) remove $(CRYPTO_LIB)
65
66 install-exec-hook:
67         -mkdir -p $(DESTDIR)$(libdir)
68         -$(LIBTOOL) $(INSTALL) libsct.la $(DESTDIR)$(libdir)/
69
70 libsct.a:
71         find $(CRYPTO_DIRS) -type f -name *.lo | xargs \
72         $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) \
73         $(CRYPTO_LINK_LIBS) \
74         $(LIBTOOL_CRYPTO_VERSION) \
75         $(LIBTOOL_OPTS) -o libsct.la
76
77 pkgconfigdir = $(libdir)/pkgconfig
78 pkgconfig_DATA = sct.pc
79
80 EXTRA_DIST = sct.pc.in
81
82 include $(top_srcdir)/Makefile.defines.in