-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
75 lines (50 loc) · 1.68 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
#########################################
# Custom MakeFile #
# By AJHL #
#########################################
#============================================
# Tools
#============================================
OCAMLBUILD = ocamlbuild -cflags -w,-a
#============================================
# Targets
#============================================
PACKAGE = base58
SOURCES = lib/$(PACKAGE).ml lib/$(PACKAGE).mli
TARGET_NAMES = $(PACKAGE).cmi $(PACKAGE).cma $(PACKAGE).cmxa $(PACKAGE).a
TARGETS=$(addprefix _build/lib/, $(TARGET_NAMES))
COVERAGE = -use-ocamlfind -package bisect_ppx
REPORT = BISECT_FILE=_build/coverage
TESTS = t/01-encodetest.native t/02-decodetest.native
#============================================
# Compiling
#============================================
library:
$(OCAMLBUILD) $(PACKAGE).cma
$(OCAMLBUILD) $(PACKAGE).cmxa
coverage:
$(OCAMLBUILD) $(COVERAGE) $(PACKAGE).cma
$(OCAMLBUILD) $(COVERAGE) $(PACKAGE).cmxa
tests: coverage
$(OCAMLBUILD) $(COVERAGE) -no-links -pkg testsimple $(TESTS)
#============================================
# Testing
#============================================
test: tests
$(REPORT) prove _build/t/*.native
#============================================
# installation
#============================================
install: uninstall
ocamlfind install $(PACKAGE) $(TARGETS) META
uninstall:
ocamlfind remove $(PACKAGE)
#============================================
# Extra
#============================================
all: library tests
report:
ocveralls --prefix _build _build/coverage*.out --send
clean:
$(OCAMLBUILD) -clean
.PHONY : clean native all report test tests