-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile
71 lines (51 loc) · 1.24 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
.PHONY: all
all: build test build-bs test-bs
.PHONY: clean-all
clean-all: clean clean-bs
.PHONY: build
build:
dune build
.PHONY: test
test:
dune runtest
.PHONY: watch-check
watch-check:
dune build @check --watch
.PHONY: watch-test
watch-test:
dune build @runtest --watch
.PHONY: doc
doc:
dune build @doc
.PHONY: format
format:
dune build @fmt --auto-promote
.PHONY: clean
clean:
dune clean
_opam:
opam switch create . --empty
opam install -y ocaml-base-compiler.4.12.0 utop ocaml-lsp-server
install-dependencies: _opam
opam install . --deps-only --with-test
DOCS_WORKTREE_PATH=../ocaml-decoders-doc
.PHONY: publish-doc
publish-doc: doc
[ -d "$(DOCS_WORKTREE_PATH)" ] || git worktree add "$(DOCS_WORKTREE_PATH)" gh-pages
cd "$(DOCS_WORKTREE_PATH)" && git pull --ff-only
cd "$(DOCS_WORKTREE_PATH)" && git rm -r .
cp -r _build/default/_doc/_html/* "$(DOCS_WORKTREE_PATH)"
COMMIT_SHA=$$(git rev-parse HEAD) && cd "$(DOCS_WORKTREE_PATH)" && git add . && git commit -m "Update docs from revision $${COMMIT_SHA}"
cd "$(DOCS_WORKTREE_PATH)" && git push origin gh-pages
install-bs-dependencies:
npm i
build-bs:
npm run build
test-bs:
npm test
watch-build-bs:
npm run build-watch
watch-test-bs:
npm run test-watch
clean-bs:
npm run clean