forked from steveklabnik/rust-by-example
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
45 lines (38 loc) · 1.18 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
GITBOOK = gitbook
RUSTC = rustc
STRICT = -D deprecated
QUIET = -A unused-variables -A dead-code -A unused-assignments -A experimental
RUSTC_NT = $(RUSTC) --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/declare/declare.rs \
examples/variables/mut/mut.rs \
examples/variables/scope/scope.rs \
examples/vec/vec.rs \
srcs = $(filter-out $(WHITELIST),$(shell find examples -name '*.rs'))
.PHONY: all book clean test serve
all:
./setup-stage.sh
$(RUSTC) src/update.rs --out-dir bin
bin/update
book:
cd stage && $(GITBOOK) build
./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:
cd stage && $(GITBOOK) serve