-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
53 lines (45 loc) · 1.14 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
50
51
52
53
SHELL := /bin/bash
COMPILER = rustc
COMPILER_FLAGS = -O
RUSTDOC = rustdoc
UPX := $(shell command -v upx 2> /dev/null)
.PHONY: all
all:
cargo build --release
strip target/release/kutt
ifdef UPX
upx target/release/kutt
endif
cargo install --path .
.PHONY: build
build:
cargo build --release
strip target/release/kutt
upx target/release/kutt
.PHONY: build-linux
build-linux:
cargo build --target x86_64-unknown-linux-musl --release
strip target/x86_64-unknown-linux-musl/release/kutt
upx target/x86_64-unknown-linux-musl/release/kutt
.PHONY: build-win
build-win:
RUSTFLAGS="-C linker=x86_64-w64-mingw32-gcc" cargo build --target x86_64-pc-windows-gnu --release
strip target/x86_64-pc-windows-gnu/release/kutt.exe
upx target/x86_64-pc-windows-gnu/release/kutt.exe
.PHONY: build-mac
build-mac:
cargo build --target x86_64-apple-darwin --release
strip target/x86_64-apple-darwin/release/kutt
upx target/x86_64-apple-darwin/release/kutt
.PHONY: run
run:
ifndef ARGS
@echo Run "make run" with ARGS set to pass arguments…
endif
cargo run --release -- $(ARGS)
.PHONY: install
install:
cargo install --path .
.PHONY: clean
clean:
cargo clean