This repository has been archived by the owner on Oct 30, 2024. It is now read-only.
forked from pcvolkmer/osc-variant
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
51 lines (41 loc) · 1.43 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
ifndef VERBOSE
.SILENT:
endif
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 osc-variant || true
cp target/x86_64-pc-windows-gnu/release/osc-variant.exe osc-variant/
cp -r examples osc-variant/
cp README.md osc-variant/
cp LICENSE.txt osc-variant/
# first try (linux) zip command, then powershell sub command to create ZIP file
zip osc-variant-$(TAG)_win64.zip osc-variant/* osc-variant/examples/* || powershell Compress-ARCHIVE osc-variant osc-variant-$(TAG)_win64.zip
rm -rf osc-variant || true
.PHONY: linux-package
linux-package: linux-binary-x86_64
mkdir osc-variant || true
cp target/x86_64-unknown-linux-gnu/release/osc-variant osc-variant/
cp -r examples osc-variant/
cp README.md osc-variant/
cp LICENSE.txt osc-variant/
tar -czvf osc-variant-$(TAG)_linux.tar.gz osc-variant/
rm -rf osc-variant || 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 --features unzip-osb
.PHONY: linux-binary-x86_64
linux-binary-x86_64:
cargo build --release --target=x86_64-unknown-linux-gnu --features unzip-osb
.PHONY: install
install:
cargo install --path .
.PHONY: clean
clean:
cargo clean
rm -rf osc-variant 2>/dev/null || true
rm *_win64.zip 2>/dev/null || true
rm *_linux.tar.gz 2>/dev/null || true