aboutsummaryrefslogtreecommitdiff
path: root/Makefile.am
blob: 4887bcb185fed063fd3b2f01434e0cd78fb362e0 (plain) (blame)
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
## Process this file with automake to produce Makefile.in
# Copyright (C) 2000-2012 Free Software Foundation, Inc.
# Copyright (C) 2020, 2021 Maxime Devos
#
# Author (GnuTLS): Nikos Mavrogiannopoulos
# Author (scheme-GNUnet): Maxime Devos
#
# This file was part of scheme-GNUnet.
#
# scheme-GNUnet is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or (at
# your option) any later version.
#
# scheme-GNUnet 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with scheme-GNUnet.  If not, see <http://www.gnu.org/licenses/>.

# This file is partially based upon guile/Makefile.am in GnuTLS.
# Not all scheme-GNUnet code is licensed as GPL, some is licensed as AGPL.

ACLOCAL_AMFLAGS = -I m4
AM_CPPFLAGS = -I$(top_srcdir)/include
SUFFIXES = .scm .go

# Scheme code that works
modules = \
  gnu/extractor/enum.scm \
  \
  gnu/gnunet/scripts/download-store.scm \
  gnu/gnunet/scripts/publish-store.scm \
  gnu/gnunet/scripts/guix-stuff.scm \
  \
  gnu/gnunet/message/protocols.scm \
  \
  gnu/gnunet/concurrency/update.scm \
  gnu/gnunet/concurrency/repeated-condition.scm \
  \
  gnu/gnunet/mq/envelope.scm \
  gnu/gnunet/mq/error-reporting.scm \
  gnu/gnunet/mq/handler.scm \
  gnu/gnunet/mq/prio-prefs.scm \
  gnu/gnunet/mq/prio-prefs2.scm \
  gnu/gnunet/mq.scm \
  \
  gnu/gnunet/mq-impl/stream.scm \
  \
  gnu/gnunet/utils/bv-slice.scm \
  gnu/gnunet/utils/hat-let.scm \
  gnu/gnunet/utils/netstruct.scm \
  gnu/gnunet/utils/platform-enum.scm \
  gnu/gnunet/utils/tokeniser.scm \
  \
  gnu/gnunet/config/parser.scm \
  gnu/gnunet/config/value-parser.scm \
  gnu/gnunet/config/expand.scm \
  gnu/gnunet/config/db.scm \
  gnu/gnunet/config/fs.scm \
  \
  gnu/gnunet/util/cmsg.scm \
  gnu/gnunet/util/time.scm \
  gnu/gnunet/icmp/struct.scm \
  \
  gnu/gnunet/util/struct.scm \
  gnu/gnunet/crypto/struct.scm \
  gnu/gnunet/hashcode/struct.scm \
  \
  gnu/gnunet/nse/client.scm \
  gnu/gnunet/nse/struct.scm \
  \
  gnu/gnunet/netstruct/procedural.scm \
  gnu/gnunet/netstruct/syntactic.scm

GOBJECTS = $(modules:%.scm=%.go)
nobase_dist_guilesite_DATA = $(modules) gnu/gnunet/config/default.conf

E = gnu/gnunet/message/enum-
nobase_dist_guilesite_DATA += \
  gnu/gnunet/message/protocols.scmgen \
  $(E)agpl.scmfrag \
  $(E)arm.scmfrag \
  $(E)ats.scmfrag \
  $(E)chat.scmfrag \
  $(E)consensus.scmfrag \
  $(E)conversation.scmfrag \
  $(E)core.scmfrag \
  $(E)datastore.scmfrag \
  $(E)dht.scmfrag \
  $(E)fragment.scmfrag \
  $(E)fs-publish.scmfrag \
  $(E)fs.scmfrag \
  $(E)gns.scmfrag \
  $(E)hello.scmfrag \
  $(E)identity.scmfrag \
  $(E)lockmanager.scmfrag \
  $(E)multicast.scmfrag \
  $(E)namecache.scmfrag \
  $(E)namestore.scmfrag \
  $(E)nse.scmfrag \
  $(E)peerinfo.scmfrag \
  $(E)psyc.scmfrag \
  $(E)psycstore.scmfrag \
  $(E)regex.scmfrag \
  $(E)resolver.scmfrag \
  $(E)revocation.scmfrag \
  $(E)scalarproduct.scmfrag \
  $(E)set.scmfrag \
  $(E)statistics.scmfrag \
  $(E)testbed.scmfrag \
  $(E)transport-dv.scmfrag \
  $(E)transport.scmfrag \
  $(E)util.scmfrag \
  $(E)vpn-dns.scmfrag \
  $(E)vpn.scmfrag \
  $(E)wlan.scmfrag

