-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile.am
70 lines (63 loc) · 2.5 KB
/
Makefile.am
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
AUTOMAKE_OPTIONS = gnu
SUFFIXES = .scm .go .c .x
SUBDIRS= doc
libguile_ts_la_SOURCES= \
ts/util.h \
ts/util.c \
ts/init.c \
ts/init.h \
ts/language.c \
ts/foreign.h \
ts/query.c \
ts/tree.c \
ts/parser.c
libguile_ts_la_CFLAGS=$(TREE_SITTER_CFLAGS) $(GUILE_CFLAGS)
libguile_ts_la_LIBADD=$(TREE_SITTER_LIBS) $(GUILE_LIBS)
lib_LTLIBRARIES = libguile_ts.la
$(SOURCES): $(lib_LTLIBRARIES)
ACLOCAL_AMFLAGS = -I m4
BUILT_SOURCES= $(filter %.x, $(libguile_ts_la_SOURCES:%.c=%.x))
moddir=$(prefix)/share/guile/site/$(GUILE_EFFECTIVE_VERSION)
godir=$(libdir)/guile/$(GUILE_EFFECTIVE_VERSION)/site-ccache
.scm.go:
$(AM_V_GEN) $(CROSS_COMPILING_VARIABLE) $(top_builddir)/pre-inst-env \
$(GUILE_TOOLS) compile --target=$(host) $(GUILE_TARGET) $(GUILE_WARNINGS) -o "$@" "$<"
.c.x:
$(AM_V_GEN)$(top_builddir)/pre-inst-env guile-snarf -o $@ $< $(libguile_ts_la_CFLAGS)
EXTRA_DIST = $(SOURCES) $(TESTS) build-aux/test-driver.scm
SOURCES=ts/init.scm ts/query.scm ts.scm ts/language.scm ts/util.scm ts/tree.scm ts/parser.scm
GUILE_WARNINGS = \
-Wunbound-variable -Warity-mismatch -Wshadowed-toplevel \
-Wmacro-use-before-definition \
-Wunused-variable \
-Wduplicate-case-datum -Wbad-case-datum \
-Wformat
GOBJECTS = $(SOURCES:%.scm=%.go)
CLEANFILES = $(GOBJECTS) $(TESTS:tests/%.scm=%.log) $(BUILT_SOURCES)
if CROSS_COMPILING
CROSS_COMPILING_VARIABLE = GUILE_TS_CROSS_COMPILING=yes
else
CROSS_COMPILING_VARIABLE =
endif
nobase_mod_DATA = $(SOURCES) $(NOCOMP_SOURCES) $(NODIST_SOURCES)
nobase_go_DATA = $(GOBJECTS)
guile_install_go_files = install-nobase_goDATA
$(guile_install_go_files): install-nobase_modDATA
TESTS= tests/api.scm tests/gc.scm tests/tcursor.scm tests/query.scm
TEST_EXTENSIONS = .scm
AM_SCM_LOG_FLAGS = --no-auto-compile
AM_TESTS_ENVIRONMENT = abs_top_srcdir="$(abs_top_srcdir)" abs_top_builddir="$(abs_top_builddir)"
SCM_LOG_DRIVER = \
$(top_builddir)/pre-inst-env \
$(GUILE) --no-auto-compile -e main \
$(top_srcdir)/build-aux/test-driver.scm
# a tree-sitter-json for test
# https://github.com/tree-sitter/tree-sitter-json
# commit 40a81c01a40ac48744e0c8ccabbaba1920441199
EXTRA_DIST += tests/tree-sitter-json.c
CLEANFILES += tests/tree-sitter-json.so
$(TESTS): tests/tree-sitter-json.so
tests/tree-sitter-json.so: tests/tree-sitter-json.c
-$(MKDIR_P) $(top_builddir)/tests
$(CC) $(TREE_SITTER_CFLAGS) -fPIC -shared $< -o $@
dvi: