-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
48 lines (35 loc) · 915 Bytes
/
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
BUILD_SRC = _build/default/src
BUILD_CMA = algolib.cma
BUILD_CMXA = algolib.cmxa
BUILD_DOC_HTML = _build/default/_doc/_html
SRC = src
TEST = test
OUTPUT = buildOut
DIST = $(OUTPUT)/dist
DOCS = $(OUTPUT)/docs
CMA_LIBRARY = algolib.cma
CMXA_LIBRARY = algolib.cmxa
.PHONY : all build clean compile doc format refresh refresh-all test
all : build test
clean :
rm -fr $(OUTPUT)
dune clean
format :
find $(SRC) -regex .+\.mli? -exec ocamlformat -i {} \; -exec ocp-indent -i {} \;
find $(TEST) -regex .+\.mli? -exec ocamlformat -i {} \; -exec ocp-indent -i {} \;
compile :
mkdir -p $(DIST)
dune build
@echo
cp $(BUILD_SRC)/$(BUILD_CMA) $(DIST)/$(CMA_LIBRARY)
cp $(BUILD_SRC)/$(BUILD_CMXA) $(DIST)/$(CMXA_LIBRARY)
chmod 664 $(DIST)/*
build : format compile
test :
dune runtest
refresh : clean build
refresh-all : clean all
doc :
mkdir -p $(DOCS)
dune build @doc
cp -r $(BUILD_DOC_HTML)/. $(DOCS)