-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
145 lines (117 loc) · 2.95 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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# dune front-end
OCAML_VERSION := $(shell opam var switch)
.PHONY: default
default: build
test: build
@ opam lint
@ dune build @test/spec/runtest -f --no-buffer -j 1
build:
@ dune build -j 1
install: build
@ dune install
uninstall:
@ dune uninstall
clear:
@ rm -rfv bisect*.out
@ dune clean
coverage: clear
@ mkdir -p docs/
@ rm -rf docs/apicov
@ mkdir -p docs/apicov
@ BISECT_ENABLE=yes make build
@ BISECT_ENABLE=yes make test
@ bisect-ppx-report \
-title nocoiner \
-I _build/default/ \
-tab-size 2 \
-html coverage/ \
`find . -name 'bisect*.out'`
@ bisect-ppx-report \
-I _build/default/ \
-text - \
`find . -name 'bisect*.out'`
@ mv ./coverage/* ./docs/apicov
# coverage: clean
# rm -rf docs/coverage
# rm -vf `find . -name 'bisect*.out'`
# mkdir -p docs/coverage
# BISECT_ENABLE=YES make test
# bisect-ppx-report -html coverage/ -I _build/default `find . -name 'bisect*.out'`
# make doc-index
# mv coverage/* docs/coverage/
# bisect-ppx-report -I _build/default/ -text - `find . -name 'bisect*.out'`
report: deps coverage
@ opam install ocveralls --yes
@ ocveralls --prefix '_build/default' `find . -name 'bisect*.out'` --send
# echo "" > docs/index.md
# echo "---" >> docs/index.md
# echo "---" >> docs/index.md
# cat README.md >> docs/index.md
doc-index:
@ cp README.md docs/index.md
docs: build
@ mkdir -p docs/
@ rm -rf docs/apiref
@ mkdir -p docs/apiref
@ make doc-index
@ dune build @doc
@ mv ./_build/default/_doc/_html/* ./docs/apiref/
pin:
@ opam pin add nocoiner . -n --yes
deps:
@ opam install . --deps-only --yes
@ opam install alcotest core --yes # force such test dependences
dev-deps:
@ opam install \
odoc \
ocveralls \
alcotest \
ocp-indent \
ocamlformat \
merlin \
bisect_ppx \
utop \
--yes
@ opam update --yes
@ opam upgrade \
odoc \
ocveralls \
alcotest \
ocp-indent \
ocamlformat \
merlin \
bisect_ppx \
utop \
--yes
lint-format:
@ opam install ocamlformat --yes
@ dune build @fmt
format:
@ dune build @fmt --auto-promote || \
echo "\n=== Code was formatted for standards compliance. ===\n"
utop:
@ dune utop lib
local-site-setup:
@ cd docs && bundle install --path vendor/bundle && cd ..
local-site-start:
@ cd docs && bundle exec jekyll serve && cd ..
# to run inside docker alpine context
binary: clear
@ dune build --profile deploy
@ cp `dune exec --profile deploy -- which nocoiner` ./nocoiner.exe
@ chmod a+rx ./nocoiner.exe
docker-system-prune:
@ docker system prune --force --volumes
docker-build:
@ docker build \
--build-arg VCS_REF=`git rev-parse --short HEAD` \
--build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
--build-arg VERSION=`cat VERSION` \
-t marcoonroad/nocoiner \
-f ./Dockerfile ./
docker-extract:
@ docker cp `docker create marcoonroad/nocoiner`:/usr/bin/nocoiner ./nocoiner.exe
docker-pull:
@ docker pull marcoonroad/nocoiner
docker-local-binary: docker-build docker-extract
docker-remote-binary: docker-pull docker-extract