forked from rlepigre/ocaml-bindlib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
GNUmakefile
91 lines (70 loc) · 2.28 KB
/
GNUmakefile
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
VERSION := 5.0.1
OCAMLFIND := ocamlfind
OCAMLBUILD := ocamlbuild -quiet
CFLAGS := -cflags -w,A
DFLAGS := -docflags -charset,utf-8,-short-functors
## Compilation
all: bindlib.cma bindlib.cmxa bindlib.cmxs META
bindlib.cma: bindlib.mli bindlib.ml
$(OCAMLBUILD) $(CFLAGS) $@
bindlib.cmxa: bindlib.mli bindlib.ml
$(OCAMLBUILD) $(CFLAGS) $@
bindlib.cmxs: bindlib.mli bindlib.ml
$(OCAMLBUILD) $(CFLAGS) $@
META:
@echo "name=\"bindlib\"" > $@
@echo "version=\"$(VERSION)\"" >> $@
@echo "description=\"Efficient binder representation.\"" >> $@
@echo "requires=\"\"" >> $@
@echo "archive(byte)=\"bindlib.cma\"" >> $@
@echo "archive(native)=\"bindlib.cmxa\"" >> $@
@echo "plugin(byte)=\"bindlib.cma\"" >> $@
@echo "plugin(native)=\"bindlib.cmxs\"" >> $@
## Examples
EXAMPLES = examples/lambda.native examples/translate.native \
examples/basic.native examples/parsed.native \
examples/fchurch.native
.PHONY: examples
examples: $(EXAMPLES)
examples/lambda.native: examples/lambda.ml
$(OCAMLBUILD) $@
examples/translate.native: examples/translate.ml
$(OCAMLBUILD) $@
examples/basic.native: examples/basic.ml
$(OCAMLBUILD) $@
examples/parsed.native: examples/parsed.ml
$(OCAMLBUILD) $@
examples/fchurch.native: examples/fchurch.ml
$(OCAMLBUILD) $@
.PHONY: tests
tests: examples
@$(foreach e,$(shell find _build -name "*.native"),$(e) &&) \
echo "All good."
## Installation
uninstall:
$(OCAMLFIND) remove bindlib
install: all uninstall
$(OCAMLFIND) install bindlib _build/bindlib.cmx _build/bindlib.a \
_build/bindlib.cmi _build/bindlib.ml _build/bindlib.cma \
_build/bindlib.cmxa _build/bindlib.mli _build/bindlib.o \
_build/bindlib.cmo META
## Cleaning
clean:
$(OCAMLBUILD) -clean
distclean: clean
find . -name "*~" -exec rm {} \;
rm -f META
## Documentation
.PHONY: doc
doc: bindlib.docdir/index.html
bindlib.docdir/index.html: bindlib.ml bindlib.mli
$(OCAMLBUILD) $(DFLAGS) $@
.PHONY: updatedoc
updatedoc: doc
cp bindlib.docdir/*.* docs/ocamldoc/
## Release
.PHONY: release
release: distclean
git push origin
git tag -a ocaml-bindlib_$(VERSION)
git push origin ocaml-bindlib_$(VERSION)