<commit_before># This makefile wrapper makes DEBIAN packaging easier.
PREFIX ?=/usr
OCAML_VERSION ?= 4.00.1

START = $(DESTDIR)$(PREFIX)
OCAML_LIBDIR ?= $(START)/lib/ocaml/
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

test:
	./arakoon.native --run-all-tests

install: install_client install_server

install_server: man
	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/arakoon_exc.mli \
	  _build/src/client/arakoon_exc.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/plugins/registry.mli \
          _build/src/plugins/registry.cmi \
          _build/src/tools/llio.mli \
          _build/src/tools/llio.cmi \
          _build/src/arakoon_client.a

uninstall_client:
	$(OCAML_FIND) remove arakoon_client -destdir $(OCAML_LIBDIR)

coverage:
	ocamlbuild -use-ocamlfind \
	-tag 'package(bisect)' \
	-tag 'syntax(camlp4o)' \
	-tag 'syntax(bisect_pp)' \
	arakoon.d.byte

man:
	help2man --name='Arakoon, a consistent key value store' ./arakoon > debian/arakoon.man

.PHONY: install test build install_client


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"<commit_msg>fix manpage creation<commit_after># This makefile wrapper makes DEBIAN packaging easier.
PREFIX ?=/usr
OCAML_VERSION ?= 4.00.1

START = $(DESTDIR)$(PREFIX)
OCAML_LIBDIR ?= $(START)/lib/ocaml/
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

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/arakoon_exc.mli \
	  _build/src/client/arakoon_exc.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/plugins/registry.mli \
          _build/src/plugins/registry.cmi \
          _build/src/tools/llio.mli \
          _build/src/tools/llio.cmi \
          _build/src/arakoon_client.a

uninstall_client:
	$(OCAML_FIND) remove arakoon_client -destdir $(OCAML_LIBDIR)

coverage:
	ocamlbuild -use-ocamlfind \
	-tag 'package(bisect)' \
	-tag 'syntax(camlp4o)' \
	-tag 'syntax(bisect_pp)' \
	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


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"
{'fraction_non_alphanumeric': 0.1576889661164205, 'fraction_numerical': 0.0030408340573414424, 'mean_word_length': 3.263888888888889, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '577792', 'n_tokens_mistral': 1933, 'n_tokens_neox': 1834, 'n_words': 359}