This repository has been archived by the owner on Jul 11, 2023. It is now read-only.
forked from chris-morgan/rust-http
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathMakefile.servo.in
62 lines (45 loc) · 1.55 KB
/
Makefile.servo.in
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
VPATH=%VPATH%
RUST ?= rust
RUSTC ?= rustc
RUSTFLAGS ?= -O
RUSTDOC_FLAGS ?=
HOST_RUSTFLAGS ?= -O
VERSION=0.1-pre
ifeq ($(CFG_OSTYPE),linux-androideabi)
SSL_FLAGS=--cfg nossl
else
SSL_FLAGS=
endif
libhttp_files=$(shell find $(VPATH)/src/http/ -type f -name '*.rs') \
$(VPATH)/src/http/generated/read_method.rs \
$(VPATH)/src/http/generated/status.rs
all: libhttp.dummy
codegen: $(wildcard $(VPATH)/src/codegen/*.rs)
$(RUSTC) $(HOST_RUSTFLAGS) $(VPATH)/src/codegen/main.rs -o codegen
$(VPATH)/src/http/generated:
mkdir -p $(VPATH)/src/http/generated
$(VPATH)/src/http/generated/%.rs: codegen $(VPATH)/src/http/generated
./codegen $(patsubst $(VPATH)/src/http/generated/%,%,$@) $(VPATH)/src/http/generated/
libhttp.dummy: $(libhttp_files)
$(RUSTC) $(RUSTFLAGS) $(SSL_FLAGS) $(VPATH)/src/http/lib.rs --out-dir .
touch $@
build/%:: src/%.rs libhttp.dummy
mkdir -p '$(dir $@)'
$(RUSTC) $(RUSTFLAGS) $< -o $@ -L build/
examples: build/examples/apache_fake build/examples/hello_world build/examples/info build/examples/client/client
.PHONY: doc
doc: $(RUSTDOC_TARGET)/http/index.html
$(RUSTDOC_TARGET)/http/index.html: $(libhttp_files)
$(RUSTDOC) $(RUSTDOC_FLAGS) $(SSL_FLAGS) $(VPATH)/src/http/lib.rs -o $(RUSTDOC_TARGET)
.PHONY: check
check: tests
tests: $(libhttp_files)
$(RUSTC) $(SSL_FLAGS) $(RUSTFLAGS) --test -o tests $(VPATH)/src/http/lib.rs
./tests --test
clean-tests:
rm -f tests
clean: clean-tests
rm -rf $(VPATH)/src/http/generated/ codegen
rm -rf libhttp.dummy
rm -f *.so *.dylib *.dll
.PHONY: all examples clean tests clean-tests