forked from arjantop/rust-bencode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
37 lines (26 loc) · 638 Bytes
/
Makefile
File metadata and controls
37 lines (26 loc) · 638 Bytes
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
RUSTC = rustc
RUSTDOC = rustdoc
RUSTFLAGS = -O
BUILDDIR = target
TESTDIR = $(BUILDDIR)/test
all: $(BUILDDIR) test lib docs
$(BUILDDIR):
mkdir -p $@
$(TESTDIR): $(BUILDDIR)
mkdir -p $@
lib:
cargo build
clean:
rm -rf $(BUILDDIR)
test: libtest doctest
libtest: $(TESTDIR)
$(RUSTC) --test -o $(TESTDIR)/test src/bencode.rs
RUST_LOG=std::rt::backtrace ./$(TESTDIR)/test
bench: $(TESTDIR)
$(RUSTC) $(RUSTFLAGS) --test -o $(TESTDIR)/bench src/bencode.rs
./$(TESTDIR)/bench --bench
doctest: lib
$(RUSTDOC) -L $(BUILDDIR) --test src/bencode.rs
docs:
$(RUSTDOC) src/bencode.rs
.PHONY: lib clean test libtest bench doctest docs