-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
50 lines (36 loc) · 991 Bytes
/
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
build:
@dune build @install --profile=release
clean:
@cargo clean
@dune clean
check:
@cargo check
doc:
@dune build @doc
dev: build test
test:
@dune runtest --force --no-buffer
install: build
@dune install
# TODO: post vendoring
# must create this manually, since dune won't take it as a dependency
# see https://github.com/ocaml/dune/issues/1407
cargo-config-file:
@mkdir -p .cargo
#@cat cargo-config > .cargo/config
CAML_LIB ?= $(shell ocamlc -where)
CARGO_FLAGS = --release
# TODO: post vendoring
# CARGO_FLAGS = --release --frozen
build-rust-stubs: cargo-config-file
@if [ "$$(uname)" = "Darwin" ]; then \
RUSTFLAGS='-L $(CAML_LIB) -lcamlrun' cargo build $(CARGO_FLAGS) ; \
else \
cargo build $(CARGO_FLAGS) ; \
fi
reindent:
@find src '(' -name '*.ml' -or -name '*.mli' ')' -print0 | xargs -0 echo "reindenting: "
@find src '(' -name '*.ml' -or -name '*.mli' ')' -print0 | xargs -0 ocp-indent -i
watch:
@dune build @all -w
.PHONY: prebuild check clean