File: Makefile

package info (click to toggle)
morbig 0.11.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,704 kB
  • sloc: ml: 4,015; sh: 787; ansic: 227; makefile: 69
file content (67 lines) | stat: -rw-r--r-- 1,556 bytes parent folder | download
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
.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: build
	@ output=$$(./tests/run 2>&1) ;     \
	  status=$$? ;                      \
	  echo "$$output" | tee tests.org ; \
	  exit $$status

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
	rm -f tests.org
	tests/run clean || true

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/ -regex '.*\.ml[ily]?')