-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMakefile
61 lines (46 loc) · 1.3 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
.PHONY: build check js build-cov cov
TESTEXEC=_build/tests/tests.native
LIBDIR:=bulletml
BASE_OBJ=bulletml.cmi bulletml.cmxa bulletml.cma bulletml.a
OTHER_OBJ=bulletml.cmt bulletml/parser.mli bulletml/interp.mli
ALL_OBJ=$(BASE_OBJ) $(OTHER_OBJ)
OBJ:=$(addprefix _build/,$(ALL_OBJ))
OCAMLBUILD=ocamlbuild -use-ocamlfind
_build/%:
$(OCAMLBUILD) $*
build:
$(OCAMLBUILD) $(BASE_OBJ)
clean:
ocamlbuild -clean
check: $(TESTEXEC)
./$(TESTEXEC)
js: _build/jsapp.cmo
js_of_ocaml $<
%.mli:bulletml/%.ml
cp bulletml/$@ . 2>/dev/null || \
ocamlfind ocamlc *.mli -package bulletml,js_of_ocaml.syntax -syntax camlp4o -c -i $< > $@ || (rm $@; exit 1)
install: $(OBJ) uninstall
ocamlfind install bulletml $(OBJ) META
uninstall:
ocamlfind remove bulletml
doc : install
mkdir -p tmp
for f in bulletml/*.ml; do \
i=$$(basename "$$f"); \
echo $$i; \
echo "open Bulletml" > tmp/$$i; \
cat bulletml/$$i >> tmp/$$i; \
done
mkdir -p docs
ocamlfind ocamldoc -thread -I tmp -html -package bulletml -d docs tmp/*.ml
rm -rf tmp
build-cov:
ocp-build build bulletml_tests_cov
cov: build-cov
BISECT_FILE=bulletml ./_obuild/bulletml_tests_cov/bulletml_tests_cov.asm
bisect-report -html coverage bulletml*.out
rm bulletml*.out
mrproper: clean
rm -rf tmp docs
indent:
ocp-indent -i *.ml bulletml/*.ml bulletml/*.mli tests/*.ml