<commit_before>
# Makefile for OCaml Batteries Included
#
# Copyright (C) 2008 <NAME>, LIFO, Universite d'Orleans
# 
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version,
# with the special exception on linking described in file LICENSE.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

PACKS=$(shell find src -name "*mlpack")
GENERATED_MLI=$(patsubst %.mlpack, %.mli, $(PACKS))


test:
	$(shell echo $(GENERATED_MLI))

all: byte syntax

#Useful for testing
reinstall: byte syntax opt uninstall install

_build/build/odoc_generator_batlib.cmo: build/odoc_generator_batlib.ml
	ocamlbuild odoc_generator_batlib.cmo


byte:
	ocamlbuild src/main/threads/batteries.cma     &&\
	ocamlbuild src/main/nothreads/batteries.cma

opt:
	ocamlbuild src/main/threads/batteries.cmxa    &&\
	ocamlbuild src/main/nothreads/batteries.cmxa

syntax:
	ocamlbuild src/syntax/pa_openin/pa_openin.cmo       &&\
	ocamlbuild src/syntax/pa_openin/pa_openin_r.cmo     &&\
	ocamlbuild src/syntax/pa_where/pa_where.cmo         &&\
	ocamlbuild src/syntax/pa_batteries/pa_batteries.cmo &&\
	ocamlbuild src/syntax/pa_mainfun/pa_mainfun.cmo 

batteries.mllib:
#	echo $(foreach i, $(basename $(notdir $(shell find src/ -name "*.ml" -o -name "*.mlpack"))), $(shell ocaml build/tools.ml --capit $i)) > batteries.mllib &&\
	sed -i -e "s/ /\n/g" -e "s/Batteries\\nBatteries/Batteries/" \
		batteries.mllib &&\
	cp batteries.mllib src/main/threads       &&\
#	echo $(foreach i, $(basename $(notdir $(shell find src \( -name "*ml" -or -name "*mlpack" \) -not -wholename "*baselib_threads*"))), $(shell ocaml build/tools.ml --capit $i)) > batteries.mllib &&\
	sed -i -e "s/ /\n/g" -e "s/Batteries\\nBatteries/Batteries/" \
		batteries.mllib &&\
	cp batteries.mllib src/main/nothreads

#batteries.mllib:
#	echo $(foreach i, $(basename $(notdir $(shell find src/ -name "*.ml" -o -name "*.mlpack"))), $(shell ocaml build/tools.ml --capit $i)) > batteries.mllib &&\
#	sed -i -e "s/ /\n/g" -e "s/batteries\\nbatteries/batteries/" \
#		batteries.mllib &&\
#	cp batteries.mllib src/main/threads       &&\
#	echo $(foreach i, $(basename $(notdir $(shell find src \( -name "*ml" -or -name "*mlpack" \) -not -wholename "*baselib_threads*"))), $(shell ocaml build/tools.ml --capit $i)) > batteries.mllib &&\
#	sed -i -e "s/ /\n/g" -e "s/batteries\\nbatteries/batteries/" \
#		batteries.mllib &&\
#	cp batteries.mllib src/main/nothreads

install: syntax
	ocamlfind install batteries build/META _build/src/syntax/pa_openin/pa_openin.cmo _build/src/syntax/pa_openin/pa_openin_r.cmo _build/src/syntax/pa_where/pa_where.cmo _build/src/syntax/pa_batteries/pa_batteries.cmo _build/src/syntax/pa_mainfun/pa_mainfun.cmo &&\
	ocamlfind install batteries_threads build/threaded/META _build/src/main/threads/batteries.cmi -optional _build/src/main/threads/batteries.cma _build/src/main/threads/batteries.cmxa _build/src/main/threads/batteries.a  &&\
	ocamlfind install batteries_nothreads build/nothreads/META _build/src/main/nothreads/batteries.cmi -optional _build/src/main/nothreads/batteries.cma _build/src/main/nothreads/batteries.cmxa  _build/src/main/nothreads/batteries.a 

uninstall:
	ocamlfind remove batteries &&\
	ocamlfind remove batteries_threads &&\
	ocamlfind remove batteries_nothreads

doc: byte doc/api.odocl
	\rm -Rf doc/batteries/html/api &&\
	ocamlbuild -I src/main/threads doc/api.docdir/index.html &&\
	rm api.docdir &&\
	mv _build/doc/api.docdir/ doc/batteries/html/api

doc/api.odocl: 
	cp src/main/threads/batteries.mllib doc/api.odocl<commit_msg>Remove references to useless pa_mainfun<commit_after>
