-
Notifications
You must be signed in to change notification settings - Fork 17
/
Makefile
103 lines (82 loc) · 3.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
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
# This makefile wrapper makes DEBIAN packaging easier.
PREFIX ?=/usr
START = $(DESTDIR)$(PREFIX)
OCAML_LIBDIR ?= $(START)/lib/ocaml/
#OCAML_LIBDIR ?= `ocamlfind printconf destdir`
OCAML_FIND ?= ocamlfind
all: build
clean:
ocamlbuild -clean
build:
ocamlbuild -j 4 -use-ocamlfind arakoon.byte arakoon.native arakoon_client.cma arakoon_client.cmxa arakoon_client.a arakoon_client.cmxs plugin_helper.cmi
bench:
ocamlbuild -use-ocamlfind bs_bench.native
test:
./arakoon.native --run-all-tests
install: install_client install_server man
install_server:
mkdir -p $(START)/bin/
cp ./arakoon.native $(START)/bin/arakoon
install_client:
mkdir -p $(OCAML_LIBDIR)
$(OCAML_FIND) install arakoon_client -destdir $(OCAML_LIBDIR) META \
_build/src/arakoon_client.cma \
_build/src/arakoon_client.cmxa \
_build/src/arakoon_client.cmxs \
_build/src/client/stamp.cmi \
_build/src/client/arakoon_exc.mli \
_build/src/client/arakoon_exc.cmi \
_build/src/client/arakoon_client_config.cmi \
_build/src/client/arakoon_client.mli \
_build/src/client/arakoon_client.cmi \
_build/src/client/arakoon_remote_client.mli \
_build/src/client/arakoon_remote_client.cmi \
_build/src/client/protocol_common.cmi \
_build/src/client/client_helper.cmi \
_build/src/inifiles/inifiles.mli \
_build/src/inifiles/inifiles.cmi \
_build/src/lib/std.cmi \
_build/src/plugins/registry.mli \
_build/src/plugins/registry.cmi \
_build/src/plugins/plugin_helper.mli \
_build/src/plugins/plugin_helper.cmi \
_build/src/node/key.mli \
_build/src/node/key.cmi \
_build/src/node/simple_store.cmi \
_build/src/nursery/routing.cmi \
_build/src/tlog/interval.cmi \
_build/src/tlog/update.cmi \
_build/src/tools/ini.cmi \
_build/src/tools/llio.mli \
_build/src/tools/llio.cmi \
_build/src/tools/network.cmi \
_build/src/tools/lwt_extra.cmi \
_build/src/tools/typed_ssl.mli \
_build/src/tools/typed_ssl.cmi \
_build/src/arakoon_client.a
uninstall_client:
$(OCAML_FIND) remove arakoon_client -destdir $(OCAML_LIBDIR)
coverage:
ocamlbuild -use-ocamlfind \
-tag use_bisect \
arakoon.d.byte
man:
ln -s ./arakoon.native arakoon
help2man --name='Arakoon, a consistent key value store' ./arakoon > debian/arakoon.man
rm arakoon
.PHONY: install test build install_client bench
indent-tabs-to-spaces:
@echo "Converting tabs to spaces..."
@find . -iname '*.ml' -o -iname '*.mli' -exec sed -i -e 's/\t/ /g' {} \;
indent-trailing-whitespace:
@echo "Removing trailing whitespace..."
@find . -iname '*.ml' -o -iname '*.mli' -exec sed -i -e 's/[[:space:]]*$$//' {} \;
indent-trailing-lines:
@echo "Removing trailing newlines..."
@find . -iname '*.ml' -o -iname '*.mli' -exec sed -i -e :a -e '/^\n*$$/{$$d;N;ba' -e '}' {} \;
indent-ocp-indent:
@echo "Running ocp-indent..."
@find . -iname '*.ml' -o -iname '*.mli' -exec ocp-indent -i {} \;
indent: indent-tabs-to-spaces indent-trailing-whitespace indent-trailing-lines indent-ocp-indent
@echo "Done"
.PHONY: indent-tabs-to-spaces indent-trailing-whitespace indent-trailing-lines indent-ocp-indent indent