forked from ocsigen/lwt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
124 lines (105 loc) · 3.37 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
112
113
114
115
116
117
118
119
120
121
122
123
124
# Copyright : (c) 2012, Jérémie Dimino <[email protected]>
# 2017, Andrew Ray <[email protected]>
# Default rule
.PHONY: default
default: build
# build the usual development packages
.PHONY: build
build: check-config
jbuilder build --dev --only-packages lwt
# build everything, including additional packages
.PHONY: build-all
build-all: check-config
jbuilder build --dev
# Build everything, including additional packages, on all compilers. See
# jbuild-workspace.dev for instructions.
# This is currently broken on two targes:
# - For 4.02.3 to work, the configure step needs to be run per-compiler. Right
# now, it is run once for the whole invocation of all the ocmpilers.
# - 4.06 trunk is often not buildable due to parse tree changes affecting OMP.
.PHONY: build-all-on-all-compilers
build-all-on-all-compilers: check-config
jbuilder build --dev --workspace jbuild-workspace.dev
jbuilder build --dev --workspace jbuild-workspace.dev -j 1 @runtest
# run unit tests for package lwt
.PHONY: test
test: check-config
jbuilder runtest --dev --only-packages lwt
# run all unit tests
.PHONY: test-all
test-all: check-config
jbuilder runtest --dev
# configuration
.PHONY: check-config
check-config:
@if [ ! -f src/jbuild-ignore ] ; \
then \
make default-config ; \
fi
.PHONY: default-config
default-config:
ocaml src/util/configure.ml -use-libev false -use-camlp4 false
# Use jbuilder/odoc to generate static html documentation.
# Currenty requires ocaml 4.03.0 to install odoc.
.PHONY: doc
doc:
jbuilder build @doc
# Build HTML documentation with ocamldoc
.PHONY: doc-api-html
doc-api-html: build-all
make -C doc 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 doc api/wiki/index.wiki
# Use opam-installer, rather than jbuilder while we need to
# post-process the lwt.install file
.PHONY: install
install:
ocaml src/util/install_filter.ml
opam-installer --prefix `opam config var prefix` -i lwt.install
.PHONY: uninstall
uninstall:
opam-installer --prefix `opam config var prefix` -u lwt.install
.PHONY: reinstall
reinstall: uninstall install
# 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 ; \
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_react .
opam pin add --yes --no-action lwt_ssl .
opam pin add --yes --no-action lwt_glib .
opam install --yes camlp4
opam reinstall --yes lwt lwt_react lwt_ssl lwt_glib
.PHONY: clean
clean:
jbuilder clean
find . -name '.merlin' | xargs rm -f
rm -fr doc/api
rm -f src/jbuild-ignore src/unix/lwt_config src/core/flambda.flag
for TEST in `ls -d test/packaging/*/*` ; \
do \
make -wC $$TEST clean ; \
done
rm -rf _coverage/
BISECT_FILES_PATTERN := _build/default/test/*/bisect*.out
BISECT_REPORT := bisect-ppx-report
.PHONY: coverage
coverage: clean
BISECT_ENABLE=yes jbuilder runtest --dev
bisect-ppx-report \
-I _build/default/ -html _coverage/ \
-text - -summary-only \
$(BISECT_FILES_PATTERN)
@echo See _coverage/index.html