-
Notifications
You must be signed in to change notification settings - Fork 2
/
GNUmakefile
70 lines (57 loc) · 1.42 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
VERSION = devel
# Main target.
.PHONY: all
all: bin
.PHONY: bin
bin:
@dune build
# Documentation.
.PHONY: book
book: book/pml_book.pdf
book/pml_book.pdf: book/biblio.bib book/pml.py $(shell find book -name "*.tex")
@rm -rf book/_minted*
@cd book && rubber --unsafe -W all --pdf pml_book.tex
# Checks on the source code.
check:
@sh tools/sanity_check.sh
# Lib target (PML handles the dependencies).
.PHONY: lib
LIB_FILES = $(shell find lib -name "*.pml")
lib: bin $(LIB_FILES)
@for f in $(LIB_FILES); do dune exec -- pml --quiet $$f || break ; done
# Test target.
.PHONY: tests
TEST_FILES = $(shell find examples tests -name "*.pml")
tests: bin lib $(TEST_FILES)
@for f in $(TEST_FILES); do \
echo $$f; \
dune exec -- pml --quiet $$f || break ; \
done
# target to mesure time
.PHONY: time
time: bin
@find . -name \*.pmi -exec rm {} \;
@/usr/bin/time -f "Finished in %E at %P with %MKb of RAM" make -s tests
# Cleaning targets.
clean:
@find . -name \*.pmi -exec rm {} \;
@dune clean
distclean: clean
@rm -rf book/_minted*
@find . -type f -name "*~" -exec rm {} \;
@find . -type f -name \#\* -exec rm {} \;
@find . -type f -name .\#\* -exec rm {} \;
@cd book && rubber --clean --pdf pml_book.tex
# Install.
.PHONY: install
install: bin
@dune install
.PHONY: uninstall
uninstall:
@dune uninstall
# Release.
.PHONY: release
release: distclean
git push origin
git tag -a pml_$(VERSION)
git push origin pml_$(VERSION)