-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
66 lines (54 loc) · 1.26 KB
/
Makefile
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
#
# Build and install code generators and runtime support for generated parsers.
#
PROJECT_ROOT := $(shell pwd)
# Generate this with ./configure
include $(PROJECT_ROOT)/tree-sitter-config.mk
.PHONY: build
build:
dune build
test -d bin || { rm -f bin && mkdir bin; }
ln -sf ../_build/install/default/bin/ocaml-tree-sitter \
bin/ocaml-tree-sitter
# Full development setup.
#
.PHONY: setup
setup:
./scripts/check-prerequisites
./scripts/install-tree-sitter-cli
./scripts/install-tree-sitter-lib
opam install --deps-only -y .
opam install ocp-indent
# Shortcut for updating the git submodules.
.PHONY: update
update:
git submodule update --init --recursive --depth 1
# Keep things like node_modules that are worth keeping around
.PHONY: clean
clean:
rm -rf bin
rm -f config.sh config.mk # old generated config files
dune clean
make -C test clean
.PHONY: distclean
distclean:
# remove everything that's git-ignored
git clean -dfX
.PHONY: test
test: build
$(MAKE) unit
$(MAKE) e2e
# Run unit tests only (takes a few seconds).
.PHONY: unit
unit: build
./_build/default/src/test/test.exe
# Run end-to-end tests (takes a few minutes).
.PHONY: e2e
e2e: build
$(MAKE) -C test
.PHONY: install
install:
dune install
.PHONY: ci
ci:
docker build -t ocaml-tree-sitter .