forked from rust-lang-cn/rust-by-example-cn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
57 lines (46 loc) · 1.56 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
GITBOOK = node_modules/.bin/gitbook
RUSTC = rustc
STRICT = -D deprecated
QUIET = -A unused-variables -A dead-code -A unused-assignments
RUSTC_NT = $(RUSTC) -Z no-trans --test $(QUIET) # ${STRICT}
WHITELIST = examples/attribute/cfg/custom/custom.rs \
examples/scope/borrow/borrow.rs \
examples/scope/borrow/freeze/freeze.rs \
examples/scope/borrow/mut/mut.rs \
examples/trait/bounds/bounds.rs \
examples/custom_types/constants/constants.rs \
examples/crates/link/executable.rs \
examples/scope/lifetime/borrow/borrow.rs \
examples/mod/mod.rs \
examples/hello/print/print.rs \
examples/cast/cast.rs \
examples/primitives/primitives.rs \
examples/variable_bindings/scope/scope.rs \
examples/variable_bindings/mut/mut.rs \
examples/variable_bindings/declare/declare.rs \
examples/std/vec/vec.rs
srcs = $(filter-out $(WHITELIST),$(shell find examples -name '*.rs'))
.PHONY: all html epub mobi pdf clean test serve
all:
./setup-stage.sh
cargo run
html: node_modules/gitbook
$(GITBOOK) build stage
./fix-edit-button.sh
./add-relinks.sh
epub: node_modules/gitbook
$(GITBOOK) epub stage
mobi: node_modules/gitbook
$(GITBOOK) mobi stage
pdf: node_modules/gitbook
$(GITBOOK) pdf stage
clean:
rm -rf bin stage
test:
@$(foreach src,$(srcs),$(RUSTC_NT) $(src) || exit;)
./check-line-length.sh
./check-links.sh
serve: node_modules/gitbook
$(GITBOOK) serve stage
node_modules/gitbook:
npm install [email protected]