Skip to content

Commit 0c2e1d8

Browse files
brsonlarsbergstrom
authored andcommitted
Add servo build support
1 parent 83cd488 commit 0c2e1d8

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed

Makefile.in

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
VPATH=%VPATH%
2+
3+
RUST ?= rust
4+
RUSTC ?= rustc
5+
RUSTFLAGS ?= -O
6+
VERSION=0.1-pre
7+
8+
libhttp_files=$(shell find $(VPATH)/src/libhttp/ -type f -name '*.rs') \
9+
$(VPATH)/src/libhttp/generated/read_method.rs \
10+
$(VPATH)/src/libhttp/generated/status.rs
11+
12+
all: libhttp.dummy
13+
14+
codegen: $(wildcard $(VPATH)/src/libhttp/codegen/*.rs)
15+
$(RUSTC) $(RUSTFLAGS) $(VPATH)/src/libhttp/codegen/codegen.rs -o codegen
16+
17+
$(VPATH)/src/libhttp/generated/%.rs: codegen
18+
./codegen $(patsubst $(VPATH)/src/libhttp/generated/%,%,$@) $(VPATH)/src/libhttp/generated/
19+
20+
libhttp.dummy: $(libhttp_files)
21+
$(RUSTC) $(RUSTFLAGS) $(VPATH)/src/libhttp/lib.rs --out-dir .
22+
touch $@
23+
24+
build/%:: src/%.rs libhttp.dummy
25+
mkdir -p '$(dir $@)'
26+
$(RUSTC) $(RUSTFLAGS) $< -o $@ -L build/
27+
28+
examples: build/examples/apache_fake build/examples/hello_world build/examples/info build/examples/client/client
29+
30+
.PHONY: check
31+
check: tests
32+
33+
tests: $(libhttp_files)
34+
$(RUSTC) $(RUSTFLAGS) --test -o tests $(VPATH)/src/libhttp/lib.rs
35+
tests --test
36+
37+
clean-tests:
38+
rm -f tests
39+
40+
clean: clean-tests
41+
rm -rf $(VPATH)src/libhttp/generated/ codegen
42+
rm -rf libhttp.dummy
43+
44+
.PHONY: all examples clean tests clean-tests

configure

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
3+
SRCDIR="$(cd $(dirname $0) && pwd)"
4+
sed "s#%VPATH%#${SRCDIR}#" ${SRCDIR}/Makefile.in > Makefile

0 commit comments

Comments
 (0)