-
-
Notifications
You must be signed in to change notification settings - Fork 31
/
Makefile
75 lines (62 loc) · 1.9 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
75
LIB := lambdasoup
VERSION := 0.6.2
.PHONY : build
build :
dune build
.PHONY : test
test :
dune runtest
.PHONY : coverage
coverage :
find . -name '*.coverage' | xargs rm -f
dune runtest --instrument-with bisect_ppx --force
bisect-ppx-report html --expect src/ --do-not-expect src/lambdasoup.ml
bisect-ppx-report summary
@echo See _coverage/index.html
BS4_MISSING := Beautiful Soup not installed. Skipping Python performance test.
.PHONY : performance-test
performance-test :
dune build @build-performance-test
(cd _build/default/test/performance && ./performance.exe)
@((python -c "import bs4" 2> /dev/null \
|| (echo $(BS4_MISSING); exit 1)) \
&& (echo python test/performance/performance.py; \
python test/performance/performance.py)) \
|| exit 0
# The docs targets are inactive for the time being.
HTML := docs/html
DOCFLAGS := -docflags -colorize-code
.PHONY : docs
docs : docs-postprocess
$(OCAMLBUILD) $(DOCFLAGS) docs/soup.docdir/index.html
rm -rf $(HTML)
mkdir -p $(HTML)
rsync -r _build/docs/soup.docdir/* $(HTML)/
cp docs/style.css $(HTML)/
rm $(HTML)/index*.html
_build/docs/postprocess.native < $(HTML)/Soup.html > $(HTML)/index.html
rm $(HTML)/Soup*.html $(HTML)/type_Soup*.html $(HTML)/*.stamp
@echo "\nSee docs/html/index.html"
.PHONY : docs-postprocess
docs-postprocess :
$(OCAMLBUILD) postprocess.native
GHPAGES_REPO := scratch/docs-publish
.PHONY : publish-docs
publish-docs : check-doc-prereqs docs
@[ -d $(GHPAGES_REPO)/.git ] \
|| (echo "\nPlease create a repository in $(GHPAGES_REPO)"; exit 1)
cp $(HTML)/* $(GHPAGES_REPO)
cd $(GHPAGES_REPO) \
&& git add -A \
&& git commit --amend --reset-author -m "Lambda Soup documentation." \
&& git push -f
DOC_ZIP := docs/$(LIB)-$(VERSION)-doc.zip
.PHONY : package-docs
package-docs : docs
rm -f $(DOC_ZIP)
zip -9j $(DOC_ZIP) $(HTML)/*
.PHONY : clean
clean :
dune clean
rm -rf $(COVERAGE_DIR)
# rm -rf docs/html