-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
53 lines (47 loc) · 2.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
52
53
.PHONY: release-mac-x86_64, release-mqtt-auth-server, release-mac-aarch64, release-linux, release-linux-aarch64
name = mproxy
ctrl_name = mpublish
rust_path = agent
release-mqtt-auth-server:
ifeq ($(VERSION), )
$(error VEDRSION is not set)
else
cd auth-server && DOCKER_BUILDKIT=1 docker build . -t="ghcr.io/fornetcode/mqtt-auth-server:$(VERSION)"
docker push ghci.io/fornetcode/mqtt-auth-server:$(VERSION)
endif
release-mac-x86_64:
mkdir -p release
cd $(rust_path) && cargo build --release --target=x86_64-apple-darwin
strip $(rust_path)/target/x86_64-apple-darwin/release/$(name)
otool -L $(rust_path)/target/x86_64-apple-darwin/release/$(name)
cp $(rust_path)/target/x86_64-apple-darwin/release/$(name) ./release/
strip $(rust_path)/target/x86_64-apple-darwin/release/$(ctrl_name)
otool -L $(rust_path)/target/x86_64-apple-darwin/release/$(ctrl_name)
cp $(rust_path)/target/x86_64-apple-darwin/release/$(ctrl_name) ./release/
# brew install wget
release-mac-aarch64:
mkdir -p release
cd $(rust_path) && cargo build --release --target=aarch64-apple-darwin
strip $(rust_path)/target/aarch64-apple-darwin/release/$(name)
otool -L $(rust_path)/target/aarch64-apple-darwin/release/$(name)
cp $(rust_path)/target/aarch64-apple-darwin/release/$(name) ./release/
strip $(rust_path)/target/aarch64-apple-darwin/release/$(ctrl_name)
otool -L $(rust_path)/target/aarch64-apple-darwin/release/$(ctrl_name)
cp $(rust_path)/target/aarch64-apple-darwin/release/$(ctrl_name) ./release/
release-linux-aarch64:
sudo apt-get install -y build-essential
mkdir release
cd $(rust_path) && cargo build --release --target=aarch64-unknown-linux-gnu
strip $(rust_path)/target/aarch64-unknown-linux-gnu/release/$(name)
cp $(rust_path)/target/aarch64-unknown-linux-gnu/release/$(name) ./release/
cd $(rust_path) && cargo build --release --target=aarch64-unknown-linux-gnu
strip $(rust_path)/target/aarch64-unknown-linux-gnu/release/$(ctrl_name)
cp $(rust_path)/target/aarch64-unknown-linux-gnu/release/$(ctrl_name) ./release/
release-linux:
sudo apt-get install -y build-essential
mkdir release
cd $(rust_path) && cargo build --release --target=x86_64-unknown-linux-gnu
strip $(rust_path)/target/x86_64-unknown-linux-gnu/release/$(name)
cp $(rust_path)/target/x86_64-unknown-linux-gnu/release/$(name) ./release
strip $(rust_path)/target/x86_64-unknown-linux-gnu/release/$(ctrl_name)
cp $(rust_path)/target/x86_64-unknown-linux-gnu/release/$(ctrl_name) ./release