summaryrefslogtreecommitdiff
path: root/guile/src/Makefile.am
blob: 7db4bec7bb71b345e647cd326c3c0ec481f9ea5e (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
#  GNUTLS -- Guile bindings for GnuTLS.
#  Copyright (C) 2007  Free Software Foundation
#
#  GNUTLS 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.
#
#  GNUTLS 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 GNUTLS; if not, write to the Free Software
#  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA

GUILE_FOR_BUILD = $(GUILE) -L $(top_srcdir)/guile/modules

noinst_HEADERS = errors.h utils.h

EXTRA_DIST =					\
  make-enum-map.scm make-smob-types.scm		\
  make-enum-header.scm make-smob-header.scm	\
  make-session-priorities.scm

BUILT_SOURCES = enum-map.i.c smob-types.i.c enums.h smobs.h	\
		priorities.i.c					\
		extra-smobs.h extra-enums.h			\
		extra-enum-map.i.c extra-smob-types.i.c		\
                core.x errors.x extra.x

CLEANFILES = $(BUILT_SOURCES)

lib_LTLIBRARIES = libguile-gnutls-v-0.la libguile-gnutls-extra-v-0.la

# Linking against GnuTLS.
GNUTLS_CORE_LIBS  = $(top_builddir)/lib/libgnutls.la
GNUTLS_EXTRA_LIBS = $(top_builddir)/libextra/libgnutls-extra.la

# Linking against Gnulib modules.
GNULIB_LIBS    = $(top_builddir)/lgl/liblgnu.la
GNULIB_CFLAGS  = -I$(top_builddir)/lgl -I$(top_srcdir)/lgl


libguile_gnutls_v_0_la_SOURCES = core.c errors.c utils.c
libguile_gnutls_v_0_la_CFLAGS =			\
  $(AM_CFLAGS) $(GNULIB_CFLAGS) $(GUILE_CFLAGS)
libguile_gnutls_v_0_la_LDFLAGS = $(GUILE_LDFLAGS)
libguile_gnutls_v_0_la_LIBADD =			\
  $(GNUTLS_CORE_LIBS) $(GNULIB_LIBS)

libguile_gnutls_extra_v_0_la_SOURCES = extra.c
libguile_gnutls_extra_v_0_la_CFLAGS =		\
  $(AM_CFLAGS) $(GNULIB_CFLAGS) $(GUILE_CFLAGS)
libguile_gnutls_extra_v_0_la_LDFLAGS = $(GUILE_LDFLAGS)
libguile_gnutls_extra_v_0_la_LIBADD =		\
  $(GNUTLS_CORE_LIBS) $(GNUTLS_EXTRA_LIBS)	\
  $(builddir)/libguile-gnutls-v-0.la		\
  $(GNULIB_LIBS)

AM_CPPFLAGS = -I$(top_builddir) -I$(builddir)

if HAVE_GCC

# Generated `.x' files and Guile's `scm_c_define_gsubr ()' require
# `-Wno-strict-prototypes'.  This trick makes sure `-Wno-s-p' appears
# after `-Ws-p'.
AM_CFLAGS += -Wno-strict-prototypes

endif

enums.h: $(srcdir)/make-enum-header.scm
	$(GUILE_FOR_BUILD) $^ > $@

enum-map.i.c: $(srcdir)/make-enum-map.scm
	$(GUILE_FOR_BUILD) $^ > $@

smobs.h: $(srcdir)/make-smob-header.scm
	$(GUILE_FOR_BUILD) $^ > $@

smob-types.i.c: $(srcdir)/make-smob-types.scm
	$(GUILE_FOR_BUILD) $^ > $@

priorities.i.c: $(srcdir)/make-session-priorities.scm
	$(GUILE_FOR_BUILD) $^ > $@


# GnuTLS-extra

extra-enums.h: $(srcdir)/make-enum-header.scm
	$(GUILE_FOR_BUILD) $^ extra > $@

extra-enum-map.i.c: $(srcdir)/make-enum-map.scm
	$(GUILE_FOR_BUILD) $^ extra > $@

extra-smobs.h: $(srcdir)/make-smob-header.scm
	$(GUILE_FOR_BUILD) $^ extra > $@

extra-smob-types.i.c: $(srcdir)/make-smob-types.scm
	$(GUILE_FOR_BUILD) $^ extra > $@


# C file snarfing.

snarfcppopts = $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
	       $(CFLAGS) $(AM_CFLAGS)

.c.x:
	$(guile_snarf) -o $@ $< $(snarfcppopts)