-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
111 lines (88 loc) · 1.97 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
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
all: build
.PHONY: clear
clear: clean
build:
@ dune build @check
@ dune build
.PHONY: dev-deps
dev-deps:
@ opam install odoc merlin utop ocp-indent --yes
.PHONY: deps
deps:
@ opam install . --deps-only
.PHONY: pin
pin:
@ opam pin add twostep . -n --yes
.PHONY: unpin
unpin:
@ opam pin remove twostep --yes
.PHONY: utop
utop: build
@ dune utop lib
.PHONY: cleanup-files
cleanup-files:
@ rm -f *~
@ rm -f bin/*~
@ rm -f lib/*~
@ rm -f test/*~
@ rm -f .*.un~
@ rm -f bin/.*.un~
@ rm -f lib/.*.un~
@ rm -f test/.*.un~
@ rm -f `find . -name 'bisect*.out'`
@ rm -f `find . -name 'bisect*.coverage'`
.PHONY: clean
clean: cleanup-files
@ dune clean
.PHONY: lint-format
lint-format:
@ opam install ocamlformat --yes
@ dune build @fmt
.PHONY: lint
lint:
@ opam lint
@ make lint-format
.PHONY: format
format:
@ opam install ocamlformat --yes
@ dune build @fmt --auto-promote || echo "\nSource code rewritten by format.\n"
quick-test: build lint
@ ALCOTEST_QUICK_TESTS=1 dune runtest
test: build lint
@ dune runtest --no-buffer -f -j 1
.PHONY: docs-index
docs-index:
@ cp README.md docs/index.md
.PHONY: docs
docs: build
@ mkdir -p docs/
@ rm -rf docs/apiref/
@ mkdir -p docs/apiref/
@ dune build @doc
@ make docs-index
@ mv ./_build/default/_doc/_html/* ./docs/apiref/
.PHONY: serve-docs
serve-docs: docs
@ cd docs && bundle exec jekyll serve && cd .. || cd ..
install: build
@ dune install
.PHONY: uninstall
uninstall:
@ dune uninstall
coverage: clean
@ mkdir -p docs/
@ rm -rf docs/apicov/
@ mkdir -p docs/apicov/
@ find . -name '*.coverage' | xargs rm -f
@ dune runtest --instrument-with bisect_ppx --force
@ bisect-ppx-report html --title twostep
@ mv ./_coverage/* ./docs/apicov/
@ bisect-ppx-report summary
report: coverage
@ bisect-ppx-report send-to Coveralls
.PHONY: local-site-setup
local-site-setup:
@ cd docs && bundle install --path vendor/bundle && cd ..
.PHONY: local-site-start
local-site-start:
@ cd docs && bundle exec jekyll serve && cd ..