-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile
62 lines (46 loc) · 1.36 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
.PHONY: build doc install uninstall check examples clean
.PHONY: dist docker-image publish-docker-image headers
EXPORTED_SOURCES= \
src/CST.ml \
src/errors.mli \
src/API.mli
ODIR=$(shell ocamlc -where)
build:
if command -v ocamlopt >/dev/null; then cp src/c/dune.native src/c/dune; fi
dune build @install
[ -e bin ] || ln -sf _build/install/default/bin bin
[ -e lib ] || ln -sf _build/install/default/lib/morbig lib
doc: build
dune build @doc
[ -e doc ] || ln -sf _build/default/_doc/_html doc
ifneq ($(PREFIX),)
INSTALL_ARGS := $(INSTALL_ARGS) --prefix $(PREFIX)
endif
ifneq ($(LIBDIR),)
INSTALL_ARGS := $(INSTALL_ARGS) --libdir $(LIBDIR)
endif
install: build
dune install $(INSTALL_ARGS)
uninstall: build
dune uninstall $(INSTALL_ARGS)
check:
dune test
examples:
find examples -name 'Makefile' | \
while read file; do dirname "$$file"; done | \
xargs -n1 make -C
clean:
rm -f src/c/dune
dune clean
rm -f bin lib doc
PACKAGE=$(shell echo morbig-`cat VERSION`)
dist: clean
git archive -o $(PACKAGE).tar --format tar --prefix $(PACKAGE)/ master
gzip -9 $(PACKAGE).tar
docker-image: Dockerfile
@docker build -t morbig .
publish-docker-image: docker-image
docker tag morbig colisanr/morbig:latest
docker image push colisanr/morbig:latest
headers:
headache -h .header $(shell find src/ tests/ -regex '.*\.ml[ily]?')