-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
52 lines (40 loc) · 1.01 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
PKG_NAME=colerr
DOCS_DEFAULT_MODULE=colerr
DEFAULT_TARGET=build
EXAMPLES =
default: $(DEFAULT_TARGET)
# Mostly generic part goes below
ifneq ($(RELEASE),)
$(info RELEASE BUILD)
CARGO_FLAGS += --release
ALL_TARGETS += build test bench $(EXAMPLES)
else
$(info DEBUG BUILD; use `RELEASE=true make [args]` for release build)
ALL_TARGETS += build test $(EXAMPLES)
endif
all: $(ALL_TARGETS)
.PHONY: run test build doc clean
run test build clean:
cargo $@ $(CARGO_FLAGS)
.PHONY: bench
bench:
cargo $@ $(filter-out --release,$(CARGO_FLAGS))
.PHONY: longtest
longtest:
for i in `seq 100`; do cargo test $(CARGO_FLAGS) || exit 1 ; done
.PHONY: $(EXAMPLES)
$(EXAMPLES):
cargo build --example $@ $(CARGO_FLAGS)
.PHONY: doc
doc:
cargo doc
.PHONY: publishdoc
publishdoc: doc
echo '<meta http-equiv="refresh" content="0;url='${DOCS_DEFAULT_MODULE}'/index.html">' > target/doc/index.html
ghp-import -n target/doc
git push -f origin gh-pages
.PHONY: docview
docview: doc
xdg-open target/doc/$(PKG_NAME)/index.html
.PHONY: FORCE
FORCE: