Tizen 2.0 Release
[external/libgnutls26.git] / guile / src / Makefile.am
1 #  GnuTLS --- Guile bindings for GnuTLS.
2 #  Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
3 #
4 #  GnuTLS is free software; you can redistribute it and/or
5 #  modify it under the terms of the GNU Lesser General Public
6 #  License as published by the Free Software Foundation; either
7 #  version 2.1 of the License, or (at your option) any later version.
8 #
9 #  GnuTLS is distributed in the hope that it will be useful,
10 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
11 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12 #  Lesser General Public License for more details.
13 #
14 #  You should have received a copy of the GNU Lesser General Public
15 #  License along with GnuTLS; if not, write to the Free Software
16 #  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
17
18 GUILE_FOR_BUILD =                                               \
19   GUILE_AUTO_COMPILE=0 $(GUILE) -L $(top_srcdir)/guile/modules
20
21 noinst_HEADERS = errors.h utils.h
22
23 EXTRA_DIST =                                    \
24   make-enum-map.scm make-smob-types.scm         \
25   make-enum-header.scm make-smob-header.scm     \
26   make-session-priorities.scm
27
28 BUILT_SOURCES = enum-map.i.c smob-types.i.c enums.h smobs.h     \
29                 priorities.i.c                                  \
30                 extra-smobs.h extra-enums.h                     \
31                 extra-enum-map.i.c extra-smob-types.i.c         \
32                 core.x errors.x extra.x
33
34 CLEANFILES = $(BUILT_SOURCES)
35
36 lib_LTLIBRARIES = libguile-gnutls-v-1.la libguile-gnutls-extra-v-1.la
37
38 # Linking against GnuTLS.
39 GNUTLS_CORE_LIBS  = $(top_builddir)/lib/libgnutls.la
40 GNUTLS_EXTRA_LIBS = $(top_builddir)/libextra/libgnutls-extra.la
41
42 # Linking against Gnulib modules.
43 GNULIB_LIBS    = $(top_builddir)/lib/gl/liblgnu.la
44 GNULIB_CFLAGS  = -I$(top_builddir)/lib/gl -I$(top_srcdir)/lib/gl
45
46
47 libguile_gnutls_v_1_la_SOURCES = core.c errors.c utils.c
48 libguile_gnutls_v_1_la_CFLAGS =                 \
49   $(AM_CFLAGS) $(GNULIB_CFLAGS) $(GUILE_CFLAGS)
50 libguile_gnutls_v_1_la_LIBADD = \
51         $(GNUTLS_CORE_LIBS) $(GNULIB_LIBS) \
52         $(GUILE_LDFLAGS)
53
54 libguile_gnutls_extra_v_1_la_SOURCES = extra.c
55 libguile_gnutls_extra_v_1_la_CFLAGS =           \
56   $(AM_CFLAGS) $(GNULIB_CFLAGS) $(GUILE_CFLAGS)
57 libguile_gnutls_extra_v_1_la_LIBADD =           \
58   $(GNUTLS_CORE_LIBS) $(GNUTLS_EXTRA_LIBS)      \
59   $(builddir)/libguile-gnutls-v-1.la            \
60   $(GNULIB_LIBS) $(GUILE_LDFLAGS)
61
62 AM_CPPFLAGS = \
63         -I$(top_srcdir)/lib/includes \
64         -I$(top_builddir)/lib/includes  \
65         -I$(top_srcdir)/libextra/includes \
66         -I$(top_builddir) \
67         -I$(builddir)
68
69 if HAVE_GCC
70
71 # Generated `.x' files and Guile's `scm_c_define_gsubr ()' require
72 # `-Wno-strict-prototypes'.  This trick makes sure `-Wno-s-p' appears
73 # after `-Ws-p'.
74 AM_CFLAGS = -Wno-strict-prototypes
75
76 # The `-fgnu89-inline' option appeared in GCC 4.1.3.
77 if HAVE_GCC_GNU89_INLINE_OPTION
78
79 # Guile and GMP currently rely on GNU inline semantics, not C99 inline.
80 AM_CFLAGS += -fgnu89-inline
81
82 endif HAVE_GCC_GNU89_INLINE_OPTION
83
84 endif HAVE_GCC
85
86
87 enums.h: $(srcdir)/make-enum-header.scm
88         $(GUILE_FOR_BUILD) $^ > $@
89
90 enum-map.i.c: $(srcdir)/make-enum-map.scm
91         $(GUILE_FOR_BUILD) $^ > $@
92
93 smobs.h: $(srcdir)/make-smob-header.scm
94         $(GUILE_FOR_BUILD) $^ > $@
95
96 smob-types.i.c: $(srcdir)/make-smob-types.scm
97         $(GUILE_FOR_BUILD) $^ > $@
98
99 priorities.i.c: $(srcdir)/make-session-priorities.scm
100         $(GUILE_FOR_BUILD) $^ > $@
101
102
103 # GnuTLS-extra
104
105 extra-enums.h: $(srcdir)/make-enum-header.scm
106         $(GUILE_FOR_BUILD) $^ extra > $@
107
108 extra-enum-map.i.c: $(srcdir)/make-enum-map.scm
109         $(GUILE_FOR_BUILD) $^ extra > $@
110
111 extra-smobs.h: $(srcdir)/make-smob-header.scm
112         $(GUILE_FOR_BUILD) $^ extra > $@
113
114 extra-smob-types.i.c: $(srcdir)/make-smob-types.scm
115         $(GUILE_FOR_BUILD) $^ extra > $@
116
117
118 # C file snarfing.
119
120 # `$(GUILE_CFLAGS)' may contain a series of `-I' switches so it must be
121 # included here, even though we'd really want `$(GUILE_CPPFLAGS)'.
122 snarfcppopts = $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
123                $(CFLAGS) $(AM_CFLAGS) $(GUILE_CFLAGS)
124
125 .c.x: $(BUILT_SOURCES)
126         $(guile_snarf) -o $@ $< $(snarfcppopts)
127
128 # Target used by doc/Makefile, to create all built sources necessary
129 # for generating the manual.
130
131 .PHONY: built-sources
132 built-sources: $(BUILT_SOURCES)