forked from ocaml-ppx/ocamlformat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
88 lines (69 loc) · 2.63 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
######################################################################
# #
# OCamlFormat #
# #
# Copyright (c) 2017-present, Facebook, Inc. All rights reserved. #
# #
# This source code is licensed under the MIT license found in the #
# LICENSE file in the root directory of this source tree. #
# #
######################################################################
SHELL=bash
.PHONY: default
default: exe gen-help
dune-workspace: dune-workspace.in
sed -e "s|@OPAM_SWITCH[@]|$$(opam switch show)|g" $< > $@
.PHONY: setup
setup: dune-workspace
.PHONY: exe
exe: setup
dune build _build/dev/src/ocamlformat.exe _build/release/src/ocamlformat.exe _build/dev/ocamlformat.install _build/release/ocamlformat.install
.PHONY: gen-help
gen-help:
dune build _build/release/ocamlformat-help.txt
.PHONY: bc
bc: setup
dune build _build/dev/src/ocamlformat.bc
.PHONY: dev
dev: setup
dune build _build/dev/src/ocamlformat.exe _build/dev/ocamlformat.install
.PHONY: opt
opt: setup
dune build _build/release/src/ocamlformat.exe _build/release/ocamlformat.install
.PHONY: reason
reason: setup
dune build _build/dev/src/ocamlformat_reason.exe _build/release/src/ocamlformat_reason.exe
.PHONY: ocamlformat-diff
ocamlformat-diff:
dune build _build/dev/tools/ocamlformat-diff/ocamlformat_diff.exe _build/release/tools/ocamlformat-diff/ocamlformat_diff.exe
.PHONY: clean cleanbisect
clean: cleanbisect
rm -rf _build dune-workspace
cleanbisect:
rm -Rf _coverage
find ./ -name 'bisect*.out' -delete
SRCS=$(shell \find src tools -name '[^.]*.ml' -or -name '[^.]*.mli' -or -name '[^.]*.mlt')
.PHONY: fmt
fmt:
$(shell \ls -t _build/*/src/ocamlformat.{exe,bc} | head -1) -i $(SRCS)
.PHONY: test
test: exe reason
$(MAKE) fixpoint
$(MAKE) regtests
.PHONY: test-reason
test-reason: reason
dune build _build/dev/test/reason/test-gen.ml --auto-promote
.PHONY: regtests fixpoint
fixpoint: exe reason
_build/release/src/ocamlformat.exe -n 1 -i $(SRCS)
regtests: exe
dune build @_build/dev/test/disabled/runtest
$(MAKE) -C test regtests
.PHONY: coverage
coverage: setup
dune build _build/coverage/src/ocamlformat.exe
$(MAKE) cleanbisect
$(MAKE) MODE=coverage -C test regtests
_build/coverage/src/ocamlformat.exe -i $(SRCS)
bisect-ppx-report -I _build/coverage/ -html _coverage/ `find test -name 'bisect*.out'`
@echo "open _coverage/index.html"