Imported Upstream version 1.4.0
[platform/upstream/libksba.git] / src / Makefile.am
1 # Makefile.am - for the KSBA ASN.1 and X.509 library
2 #       Copyright (C) 2001, 2002, 2004, 2005, 2007 g10 Code GmbH
3 #
4 # This file is part of KSBA.
5 #
6 # KSBA is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 3 of the License, or
9 # (at your option) any later version.
10 #
11 # KSBA is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, see <http://www.gnu.org/licenses/>.
18
19 ## Process this file with automake to produce Makefile.in
20
21 pkgconfigdir = $(libdir)/pkgconfig
22 pkgconfig_DATA = ksba.pc
23
24 asn1_modules = tmttv2.asn cms.asn
25
26 buildtool_src = asn1-gentables.c gen-help.c gen-help.h
27 EXTRA_DIST = ksba.h.in ksba-config.in $(asn1_modules) ksba.m4 \
28              libksba.vers libksba.def \
29              asn1-parse.c asn1-tables.c $(buildtool_src) ksba.pc.in
30 BUILT_SOURCES = asn1-parse.c asn1-tables.c
31 bin_SCRIPTS = ksba-config
32 nodist_include_HEADERS = ksba.h
33 lib_LTLIBRARIES = libksba.la
34 noinst_PROGRAMS = ber-dump
35
36 m4datadir = $(datadir)/aclocal
37 m4data_DATA = ksba.m4
38
39 CLEANFILES = asn1-gentables
40 DISTCLEANFILES = asn1-tables.c
41
42 AM_CPPFLAGS =  -I$(top_builddir)/gl -I$(top_srcdir)/gl
43 AM_CFLAGS = $(GPG_ERROR_CFLAGS) $(COVERAGE_CFLAGS)
44
45
46 if HAVE_LD_VERSION_SCRIPT
47   libksba_version_script_cmd = -Wl,--version-script=$(srcdir)/libksba.vers
48 else
49   libksba_version_script_cmd =
50 endif
51
52
53 if HAVE_W32_SYSTEM
54 RCCOMPILE = $(RC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
55         $(libksba_la_CPPFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS)
56 LTRCCOMPILE = $(LIBTOOL) --mode=compile --tag=RC $(RCCOMPILE)
57
58 SUFFIXES = .rc .lo
59
60 .rc.lo:
61         $(LTRCCOMPILE) -i "$<" -o "$@"
62
63 ksba_res = versioninfo.lo
64 no_undefined = -no-undefined
65 export_symbols = -export-symbols $(srcdir)/libksba.def
66 extra_ltoptions = -XCClinker -static-libgcc
67
68 install-def-file:
69         $(INSTALL) $(srcdir)/libksba.def $(DESTDIR)$(libdir)/libksba.def
70
71 uninstall-def-file:
72         -rm $(DESTDIR)$(libdir)/libksba.def
73
74 ksba_deps = $(ksba_res) libksba.def
75
76 else !HAVE_W32_SYSTEM
77 ksba_res =
78 no_undefined =
79 export_symbols =
80 extra_ltoptions =
81 ksba_deps =
82 install-def-file:
83 uninstall-def-file:
84 endif !HAVE_W32_SYSTEM
85
86
87 libksba_la_LDFLAGS = $(no_undefined) $(export_symbols) $(extra_ltoptions) \
88       $(libksba_version_script_cmd) -version-info \
89       @LIBKSBA_LT_CURRENT@:@LIBKSBA_LT_REVISION@:@LIBKSBA_LT_AGE@ \
90       $(COVERAGE_LDFLAGS)
91 libksba_la_INCLUDES = -I$(top_srcdir)/lib
92 libksba_la_DEPENDENCIES = $(srcdir)/libksba.vers $(ksba_deps)
93 libksba_la_LIBADD = $(ksba_res) @LTLIBOBJS@ @GPG_ERROR_LIBS@
94
95
96 libksba_la_SOURCES = \
97         ksba.h \
98         visibility.c visibility.h \
99         reader.c reader.h \
100         writer.c writer.h \
101         asn1-parse.y \
102         asn1-func.c asn1-func2.c asn1-func.h asn1-constants.h \
103         ber-help.c ber-help.h \
104         ber-decoder.c ber-decoder.h \
105         der-encoder.c der-encoder.h \
106         der-builder.c der-builder.h \
107         cert.c cert.h \
108         cms.c cms.h cms-parser.c \
109         crl.c crl.h \
110         certreq.c certreq.h \
111         ocsp.c ocsp.h \
112         keyinfo.c keyinfo.h \
113         oid.c name.c dn.c time.c convert.h stringbuf.h \
114         version.c util.c util.h shared.h \
115         sexp-parse.h \
116         asn1-tables.c
117
118 ber_dump_SOURCES = ber-dump.c \
119                    ber-decoder.c ber-help.c reader.c writer.c asn1-parse.c \
120                    asn1-func.c oid.c time.c util.c
121 ber_dump_LDADD = $(GPG_ERROR_LIBS) ../gl/libgnu.la
122 ber_dump_CFLAGS = $(AM_CFLAGS)
123
124 asn1-parse.c : asn1-func.h gen-help.h
125
126 asn1-gentables: asn1-gentables.c asn1-parse.c asn1-func.c gen-help.c gen-help.h
127         $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) \
128                 $(CPPFLAGS_FOR_BUILD) -I$(srcdir) -DBUILD_GENTOOLS -o $@ \
129                 $(srcdir)/asn1-gentables.c \
130                 `test -f 'asn1-parse.c' || echo '$(srcdir)/'`asn1-parse.c  \
131                 $(srcdir)/asn1-func.c      \
132                 $(srcdir)/gen-help.c
133
134 asn1-tables.c : $(asn1_modules) asn1-gentables
135         @set -e; list=""; \
136           for file in $(asn1_modules); do list="$$list $(srcdir)/$$file";done;\
137           ./asn1-gentables $$list > asn1-tables.c
138
139
140 install-data-local: install-def-file
141
142 uninstall-local: uninstall-def-file