-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
51 lines (38 loc) · 1.26 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
PKGNAME = $(shell oasis query name)
PKGVERSION = $(shell oasis query version)
PKG_TARBALL = $(PKGNAME)-$(PKGVERSION).tar.gz
DISTFILES = README.md _oasis setup.ml Makefile \
$(wildcard $(addprefix src/, *.ml *.mli *.mllib *.mlpack *.ab))
PREFIX = $(shell opam config var prefix)
ifneq ($(PREFIX),)
PREFIX_FLAG = --prefix $(PREFIX)
endif
.PHONY: all byte native doc install uninstall reinstall test
all byte native setup.log: configure
ocaml setup.ml -build
configure: setup.data
setup.data: setup.ml
ocaml $< -configure --enable-tests $(PREFIX_FLAG)
setup.ml: _oasis
oasis setup -setup-update dynamic
touch $@
doc install uninstall reinstall test: setup.log
ocaml setup.ml -$@
# Make a tarball
.PHONY: dist tar
dist tar: $(DISTFILES)
mkdir $(PKGNAME)-$(PKGVERSION)
cp --parents -r $(DISTFILES) $(PKGNAME)-$(PKGVERSION)/
# setup.ml independent of oasis:
cd $(PKGNAME)-$(PKGVERSION) && oasis setup
tar -zcvf $(PKG_TARBALL) $(PKGNAME)-$(PKGVERSION)
$(RM) -rf $(PKGNAME)-$(PKGVERSION)
.PHONY: clean distclean dist-clean
clean:
ocaml setup.ml -clean
$(RM) $(PKG_TARBALL)
distclean dist-clean:: clean
ocaml setup.ml -distclean
$(RM) $(wildcard *.ba[0-9] *.bak *~ *.odocl)
opam:
oasis2opam http://pw374.github.io/distrib/$(PKGNAME)/$(PKGNAME)-$(PKGVERSION).tar.gz