forked from Chris00/ocaml-mindstorm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
66 lines (54 loc) · 1.83 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
# Generic Makefile
PKGNAME = $(shell oasis query name)
VERSION = $(shell oasis query version)
DOC_DIR = _build/API.docdir
WEB_DIR = web
WEB = forge.ocamlcore.org:/home/groups/ocaml-mindstorm/htdocs
SCP = scp -C -p -r
DISTFILES = Makefile myocamlbuild.ml _oasis _opam setup.ml _tags \
$(wildcard $(addprefix src/, *.ml *.mli *.h *.c)) \
tests/ examples/
ROOT_TARBALL=$(PKGNAME)-$(VERSION)
PKG_TARBALL=$(PKGNAME)-$(VERSION).tar.gz
.PHONY: all byte native configure doc test install uninstall reinstall
all byte native: configure
ocaml setup.ml -build
configure: setup.ml
ocaml $< -configure --enable-tests
setup.ml: _oasis
oasis setup -setup-update dynamic
test doc install uninstall reinstall: all
ocaml setup.ml -$@
# Publish the doc to OCamlCore
.PHONY: upload-doc web web-doc website website-img
web: web-doc website website-img
upload-doc web-doc: doc
if [ -d $(DOC_DIR)/ ] ; then \
$(SCP) $(DOC_DIR)/*.html $(DOC_DIR)/*.css $(WEB)/doc/ \
&& echo "--- Published documentation on OCamlForge."; \
fi
website:
@ if [ -d $(WEB_DIR)/ ] ; then \
scp $(wildcard $(WEB_DIR)/*.html $(WEB_DIR)/*.css) LICENSE $(WEB) \
&& echo "--- Published web site (in $(WEB_DIR)/) on OCamlForge." ; \
fi
website-img:
@ if [ -d $(WEB_DIR)/ ] ; then \
scp $(wildcard $(WEB_DIR)/*.png $(WEB_DIR)/*.jpg) $(WEB) \
&& echo "--- Published images (in $(WEB_DIR)/) on OCamlForge." ; \
fi
.PHONY: dist tar
dist tar:
mkdir -p $(ROOT_TARBALL)
for f in $(DISTFILES); do \
cp -r --parents $$f $(ROOT_TARBALL); \
done
# Make a setup.ml independent of oasis:
cd $(ROOT_TARBALL) && oasis setup
tar -zcvf $(PKG_TARBALL) $(ROOT_TARBALL)
$(RM) -r $(ROOT_TARBALL)
@echo "Created tarball '$(PKG_TARBALL)'."
.PHONY: clean
clean::
-ocaml setup.ml -clean
$(RM) $(PKG_TARBALL) setup.data setup.log