-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
zu1k
committed
Nov 19, 2021
1 parent
4a7ef46
commit 761be71
Showing
3 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
target | ||
bin | ||
ca | ||
.vscode | ||
.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
NAME=good-mitm | ||
BINDIR=bin | ||
VERSION=$(shell git describe --tags || echo "unknown version") | ||
UPX=upx --best | ||
STRIP=llvm-strip -s | ||
CROSS_BUILD=cross build --release --target | ||
|
||
all: fmt clippy build | ||
|
||
build: | ||
cargo build | ||
|
||
clean: | ||
cargo clean | ||
|
||
deps: | ||
cargo install cargo-strip xargo cross | ||
|
||
fmt: | ||
cargo fmt --all | ||
|
||
clippy: | ||
cargo clippy | ||
|
||
a: fmt clippy | ||
|
||
|
||
CROSS_TARGET_LIST = \ | ||
x86_64-unknown-linux-musl \ | ||
i686-unknown-linux-musl \ | ||
aarch64-unknown-linux-musl \ | ||
armv7-unknown-linux-musleabihf \ | ||
|
||
$(CROSS_TARGET_LIST): | ||
$(CROSS_BUILD) $@ | ||
cp "target/$@/release/$(NAME)" "$(BINDIR)/$(NAME)-$@" | ||
$(STRIP) "$(BINDIR)/$(NAME)-$@" | ||
$(UPX) "$(BINDIR)/$(NAME)-$@" | ||
|
||
windows: | ||
cargo build --target x86_64-pc-windows-gnu --release | ||
cp "target/x86_64-pc-windows-gnu/release/$(NAME).exe" "$(BINDIR)/$(NAME)-x86_64-pc-windows-gnu.exe" | ||
$(UPX) "$(BINDIR)/$(NAME)-x86_64-pc-windows-gnu.exe" | ||
|
||
bindir: | ||
rm -rf $(BINDIR) | ||
mkdir $(BINDIR) | ||
|
||
bin_gz=$(addsuffix .gz, $(CROSS_TARGET_LIST)) | ||
|
||
$(bin_gz): %.gz : % | ||
chmod +x $(BINDIR)/$(NAME)-$(basename $@) | ||
gzip -f -S -$(VERSION).gz $(BINDIR)/$(NAME)-$(basename $@) | ||
|
||
gz_release: $(bin_gz) | ||
|
||
release: bindir gz_release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters