Makefile 1.17 KB
Newer Older
1 2 3
ALL_TARGETS := all.otarget
ALL_TARGETS += $(if $(shell sh -c "command -v ocamlopt"),all-native.otarget)

4
minimal:
5
	rm -f _build/BUILD
6 7
	ocamlbuild minimal.otarget

Stephane Glondu's avatar
Stephane Glondu committed
8
all:
9
	rm -f _build/BUILD
10
	ocamlbuild $(ALL_TARGETS)
Stephane Glondu's avatar
Stephane Glondu committed
11

12
check: minimal
13
	demo/demo.sh
14
	demo/demo-threshold.sh
Stephane Glondu's avatar
Stephane Glondu committed
15

Stephane Glondu's avatar
Stephane Glondu committed
16
clean:
17 18
	-ocamlbuild -clean
	rm -rf _build
Stephane Glondu's avatar
Stephane Glondu committed
19
	rm -f *~
Stephane Glondu's avatar
Stephane Glondu committed
20 21 22

tree: _build/tree.html

23
_build/tree.html: _build/_digests
Stephane Glondu's avatar
Stephane Glondu committed
24
	mkdir -p _build
Stephane Glondu's avatar
Stephane Glondu committed
25
	tree -o $@ -H '..'  -I '_build|_run|*~'
26

Stephane Glondu's avatar
Stephane Glondu committed
27
.PHONY: doc
28 29 30 31 32
doc:
	ocamlbuild doc.otarget
	$(MAKE) doc/specification.pdf

doc/specification.pdf: doc/specification.tex
Stephane Glondu's avatar
Stephane Glondu committed
33
	cd doc && for u in 1 2 3; do pdflatex specification.tex; done
Stephane Glondu's avatar
Stephane Glondu committed
34 35

archive:
36 37 38 39 40 41 42 43 44 45 46 47 48
	@if [ `git status --porcelain | grep -v '^?? ' | wc -l ` -eq 0 ]; then \
	  COMMIT_ID=`git describe --tags`; \
	  VERSION=`cat VERSION`; \
	  if [ "$$(printf $$COMMIT_ID | head -c$$(printf $$VERSION | wc -c))" = "$$VERSION" ]; then \
	    git archive --prefix=belenios-$$COMMIT_ID/ $$COMMIT_ID | gzip -9n > ../belenios-$$COMMIT_ID.tar.gz; \
	    ln -sf belenios-$$COMMIT_ID.tar.gz ../belenios.tar.gz; \
	    ls -l ../belenios.tar.gz; \
	  else \
	    echo "VERSION is not up-to-date!"; exit 1; \
	  fi; \
	else \
	  echo "The tree is not clean!"; exit 1; \
	fi