forked from Risto-Stevcev/bastet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
118 lines (89 loc) · 2.2 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
all: clean default-switch build copy-docs
.PHONY: clean-bs
clean-bs:
yarn bsb -clean-world
.PHONY: clean-native
clean-native:
opam exec -- dune clean
.PHONY: clean-docs
clean-docs:
rm -rf docs/**
.PHONY: clean-coverage
clean-coverage:
rm -rf _coverage *.coverage
rm -f coverage.json
.PHONY: clean
clean: clean-bs clean-native clean-docs clean-coverage
.PHONY: build-bs
build-bs:
yarn bsb -make-world
.PHONY: build-native
build-native:
opam exec -- dune build @all
.PHONY: build
build: build-bs build-native
.PHONY: fmt
fmt:
opam exec -- dune build @fmt --auto-promote
.PHONY: docs-template
docs-template:
cat bastet/src/index.mld.template | \
sed -e 's/{{:/{ {:/g' | \
opam exec -- dune exec examples/docs_template.exe | \
sed -e 's/{ {:/{{:/g' > bastet/src/index.mld
.PHONY: docs
docs: clean-docs docs-template
opam exec -- dune build @doc
.PHONY: copy-docs
copy-docs: docs
cp -r _build/default/_doc/_html/** docs/
.PHONY: open-docs
open-docs: copy-docs
xdg-open docs/index.html
.PHONY: test-bs
test-bs: build-bs
yarn test
.PHONY: test-native
test-native: build-native
opam exec -- dune runtest --no-buffer
.PHONY: test
test: test-bs test-native
# Useful for sending report to coveralls outside of CI
.PHONY: coveralls-send-api
coveralls-send-api:
curl -L -F json_file=@./coverage.json https://coveralls.io/api/v1/jobs
.PHONY: coveralls-api
coveralls-api: coveralls-json coveralls-send-api
.PHONY: watch-native
watch-native:
opam exec -- dune build @all -w
.PHONY: watch-bs
watch-bs:
yarn bsb -make-world -w
.PHONY: watch-test-bs
watch-test-bs:
yarn run watch-test
.PHONY: watch-test-native
watch-test:
opam exec -- dune runtest --no-buffer -w
.PHONY: utop
utop:
opam exec -- dune utop .
.PHONY: remove-switch
remove-switch:
opam switch remove -y . || true
.PHONY: dev-tools
dev-tools:
opam install -y merlin ocamlformat utop
.PHONY: create-4.08-switch
create-4.08-switch:
opam switch create -y . 4.08.1 -t -d
.PHONY: 4.08-switch
4.08-switch: remove-switch create-4.08-switch dev-tools
eval $(opam env)
.PHONY: create-default-switch
create-default-switch:
opam switch create -y . -t -d
.PHONY: default-switch
default-switch: remove-switch create-default-switch dev-tools
eval $(opam env)