aboutsummaryrefslogtreecommitdiff
path: root/guile-vm.am
blob: 8b291c57388bcf74e2ba3956d7186e8b64405dab (about) (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
# Compilation with Guile-VM's compiler (aka. Guile 2.x).

if ENABLE_GUILE_VM

# XXX: This expression relies on a GNU extension.
GOBJECTS = $(SOURCES:%.scm=%.go)

nobase_dist_module_DATA = $(SOURCES) $(SOURCES_NOT_COMPILED)
nobase_nodist_module_DATA = $(GOBJECTS)

# Compiler warnings.
guile_warnings = unused-variable unused-toplevel unbound-variable arity-mismatch

.scm.go:
	$(MKDIR_P) `dirname $@`
	GUILE_AUTO_COMPILE=0					\
	GUILE_LOAD_COMPILED_PATH="$(builddir):$(top_builddir)/src/guile:$$GUILE_LOAD_COMPILED_PATH" \
	$(GUILE) --debug -L "$(srcdir)" -L "$(top_srcdir)/src/guile"	\
	  -c "(use-modules (system base compile)		\
	                   (skribilo condition))		\
	      (call-with-skribilo-error-catch/exit		\
	        (lambda ()					\
	          (compile-file \"$<\" #:output-file \"$@\"	\
			        #:opts '(#:warnings ($(guile_warnings))))))"

CLEANFILES += $(GOBJECTS)

SUFFIXES += .go

else !ENABLE_GUILE_VM

nobase_dist_module_DATA = $(SOURCES) $(SOURCES_NOT_COMPILED)
nobase_nodist_module_DATA =

endif !ENABLE_GUILE_VM