-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathMakefile
More file actions
50 lines (36 loc) · 1.15 KB
/
Makefile
File metadata and controls
50 lines (36 loc) · 1.15 KB
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
VERSION=$(shell cat Cargo.toml | grep version | head -1 | cut -d'"' -f 2)
PWD=$(shell pwd)
all: release build-linux-musl
release:
@@echo "building..."
@@cargo build --release
build-linux-musl:
@@echo "building using docker..."
@@docker run -it --rm -v $(PWD):/workdir \
-v /tmp:/root/.cargo/git \
-v /tmp:/root/.cargo/registry \
anvie/rust-musl-build:rust_nightly \
make _build-linux-musl
_build-linux-musl:
cargo update
cargo build --release --target=x86_64-unknown-linux-musl
build-linux-static:
RUSTFLAGS='-C target-feature=+crt-static' cargo build --release --target x86_64-unknown-linux-musl
dist:
make dist-osx
make dist-linux
dist-osx:
@@echo Build OSX distribution...
make release
cd target/release && rm -f reframe_v$(VERSION)-x86_64-darwin.zip && zip -r reframe_v$(VERSION)-x86_64-darwin.zip reframe
dist-linux:
@@echo Build Linux distribution...
make build-linux-musl
cd target/x86_64-unknown-linux-musl/release && rm -f reframe_v$(VERSION)-x86_64-linux.zip && zip -r reframe_v$(VERSION)-x86_64-linux.zip reframe
fmt:
@@cargo fmt
test:
@@cargo test
clean:
@@cargo clean
.PHONY: fmt release build-linux-musl clean test dist