-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
75 lines (59 loc) · 2.54 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
63
64
65
66
67
68
69
70
71
72
73
74
75
VERSION=1.0.13
all: debug
clean:
find . -type d -name target -exec rm -rf {} \; || exit 0
find . -type f -name Cargo.lock -exec rm -f {} \; || exit 0
rm -f /tmp/pulr.*
debug:
cargo build
tag:
git tag -a v${VERSION} -m v${VERSION}
git push origin --tags
pub:
@# internal
jks build pulr
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
cd ./tools/ndj2influx && cargo build --target x86_64-unknown-linux-musl --release
release_armhf:
cargo build --target arm-unknown-linux-musleabihf --release
cd ./tools/ndj2influx && cross build --target arm-unknown-linux-musleabihf --release
/usr/bin/arm-linux-gnueabihf-strip ./tools/ndj2influx/target/arm-unknown-linux-musleabihf/release/ndj2influx
release_win64:
cargo build --target x86_64-pc-windows-gnu --release
cd ./tools/ndj2influx && 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/pulr.linux-x86_64-musl.tar pulr
cd ./tools/ndj2influx/target/x86_64-unknown-linux-musl/release && \
tar --owner=root --group=root -rvf /tmp/pulr.linux-x86_64-musl.tar ndj2influx
gzip /tmp/pulr.linux-x86_64-musl.tar
./.dev/release-upload.sh pulr.linux-x86_64-musl.tar.gz
rm /tmp/pulr.linux-x86_64-musl.tar.gz
release-upload-arm:
cd ./target/arm-unknown-linux-musleabihf/release && \
tar --owner=root --group=root -cvf /tmp/pulr.linux-arm-musleabihf.tar pulr
cd ./tools/ndj2influx/target/arm-unknown-linux-musleabihf/release && \
tar --owner=root --group=root -rvf /tmp/pulr.linux-arm-musleabihf.tar ndj2influx
gzip /tmp/pulr.linux-arm-musleabihf.tar
./.dev/release-upload.sh pulr.linux-arm-musleabihf.tar.gz
rm /tmp/pulr.linux-arm-musleabihf.tar.gz
release-upload-win64:
rm -f /tmp/pulr.windows-x86_64.zip
cd ./target/x86_64-pc-windows-gnu/release && \
zip /tmp/pulr.windows-x86_64.zip pulr.exe
cd ./tools/ndj2influx/target/x86_64-pc-windows-gnu/release && \
zip /tmp/pulr.windows-x86_64.zip ndj2influx.exe
cd /opt/libplctag/windows-x86_64 && \
zip /tmp/pulr.windows-x86_64.zip plctag.dll
./.dev/release-upload.sh pulr.windows-x86_64.zip
rm /tmp/pulr.windows-x86_64.zip