-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
66 lines (52 loc) · 1.22 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
ifeq (start,$(firstword $(MAKECMDGOALS)))
START_ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
$(eval $(START_ARGS):;@:)
endif
ifeq ($(OSTYPE),Darwin)
mirage_mode=macosx
else
mirage_mode=unix
endif
.PHONY: all
all:
opam exec -- dune build @install
.PHONY: dev
dev:
opam install dune-release merlin ocamlformat utop mirage mirage-unix opam-depext
opam install --deps-only --with-test --with-doc -y .
cd mirage; opam exec -- mirage configure -t $(mirage_mode)
cd mirage; opam exec -- make depend
.PHONY: mirage
mirage: install
cd mirage; opam exec -- mirage configure -t $(mirage_mode)
cd mirage; opam exec -- make
.PHONY: build
build: all
opam exec -- dune build
.PHONY: install
install: build
opam exec -- dune install
.PHONY: start
start: mirage
mirage/mirage_demo $(START_ARGS)
.PHONY: test
test:
opam exec -- dune build @test/runtest -f
.PHONY: clean
clean:
opam exec -- dune clean
.PHONY: doc
doc:
opam exec -- dune build @doc
.PHONY: doc-path
doc-path:
@echo "_build/default/_doc/_html/index.html"
.PHONY: format
format:
opam exec -- dune build @fmt --auto-promote
.PHONY: watch
watch:
opam exec -- dune build --watch
.PHONY: utop
utop:
opam exec -- dune utop lib -- -implicit-bindings