Debian Codegraph @

guile/src/Makefile.am

raw
1 # Guile-GnuTLS --- Guile bindings for GnuTLS.
2 # Copyright (C) 2007-2025 Free Software Foundation, Inc.
3 #
4 # This file is part of Guile-GnuTLS.
5 #
6 # This program 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 # This program 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 <https://www.gnu.org/licenses/>.
18
19 GUILE_FOR_BUILD = \
20 GUILE_AUTO_COMPILE=0 $(GUILE) -L $(top_srcdir)/guile/modules
21
22 noinst_HEADERS = errors.h utils.h
23
24 EXTRA_DIST = \
25 make-enum-map.scm make-smob-types.scm \
26 make-enum-header.scm make-smob-header.scm
27
28 # Files generated by the (gnutls build ...) modules.
29 GENERATED_BINDINGS = \
30 enum-map.i.c smob-types.i.c enums.h smobs.h
31
32 BUILT_SOURCES = \
33 $(GENERATED_BINDINGS) \
34 core.x errors.x
35
36 CLEANFILES = $(BUILT_SOURCES)
37
38 guileextension_LTLIBRARIES = guile-gnutls-v-2.la
39
40 # Use '-module' to build a "dlopenable module", in Libtool terms.
41 # Use '-undefined' to placate Libtool on Windows; see
42 # <https://lists.gnutls.org/pipermail/gnutls-devel/2014-December/007294.html>.
43 guile_gnutls_v_2_la_LDFLAGS = -module -no-undefined
44
45 guile_gnutls_v_2_la_SOURCES = core.c errors.c utils.c
46 guile_gnutls_v_2_la_CFLAGS = \
47 $(AM_CFLAGS) $(GNULIB_CFLAGS) $(GUILE_CFLAGS) $(GNUTLS_CFLAGS)
48 guile_gnutls_v_2_la_LIBADD = \
49 $(GNUTLS_LIBS) \
50 $(GUILE_LDFLAGS)
51
52 AM_CPPFLAGS = \
53 -I$(top_srcdir)/lib/includes \
54 -I$(top_builddir)/lib/includes \
55 -I$(top_srcdir)/extra/includes \
56 -I$(top_builddir) \
57 -I$(builddir)
58
59 if HAVE_GCC
60
61 AM_CFLAGS = -Wall -Wextra
62
63 # Generated `.x' files and Guile's `scm_c_define_gsubr ()' require
64 # `-Wno-strict-prototypes'. This trick makes sure `-Wno-s-p' appears
65 # after `-Ws-p'.
66 AM_CFLAGS += -Wno-strict-prototypes
67
68 # Functions generated from 'SCM_SMOB_PRINT' & co. typically have
69 # unused parameters.
70 AM_CFLAGS += -Wno-unused-parameter
71
72 # The `-fgnu89-inline' option appeared in GCC 4.1.3.
73 if HAVE_GCC_GNU89_INLINE_OPTION
74
75 # Guile and GMP currently rely on GNU inline semantics, not C99 inline.
76 AM_CFLAGS += -fgnu89-inline
77
78 endif HAVE_GCC_GNU89_INLINE_OPTION
79
80 endif HAVE_GCC
81
82
83 enums.h: $(srcdir)/make-enum-header.scm $(top_srcdir)/guile/modules/gnutls/build/enums.scm
84 $(AM_V_GEN)$(GUILE_FOR_BUILD) "$<" > "[email protected]"
85 $(AM_V_at)mv "[email protected]" "$@"
86
87 enum-map.i.c: $(srcdir)/make-enum-map.scm $(top_srcdir)/guile/modules/gnutls/build/enums.scm
88 $(AM_V_GEN)$(GUILE_FOR_BUILD) "$<" > "[email protected]"
89 $(AM_V_at)mv "[email protected]" "$@"
90
91 smobs.h: $(srcdir)/make-smob-header.scm $(top_srcdir)/guile/modules/gnutls/build/smobs.scm
92 $(AM_V_GEN)$(GUILE_FOR_BUILD) "$<" > "[email protected]"
93 $(AM_V_at)mv "[email protected]" "$@"
94
95 smob-types.i.c: $(srcdir)/make-smob-types.scm $(top_srcdir)/guile/modules/gnutls/build/smobs.scm
96 $(AM_V_GEN)$(GUILE_FOR_BUILD) "$<" > "[email protected]"
97 $(AM_V_at)mv "[email protected]" "$@"
98
99
100 # C file snarfing.
101
102 # `$(GUILE_CFLAGS)' may contain a series of `-I' switches so it must be
103 # included here, even though we'd really want `$(GUILE_CPPFLAGS)'.
104 snarfcppopts = $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
105 $(CFLAGS) $(guile_gnutls_v_2_la_CFLAGS)
106
107 # Note: we cannot use the portable ".c.x" form, since that leads
108 # prerequisites to be ignored:
109 # <https://lists.gnutls.org/pipermail/gnutls-devel/2013-September/006453.html>.
110 %.x: %.c $(GENERATED_BINDINGS)
111 $(AM_V_GEN)$(guile_snarf) -o $@ $< $(snarfcppopts)
112
113 # Target used by doc/Makefile, to create all built sources necessary
114 # for generating the manual.
115
116 .PHONY: built-sources
117 built-sources: $(BUILT_SOURCES)