-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
58 lines (41 loc) · 1.27 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
.PHONY: all test build clean check-lint lint doc utop example
all: build
# [make build] (or [make]) will build the source
build:
dune build
# [make test] run all test
test:
dune runtest --no-buffer -j 1
# [make clean] remove build artifacts (essentially the
# "_build/" folder)
clean:
dune clean
# [make doc] build the documentation (using odoc)
doc: build
dune build @doc
# [make utop] launch an REPL with the whole package in
# the context
utop:
dune utop
# [make check-lint] ensure that the code is properly formatted
# according to the ".ocamlformat" file
check-lint:
dune build @fmt
# [make lint] apply formatting according to the ".ocamlformat" file
lint:
dune build @fmt --auto-promote
# Setting up the development environment
.PHONY: dev-deps deps
# [make dev-deps] will download locally the dependencies needed
# to develop the project. Mainly formatting features, and IDE support.
dev-deps:
opam install dune merlin ocamlformat ocp-indent utop -y
# [make deps] will download locally the dependencies needed
# to build the libraries. That is, all the dependencies referenced
# in the OPAM description files.
deps:
opam install . --deps-only --with-doc --with-test -y
# Example
example:
dune build examples/frontend/main.bc.js
dune exec examples/backend/main.exe