-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
62 lines (46 loc) · 1.71 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
54
55
56
57
58
59
60
61
62
VERSION=1.0.2
all: debug
clean:
cargo clean
debug:
cargo build
tag:
git tag -a v${VERSION}
git push origin --tags
pub:
@# internal
jks build modbusgw
ver:
sed -i 's/^version = ".*/version = "${VERSION}"/g' Cargo.toml
sed -i 's/^const VERSION.*/const VERSION: \&str = "${VERSION}";/g' src/main.rs
release: prepare-targets release_x86_64 release_armhf release_win64 check-binaries
prepare-targets:
./.dev/prepare-targets.sh
release_x86_64:
cargo build --target x86_64-unknown-linux-musl --release
release_armhf:
cross build --target arm-unknown-linux-musleabihf --release
/usr/bin/arm-linux-gnueabihf-strip ./target/arm-unknown-linux-musleabihf/release/modbusgw
release_win64:
cargo build --target x86_64-pc-windows-gnu --release
check-binaries:
./.dev/check-binaries.sh
release-upload: release-upload-x86_64 release-upload-arm release-upload-win64
release-upload-x86_64:
cd ./target/x86_64-unknown-linux-musl/release && \
tar --owner=root --group=root -cvf /tmp/modbusgw.linux-x86_64-musl.tar modbusgw
gzip /tmp/modbusgw.linux-x86_64-musl.tar
./.dev/release-upload.sh modbusgw.linux-x86_64-musl.tar.gz
rm /tmp/modbusgw.linux-x86_64-musl.tar.gz
release-upload-arm:
cd ./target/arm-unknown-linux-musleabihf/release && \
tar --owner=root --group=root -cvf /tmp/modbusgw.linux-arm-musleabihf.tar modbusgw
gzip /tmp/modbusgw.linux-arm-musleabihf.tar
./.dev/release-upload.sh modbusgw.linux-arm-musleabihf.tar.gz
rm /tmp/modbusgw.linux-arm-musleabihf.tar.gz
release-upload-win64:
rm -f /tmp/modbusgw.windows-x86_64.zip
cd ./target/x86_64-pc-windows-gnu/release && \
zip /tmp/modbusgw.windows-x86_64.zip modbusgw.exe
./.dev/release-upload.sh modbusgw.windows-x86_64.zip
rm /tmp/modbusgw.windows-x86_64.zip