# Scheme code compilation
if HAVE_GUILD
nobase_nodist_guilesiteccache_DATA = $(GOBJECTS)

# Do not unset 'GUILE_LOAD_COMPILED_PATH', as guile-pfds as installed
# in Guix does not have .scm files (but it does in Guile).
# XXX: Use the C locale for when Guile lacks
# <https://git.sv.gnu.org/cgit/guile.git/commit/?h=stable-2.0&id=e2c6bf3866d1186c60bacfbd4fe5037087ee5e3f>.
%.go: %.scm
	$(AM_V_GUILEC)$(MKDIR_P) "`dirname "$@"`" ;			\
	$(AM_V_P) && out=1 || out=- ;					\
	LC_ALL=C							\
	builddir="$(top_builddir)"					\
	GUILE_AUTO_COMPILE=0						\
	$(GUILD) compile -O3 --target="$(host)"				\
	  -L "$(top_srcdir)"						\
	  -Wformat -Wunbound-variable -Warity-mismatch			\
	  -o "$@" "$<" >&$$out
endif

TEST_EXTENSIONS = .scm
TESTS =

# Scheme tests
# FIXME ./pre-inst-env & ./test-env
#
# Set --auto-compile, because ‘tests/envelope.scm - references dropped after
# sent’ requires optimisation to avoid keeping references.  Set XDG_CACHE_HOME
# because $HOME may be unwritable and to reduce clutter.
SCM_LOG_DRIVER = \
  env XDG_CACHE_HOME="$(abs_builddir)" $(GUILE) --auto-compile -L \
    $(top_srcdir) -C $(top_builddir) -e main \
    $(top_srcdir)/build-aux/test-driver.scm

SCM_TESTS = \
  tests/envelope.scm \
  tests/error-reporting.scm \
  tests/message-handler.scm \
  tests/mq.scm \
  tests/mq-stream.scm \
  tests/network-size.scm \
  tests/update.scm \
  tests/repeated-condition.scm \
  tests/bv-slice.scm \
  tests/cmsg.scm \
  tests/config-parser.scm \
  tests/config-value-parser.scm \
  tests/config-expand.scm \
  tests/config-db.scm \
  tests/config-fs.scm \
  tests/netstruct.scm \
  tests/time.scm \
  tests/tokeniser.scm

SCM_TESTS_ENVIRONMENT = \
  GUILE_AUTO_COMPILE=0 \
  GUILE_WARN_DEPRECATED=detailed
TESTS += $(SCM_TESTS)
EXTRA_DIST = $(SCM_TESTS) tests/utils.scm build-aux/test-driver.scm

# For documentation (TODO regenerate indices).
# Set HOME to avoid interfering with the user's TeXmacs
# configuration and because HOME can be unwritable.
#
# --auto-servernum is required to let multiple xvfb-run
# run concurrently.
TEXMACS_CONVERT = env "HOME=$(abs_builddir)" xvfb-run --auto-servernum -- texmacs
# Use MathML for formulae instead of PNG images.
# While the images are prettier than the rendering by the browser,
# they aren't accessible and it is somewhat difficult to tell Automake
# to install the PNG images.
TEXMACS_HTML_SETTINGS = \
  '(set-boolean-preference "texmacs->html:images" \#f)\
   (set-boolean-preference "texmacs->html:mathjax" \#f)\
   (set-boolean-preference "texmacs->html:mathml" \#t)'

doc/scheme-gnunet.pdf: doc/scheme-gnunet.tm
	$(TEXMACS_CONVERT) -c "$<" "$@" -q
doc/scheme-gnunet.html: doc/scheme-gnunet.tm
	$(TEXMACS_CONVERT) -x $(TEXMACS_HTML_SETTINGS) -c "$<" "$@" -q

dist_doc_DATA = doc/scheme-gnunet.tm doc/fdl.tm
nobase_dist_doc_DATA = examples/nse-web.scm
nodist_html_DATA = doc/scheme-gnunet.html
nodist_pdf_DATA = doc/scheme-gnunet.pdf

clean-local:
	rm -f $(GOBJECTS)