forked from rust-lang/rust-by-example
-
Notifications
You must be signed in to change notification settings - Fork 28
/
Makefile
52 lines (43 loc) · 1.38 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
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/borrow/borrow.rs \
examples/borrow/freeze/freeze.rs \
examples/borrow/mut/mut.rs \
examples/bounds/bounds.rs \
examples/constants/constants.rs \
examples/crates/link/executable.rs \
examples/lifetime/borrow/borrow.rs \
examples/mod/mod.rs \
examples/print/print.rs \
examples/type/cast/cast.rs \
examples/type/type.rs \
examples/variables/scope/scope.rs \
examples/variables/mut/mut.rs \
examples/variables/declare/declare.rs \
examples/vec/vec.rs
srcs = $(filter-out $(WHITELIST),$(shell find examples -name '*.rs'))
.PHONY: all book clean test serve
all:
./setup-stage.sh zh-CN
$(RUSTC) src/update.rs --out-dir bin
bin/update zh-CN
en:
./setup-stage.sh
cargo run
book: node_modules/gitbook
$(GITBOOK) build stage
./fix-edit-button.sh
./add-relinks.sh
clean:
rm -rf bin stage
test:
@$(foreach src,$(srcs),$(RUSTC_NT) $(src) || exit;)
./check-line-length.sh
serve: node_modules/gitbook
$(GITBOOK) serve stage
node_modules/gitbook:
npm install gitbook