-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
34 lines (30 loc) · 1.1 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
.PHONY: local
local:
cargo build --release
.PHONY: run
run:
ifndef ARGS
@echo Run "make run" with ARGS set to pass arguments…
endif
cargo run --release -- $(ARGS)
.PHONY: build-linux
build-linux:
cargo build --target x86_64-unknown-linux-musl --release --locked
strip target/x86_64-unknown-linux-musl/release/api
upx --lzma target/x86_64-unknown-linux-musl/release/api
strip target/x86_64-unknown-linux-musl/release/cli
upx --lzma target/x86_64-unknown-linux-musl/release/cli
.PHONY: build-win
build-win:
RUSTFLAGS="-C linker=x86_64-w64-mingw32-gcc" cargo build --target x86_64-pc-windows-gnu --release --locked
strip target/x86_64-pc-windows-gnu/release/api.exe
upx --lzma target/x86_64-pc-windows-gnu/release/api.exe
strip target/x86_64-pc-windows-gnu/release/cli.exe
upx --lzma target/x86_64-pc-windows-gnu/release/cli.exe
.PHONY: build-mac
build-mac:
cargo build --target x86_64-apple-darwin --release --locked
strip target/x86_64-apple-darwin/release/api
upx --lzma target/x86_64-apple-darwin/release/api
strip target/x86_64-apple-darwin/release/cli
upx --lzma target/x86_64-apple-darwin/release/cli