File: Makefile

package info (click to toggle)
lwt 5.3.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 2,348 kB
  • sloc: ml: 20,374; ansic: 6,933; makefile: 184; sh: 87; python: 62
file content (110 lines) | stat: -rw-r--r-- 2,702 bytes parent folder | download
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
# Default rule
.PHONY: default
default: build

# build the usual development packages
.PHONY: build
build:
	dune build

# run unit tests for package lwt
.PHONY: test
test: build
	dune runtest

# Promote expect test output.
.PHONY : promote
promote :
	for FILE in $$(ls _build/default/test/ppx_expect/cases/*.fixed); \
	do \
		EXPECT=test/ppx_expect/cases/$$(basename $${FILE%.fixed}).expect; \
		cp $$FILE $$EXPECT; \
	done

# 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
	$(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
	$(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
	rm -fr docs/api
	rm -f src/unix/discover_arguments
	for TEST in `ls -d test/packaging/*/*` ; \
	do \
	    $(MAKE) -wC $$TEST clean ; \
	done
	rm -rf _coverage/

EXPECTED_FILES := \
    --expect src/core/ \
    --expect src/react/ \
    --expect src/unix/ \
    --do-not-expect src/unix/config/ \
    --do-not-expect src/unix/lwt_gc.ml \
    --do-not-expect src/unix/lwt_throttle.ml \
    --do-not-expect src/unix/unix_c/

.PHONY: coverage
coverage :
	rm -rf _build/default/test/ppx_expect
	find _build -name '*.coverage' | xargs rm -f
	BISECT_ENABLE=yes dune runtest --force
	bisect-ppx-report html $(EXPECTED_FILES)
	bisect-ppx-report summary
	@echo See _coverage/index.html