forked from chris-morgan/rust-http
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
80 lines (61 loc) · 2.09 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
RUSTC ?= rustc
RUSTDOC ?= rustdoc
RUSTPKG ?= rustpkg
RUSTFLAGS ?= -O
RUST_REPOSITORY ?= ../rust
RUST_CTAGS ?= $(RUST_REPOSITORY)/src/etc/ctags.rust
VERSION=0.1-pre
codegen_files=\
src/codegen/branchify.rs \
src/codegen/main.rs \
src/codegen/read_method.rs \
src/codegen/status.rs \
libhttp_so=build/libhttp-9296ff29-0.1-pre.so
http_files=\
src/http/lib.rs \
src/http/buffer.rs \
src/http/common.rs \
src/http/generated/read_method.rs \
src/http/generated/status.rs \
$(wildcard src/http/headers/*.rs) \
$(wildcard src/http/client/*.rs) \
$(wildcard src/http/server/*.rs) \
src/http/memstream.rs \
src/http/method.rs \
src/http/rfc2616.rs
http: $(libhttp_so)
$(libhttp_so): $(http_files)
mkdir -p build/
$(RUSTC) $(RUSTFLAGS) src/http/lib.rs --out-dir=build
all: http examples docs
build/codegen: $(codegen_files)
mkdir -p build/
$(RUSTC) src/codegen/main.rs --out-dir=build
src/http/generated:
mkdir -p src/http/generated
src/http/generated/%.rs: build/codegen src/http/generated
build/codegen $(patsubst src/http/generated/%,%,$@) src/http/generated/
build/%:: src/%/main.rs $(libhttp_so)
mkdir -p "$(dir $@)"
$(RUSTC) $(RUSTFLAGS) $< -o $@ -L build/
examples: $(patsubst src/examples/%/main.rs,build/examples/%,$(wildcard src/examples/*/main.rs)) \
$(patsubst src/examples/%/main.rs,build/examples/%,$(wildcard src/examples/*/*/main.rs))
docs: doc/http/index.html
doc/http/index.html: $(http_files)
$(RUSTDOC) src/http/lib.rs
build/tests: $(http_files)
$(RUSTC) $(RUSTFLAGS) --test -o build/tests src/http/lib.rs
build/quicktests: $(http_files)
$(RUSTC) --test -o build/quicktests src/http/lib.rs
# Can't wait for everything to build, optimised too? OK, you can save some time here.
quickcheck: build/quicktests
build/quicktests --test
check: all build/tests
build/tests --test
clean:
rm -rf src/http/generated/ src/http/codegen/codegen
rm -rf build/
rm -rf bin/ .rust/
TAGS:
ctags -f TAGS --options=$(RUST_CTAGS) -R src
.PHONY: all http examples docs clean check quickcheck