-
Notifications
You must be signed in to change notification settings - Fork 106
/
Makefile
68 lines (52 loc) · 1.6 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
.PHONY: all clean install uninstall reinstall test doc
all:
dune build @all
clean:
dune clean
install:
dune build @install
dune install
uninstall:
dune uninstall
test:
dune runtest
doc:
dune build @all
dune build @doc
test_install:
./scripts/test_install.sh
reinstall:
dune uninstall
dune build @install
dune install
###############################################################################
# BENCHMARK SUITE
###############################################################################
bench:
$(OCAMLBUILD) $(OCAMLBUILDFLAGS) $(TARGETS) $(BENCH_TARGETS)
$(RM) bench.log
$(foreach BENCH, $(BENCH_TARGETS), _build/$(BENCH) | tee -a bench.log; )
@echo "Benchmarking results are written to bench.log"
###############################################################################
# PREPARING RELEASE FILES
###############################################################################
release:
$(MAKE) clean
git stash save "stashing local modifications before release"
$(MAKE) release-cleaned
# assumes irreproachably pristine working directory
release-cleaned: doc test-native
git archive --format=tar --prefix=batteries-$(VERSION)/ HEAD \
| gzip -9 > batteries-$(VERSION).tar.gz
# uploads the current documentation to github hdoc2/ directory
upload-docs:
make doc && \
rm -rf /tmp/batteries.docdir && \
cp -a _build/batteries.docdir /tmp/ && \
git checkout gh-pages && \
rm -f hdoc2/*.html && \
cp /tmp/batteries.docdir/*.html hdoc2/ && \
git add hdoc2/*.html && \
git commit hdoc2 -m "Update ocamldoc to latest release" && \
git push origin gh-pages && \
git checkout master