Fixed CPPFLAGS for Guile code and documentation.
[gnutls.git] / guile / src / Makefile.am
blob6d65b371d56c1c407030c3a9a59747b10bf84801
1 #  GNUTLS -- Guile bindings for GnuTLS.
2 #  Copyright (C) 2007  Free Software Foundation
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.
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.
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
18 GUILE_FOR_BUILD = $(GUILE) -L $(top_srcdir)/guile/modules
20 noinst_HEADERS = errors.h utils.h
22 EXTRA_DIST =                                    \
23   make-enum-map.scm make-smob-types.scm         \
24   make-enum-header.scm make-smob-header.scm     \
25   make-session-priorities.scm
27 BUILT_SOURCES = enum-map.i.c smob-types.i.c enums.h smobs.h     \
28                 priorities.i.c                                  \
29                 extra-smobs.h extra-enums.h                     \
30                 extra-enum-map.i.c extra-smob-types.i.c         \
31                 core.x errors.x extra.x
33 CLEANFILES = $(BUILT_SOURCES)
35 lib_LTLIBRARIES = libguile-gnutls-v-0.la libguile-gnutls-extra-v-0.la
37 # Linking against GnuTLS.
38 GNUTLS_CORE_LIBS  = $(top_builddir)/lib/libgnutls.la
39 GNUTLS_EXTRA_LIBS = $(top_builddir)/libextra/libgnutls-extra.la
41 # Linking against Gnulib modules.
42 GNULIB_LIBS    = $(top_builddir)/lgl/liblgnu.la
43 GNULIB_CFLAGS  = -I$(top_builddir)/lgl -I$(top_srcdir)/lgl
46 libguile_gnutls_v_0_la_SOURCES = core.c errors.c utils.c
47 libguile_gnutls_v_0_la_CFLAGS =                 \
48   $(AM_CFLAGS) $(GNULIB_CFLAGS) $(GUILE_CFLAGS)
49 libguile_gnutls_v_0_la_LIBADD = \
50         $(GNUTLS_CORE_LIBS) $(GNULIB_LIBS) \
51         $(GUILE_LDFLAGS)
53 libguile_gnutls_extra_v_0_la_SOURCES = extra.c
54 libguile_gnutls_extra_v_0_la_CFLAGS =           \
55   $(AM_CFLAGS) $(GNULIB_CFLAGS) $(GUILE_CFLAGS)
56 libguile_gnutls_extra_v_0_la_LIBADD =           \
57   $(GNUTLS_CORE_LIBS) $(GNUTLS_EXTRA_LIBS)      \
58   $(builddir)/libguile-gnutls-v-0.la            \
59   $(GNULIB_LIBS) $(GUILE_LDFLAGS)
61 AM_CPPFLAGS = -I$(top_srcdir)/includes -I$(top_builddir)/includes       \
62               -I$(top_builddir) -I$(builddir)
64 if HAVE_GCC
66 # Generated `.x' files and Guile's `scm_c_define_gsubr ()' require
67 # `-Wno-strict-prototypes'.  This trick makes sure `-Wno-s-p' appears
68 # after `-Ws-p'.
69 AM_CFLAGS += -Wno-strict-prototypes
71 endif
73 enums.h: $(srcdir)/make-enum-header.scm
74         $(GUILE_FOR_BUILD) $^ > $@
76 enum-map.i.c: $(srcdir)/make-enum-map.scm
77         $(GUILE_FOR_BUILD) $^ > $@
79 smobs.h: $(srcdir)/make-smob-header.scm
80         $(GUILE_FOR_BUILD) $^ > $@
82 smob-types.i.c: $(srcdir)/make-smob-types.scm
83         $(GUILE_FOR_BUILD) $^ > $@
85 priorities.i.c: $(srcdir)/make-session-priorities.scm
86         $(GUILE_FOR_BUILD) $^ > $@
89 # GnuTLS-extra
91 extra-enums.h: $(srcdir)/make-enum-header.scm
92         $(GUILE_FOR_BUILD) $^ extra > $@
94 extra-enum-map.i.c: $(srcdir)/make-enum-map.scm
95         $(GUILE_FOR_BUILD) $^ extra > $@
97 extra-smobs.h: $(srcdir)/make-smob-header.scm
98         $(GUILE_FOR_BUILD) $^ extra > $@
100 extra-smob-types.i.c: $(srcdir)/make-smob-types.scm
101         $(GUILE_FOR_BUILD) $^ extra > $@
104 # C file snarfing.
106 snarfcppopts = $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
107                $(CFLAGS) $(AM_CFLAGS)
109 .c.x:
110         $(guile_snarf) -o $@ $< $(snarfcppopts)
112 # Target used by doc/Makefile, to create all built sources necessary
113 # for generating the manual.
115 .PHONY: built-sources
116 built-sources: $(BUILT_SOURCES)