-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
101 lines (86 loc) · 2.39 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
# Default rule
.PHONY: default
default: build
# build the usual development packages
.PHONY: build
build:
dune build
# build the usual development packages
.PHONY: rbuild
rbuild:
dune build --profile release
# run unit tests for package lwt
.PHONY: test
test: build
dune runtest -j 1 --no-buffer
# Install dependencies needed during development.
.PHONY : dev-deps
dev-deps :
opam install . --deps-only --yes
# Use Dune+odoc to generate static html documentation.
# Currently requires ocaml 4.03.0 to install odoc.
.PHONY: doc
doc:
dune build @doc
# Build HTML documentation with ocamldoc
.PHONY: doc-api-html
doc-api-html: build-all
$(MAKE) -C docs api/html/index.html
# Build wiki documentation with wikidoc
# requires ocaml 4.03.0 and pinning the repo
# https://github.com/ocsigen/wikidoc
.PHONY: doc-api-wiki
doc-api-wiki: build-all
$(MAKE) -C docs api/wiki/index.wiki
# Packaging tests. These are run with Lwt installed by OPAM, typically during
# CI. To run locally, run the install-for-packaging-test target first.
.PHONY: packaging-test
packaging-test:
ocamlfind query lwt
for TEST in `ls -d test/packaging/*/*` ; \
do \
$(MAKE) -wC $$TEST || exit 1 ; \
echo ; \
echo ; \
done
.PHONY: install-for-packaging-test
install-for-packaging-test: clean
opam pin add --yes --no-action lwt .
opam pin add --yes --no-action lwt_ppx .
opam pin add --yes --no-action lwt_react .
opam reinstall --yes lwt lwt_ppx lwt_react
.PHONY: uninstall-after-packaging-test
uninstall-after-packaging-test:
opam remove --yes lwt lwt_ppx lwt_react
opam pin remove --yes lwt
opam pin remove --yes lwt_ppx
opam pin remove --yes lwt_react
# ppx_let integration test.
.PHONY : ppx_let-test
ppx_let-test :
dune build test/ppx_let/test.exe
dune exec test/ppx_let/test.exe
.PHONY : ppx_let-test-deps
ppx_let-test-deps :
opam install --yes --unset-root ppx_let
.PHONY: clean
clean:
dune clean
find . -name '.merlin' | xargs rm -f
rm -fr docs/api
rm -f src/jbuild-ignore src/unix/lwt_config
for TEST in `ls -d test/packaging/*/*` ; \
do \
$(MAKE) -wC $$TEST clean ; \
done
rm -rf _coverage/
BISECT_FILES_PATTERN := _build/default/test/*/bisect*.out
.PHONY: coverage
coverage: clean
BISECT_ENABLE=yes $(MAKE) build
BISECT_ENABLE=yes dune runtest -j 1 --no-buffer
bisect-ppx-report \
-I _build/default/ -html _coverage/ \
-text - -summary-only \
$(BISECT_FILES_PATTERN)
@echo See _coverage/index.html