# Makefile for OCaml Batteries Included
#
# Copyright (C) 2008 <NAME>eller, LIFO, Universite d'Orleans
# 
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version,
# with the special exception on linking described in file LICENSE.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

PACKS=$(shell find src -name "*mlpack")
GENERATED_MLI=$(patsubst %.mlpack, %.mli, $(PACKS))


test:
	$(shell echo $(GENERATED_MLI))

all: byte syntax

#Useful for testing
reinstall: byte syntax opt uninstall install

_build/build/odoc_generator_batlib.cmo: build/odoc_generator_batlib.ml
	ocamlbuild odoc_generator_batlib.cmo


byte:
	ocamlbuild src/main/threads/batteries.cma     &&\
	ocamlbuild src/main/nothreads/batteries.cma

opt:
	ocamlbuild src/main/threads/batteries.cmxa    &&\
	ocamlbuild src/main/nothreads/batteries.cmxa

syntax:
	ocamlbuild src/syntax/pa_openin/pa_openin.cmo       &&\
	ocamlbuild src/syntax/pa_openin/pa_openin_r.cmo     &&\
	ocamlbuild src/syntax/pa_where/pa_where.cmo         &&\
	ocamlbuild src/syntax/pa_batteries/pa_batteries.cmo

batteries.mllib:
#	echo $(foreach i, $(basename $(notdir $(shell find src/ -name "*.ml" -o -name "*.mlpack"))), $(shell ocaml build/tools.ml --capit $i)) > batteries.mllib &&\
	sed -i -e "s/ /\n/g" -e "s/Batteries\\nBatteries/Batteries/" \
		batteries.mllib &&\
	cp batteries.mllib src/main/threads       &&\
#	echo $(foreach i, $(basename $(notdir $(shell find src \( -name "*ml" -or -name "*mlpack" \) -not -wholename "*baselib_threads*"))), $(shell ocaml build/tools.ml --capit $i)) > batteries.mllib &&\
	sed -i -e "s/ /\n/g" -e "s/Batteries\\nBatteries/Batteries/" \
		batteries.mllib &&\
	cp batteries.mllib src/main/nothreads

#batteries.mllib:
#	echo $(foreach i, $(basename $(notdir $(shell find src/ -name "*.ml" -o -name "*.mlpack"))), $(shell ocaml build/tools.ml --capit $i)) > batteries.mllib &&\
#	sed -i -e "s/ /\n/g" -e "s/batteries\\nbatteries/batteries/" \
#		batteries.mllib &&\
#	cp batteries.mllib src/main/threads       &&\
#	echo $(foreach i, $(basename $(notdir $(shell find src \( -name "*ml" -or -name "*mlpack" \) -not -wholename "*baselib_threads*"))), $(shell ocaml build/tools.ml --capit $i)) > batteries.mllib &&\
#	sed -i -e "s/ /\n/g" -e "s/batteries\\nbatteries/batteries/" \
#		batteries.mllib &&\
#	cp batteries.mllib src/main/nothreads

install: syntax
	ocamlfind install batteries build/META _build/src/syntax/pa_openin/pa_openin.cmo _build/src/syntax/pa_openin/pa_openin_r.cmo _build/src/syntax/pa_where/pa_where.cmo _build/src/syntax/pa_batteries/pa_batteries.cmo &&\
	ocamlfind install batteries_threads build/threaded/META _build/src/main/threads/batteries.cmi -optional _build/src/main/threads/batteries.cma _build/src/main/threads/batteries.cmxa _build/src/main/threads/batteries.a  &&\
	ocamlfind install batteries_nothreads build/nothreads/META _build/src/main/nothreads/batteries.cmi -optional _build/src/main/nothreads/batteries.cma _build/src/main/nothreads/batteries.cmxa  _build/src/main/nothreads/batteries.a 

uninstall:
	ocamlfind remove batteries &&\
	ocamlfind remove batteries_threads &&\
	ocamlfind remove batteries_nothreads

doc: byte doc/api.odocl
	\rm -Rf doc/batteries/html/api &&\
	ocamlbuild -I src/main/threads doc/api.docdir/index.html &&\
	rm api.docdir &&\
	mv _build/doc/api.docdir/ doc/batteries/html/api

doc/api.odocl: 
	cp src/main/threads/batteries.mllib doc/api.odocl
{'fraction_non_alphanumeric': 0.13502624832132828, 'fraction_numerical': 0.004883408619216213, 'mean_word_length': 4.004276114844227, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, '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': '3274908', 'n_tokens_mistral': 3119, 'n_tokens_neox': 3001, 'n_words': 750}