-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathMakefile
49 lines (37 loc) · 1.33 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
RUSTC ?= rustc
# ------------------
# Internal variables
dummy1 := $(shell mkdir bin 2> /dev/null)
# ------------------
# Primary targets
all: parser
parser: lib
check: bin/test-rparse
export RUST_LOG=rparse=1 && ./bin/test-rparse
check1: bin/test-rparse
export RUST_LOG=rparse=3 && ./bin/test-rparse test_expr::test_expr
# Run unit tests with optimizations enabled (which is how we build the lib).
check-release: bin/test-rparse-release
export RUST_LOG=rparse=1 && ./bin/test-rparse-release
install:
install `find bin -maxdepth 1 -name "librparse*" -type f` /usr/local/lib/rust/
clean:
rm -rf bin
dist: lib
tar --create --compress --exclude \*/.git --exclude \*/.git/\* --file=rparse-0.6.tar.gz \
CHANGES MIT.X11 Makefile README.md rparse.rtf src
# ------------------
# Binary targets
# We always build the lib because:
# 1) We don't do it that often.
# 2) It's fast.
# 3) The compiler gives it some crazy name like "librparse-da45653350eb4f90-0.1.dylib"
# which is dependent on some hash(?) as well as the current platform. (And -o works when
# setting an executable's name, but not libraries).
.PHONY : lib
lib:
$(RUSTC) --lib --out-dir bin -O src/rparse.rc
bin/test-rparse: src/rparse.rc src/*.rs src/tests/*.rs
$(RUSTC) --test -o $@ $<
bin/test-rparse-release: src/rparse.rc src/*.rs src/tests/*.rs
$(RUSTC) --test -O -o $@ $<