-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
62 lines (49 loc) · 1.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
ifndef TC_NATIVE_OCAML_SWITCH
TC_NATIVE_OCAML_SWITCH := 4.14
endif
ifndef TC_BASE_VERSION
TC_BASE_VERSION := v0.15.1
endif
# We should use something more recent, but opam keeps telling me they don't exist
TC_OCAMLFORMAT_VERSION := 0.20.1
build:
@printf "\n\e[31mBuilding tablecloth-base ...\e[0m\n"
opam config exec -- dune build
@printf "\n\e[31mBuilt!\e[0m\n"
watch:
@printf "\n\e[31mBuilding native...\e[0m\n"
opam config exec -- dune build --watch
watch-test:
@printf "\n\e[31mBuilding native...\e[0m\n"
opam config exec -- dune test --watch
.PHONY: test
test:
@printf "\n\e[31mRunning tablecloth-base tests ...\e[0m\n"
opam config exec -- dune runtest -f
@printf "\n\e[31mTested!\e[0m\n"
.PHONY: integration-test
integration-test:
echo -e "\n\e[31mBuilding native integration test\e[0m"
cd integration-test;\
dune build main.exe;\
echo -e "\n\e[31mRunning compiled file\e[0m";\
../_build/default/integration-test/main.exe
deps:
@printf "\n\e[31mInstalling native dependencies ...\e[0m\n"
opam update
opam switch set ${TC_NATIVE_OCAML_SWITCH}
opam install alcotest.1.4.0 base.${TC_BASE_VERSION} dune.3.16.0 junit.2.0.2 junit_alcotest.2.0.2 odoc.2.4.2 -y
@printf "\n\e[31mInstalled!\e[0m\n"
deps-format:
@printf "\n\e[31mInstalling formatting dependencies ...\e[0m\n"
opam update
opam switch set ${TC_NATIVE_OCAML_SWITCH}
opam install ocamlformat.${TC_OCAMLFORMAT_VERSION} -y
@printf "\n\e[31mInstalled!\e[0m\n"
all: deps build test integration-test
@printf "\n\e[31mAll done!\e[0m\n"
.PHONY: check-format format
check-format:
opam config exec -- dune build @fmt
format:
opam config exec -- dune build @fmt --auto-promote