Skip to content

Commit

Permalink
build: add make file
Browse files Browse the repository at this point in the history
  • Loading branch information
pcvolkmer committed Feb 28, 2024
1 parent 31d8c9b commit 98a2044
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
ifndef VERBOSE
.SILENT:
endif

PROG_NAME = "bzkf-rwdp-check"

TAG = `git describe --tag 2>/dev/null`

REV = git`git rev-parse HEAD | cut -c1-7`

package-all: win-package linux-package

.PHONY: win-package
win-package: win-binary-x86_64
mkdir $(PROG_NAME) 2>/dev/null || true
cp target/x86_64-pc-windows-gnu/release/$(PROG_NAME).exe $(PROG_NAME)/
cp README.md $(PROG_NAME)/
cp LICENSE $(PROG_NAME)/
zip $(PROG_NAME)-$(TAG)_win64.zip $(PROG_NAME)/*
rm -rf $(PROG_NAME) || true

.PHONY: linux-package
linux-package: linux-binary-x86_64
mkdir $(PROG_NAME) 2>/dev/null || true
cp target/x86_64-unknown-linux-gnu/release/$(PROG_NAME) $(PROG_NAME)/
cp README.md $(PROG_NAME)/
cp LICENSE $(PROG_NAME)/
tar -czvf $(PROG_NAME)-$(TAG)_linux.tar.gz $(PROG_NAME)/
rm -rf $(PROG_NAME) || true

binary-all: win-binary-x86_64 linux-binary-x86_64

.PHONY: win-binary-x86_64
win-binary-x86_64:
cargo build --release --target=x86_64-pc-windows-gnu

.PHONY: linux-binary-x86_64
linux-binary-x86_64:
cargo build --release --target=x86_64-unknown-linux-gnu

.PHONY: install
install:
cargo install --path .

.PHONY: clean
clean:
cargo clean
rm -rf $(PROG_NAME) 2>/dev/null || true
rm *_win64.zip 2>/dev/null || true
rm *_linux.tar.gz 2>/dev/null || true

0 comments on commit 98a2044

Please sign in to comment.