This repository was archived by the owner on Oct 31, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
104 lines (81 loc) · 3.91 KB
/
Makefile
File metadata and controls
104 lines (81 loc) · 3.91 KB
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
uname_m = $(shell uname -m)
ifeq ($(uname_m),x86_64)
ARCH += x64
ARCH_DEB += amd64
else
ARCH += arm64
ARCH_DEB += arm64
endif
TARGET_EXEC := wayvern
DEPS_DIR := third_party/flutter_engine
DEBUG_BUILD_DIR := target/debug
PROFILE_BUILD_DIR := target/profile
RELEASE_BUILD_DIR := target/release
DEBUG_BUNDLE_DIR := $(DEBUG_BUILD_DIR)/bundle
PROFILE_BUNDLE_DIR := $(PROFILE_BUILD_DIR)/bundle
RELEASE_BUNDLE_DIR := $(RELEASE_BUILD_DIR)/bundle
ENGINE_REVISION := $(shell flutter --version | grep Engine | awk '{print $$NF}')
$(DEPS_DIR)/debug/libflutter_engine.so:
curl -L https://github.com/sony/flutter-embedded-linux/releases/download/$(ENGINE_REVISION)/elinux-$(ARCH)-debug.zip >/tmp/elinux-$(ARCH)-debug.zip
unzip -o /tmp/elinux-$(ARCH)-debug.zip -d /tmp || exit
mkdir -p $(DEPS_DIR)/debug
mv /tmp/libflutter_engine.so $(DEPS_DIR)/debug
$(DEPS_DIR)/profile/libflutter_engine.so:
curl -L https://github.com/sony/flutter-embedded-linux/releases/download/$(ENGINE_REVISION)/elinux-$(ARCH)-profile.zip >/tmp/elinux-$(ARCH)-profile.zip
unzip -o /tmp/elinux-$(ARCH)-profile.zip -d /tmp || exit
mkdir -p $(DEPS_DIR)/profile
mv /tmp/libflutter_engine.so $(DEPS_DIR)/profile
$(DEPS_DIR)/release/libflutter_engine.so:
curl -L https://github.com/sony/flutter-embedded-linux/releases/download/$(ENGINE_REVISION)/elinux-$(ARCH)-release.zip >/tmp/elinux-$(ARCH)-release.zip
unzip -o /tmp/elinux-$(ARCH)-release.zip -d /tmp || exit
mkdir -p $(DEPS_DIR)/release
mv /tmp/libflutter_engine.so $(DEPS_DIR)/release
cargo_debug:
BUNDLE= FLUTTER_ENGINE=debug cargo build
cargo_profile:
BUNDLE= FLUTTER_ENGINE=profile cargo build --release
cargo_release:
BUNDLE= FLUTTER_ENGINE=release cargo build --release
flutter_debug:
cd wayvern_flutter && flutter build linux --debug
flutter_profile:
cd wayvern_flutter && flutter build linux --profile
flutter_release:
cd wayvern_flutter && flutter build linux --release
debug_bundle: $(DEPS_DIR)/debug/libflutter_engine.so flutter_debug cargo_debug
mkdir -p $(DEBUG_BUNDLE_DIR)/lib/
cp target/debug/$(TARGET_EXEC) $(DEBUG_BUNDLE_DIR)
cp $(DEPS_DIR)/debug/libflutter_engine.so $(DEBUG_BUNDLE_DIR)/lib
cp -r wayvern_flutter/build/linux/$(ARCH)/debug/bundle/data $(DEBUG_BUNDLE_DIR)
# cp lsan_suppressions.txt $(DEBUG_BUNDLE_DIR)
profile_bundle: $(DEPS_DIR)/profile/libflutter_engine.so flutter_profile cargo_profile
mkdir -p $(PROFILE_BUNDLE_DIR)/lib/
cp target/release/$(TARGET_EXEC) $(PROFILE_BUNDLE_DIR)
cp $(DEPS_DIR)/profile/libflutter_engine.so $(PROFILE_BUNDLE_DIR)/lib
cp wayvern_flutter/build/linux/$(ARCH)/profile/bundle/lib/libapp.so $(PROFILE_BUNDLE_DIR)/lib
cp -r wayvern_flutter/build/linux/$(ARCH)/profile/bundle/data $(PROFILE_BUNDLE_DIR)
release_bundle: $(DEPS_DIR)/release/libflutter_engine.so flutter_release cargo_release
mkdir -p $(RELEASE_BUNDLE_DIR)/lib/
cp target/release/$(TARGET_EXEC) $(RELEASE_BUNDLE_DIR)
cp $(DEPS_DIR)/release/libflutter_engine.so $(RELEASE_BUNDLE_DIR)/lib
cp wayvern_flutter/build/linux/$(ARCH)/release/bundle/lib/libapp.so $(RELEASE_BUNDLE_DIR)/lib
cp -r wayvern_flutter/build/linux/$(ARCH)/release/bundle/data $(RELEASE_BUNDLE_DIR)
# Usage: make deb_package VERSION=0.2
deb_package: release_bundle
mkdir -p build/zenith/release/deb/debpkg
cp -r dpkg/* build/zenith/release/deb/debpkg
sed -i 's/$$VERSION/$(VERSION)/g' build/zenith/release/deb/debpkg/DEBIAN/control
sed -i 's/$$ARCH/$(ARCH_DEB)/g' build/zenith/release/deb/debpkg/DEBIAN/control
cp -r build/zenith/release/bundle/* build/zenith/release/deb/debpkg/opt/zenith
dpkg-deb -Zxz --root-owner-group --build build/zenith/release/deb/debpkg build/zenith/release/deb
attach_debugger:
flutter attach --debug-uri=http://127.0.0.1:12345/
all: debug_bundle profile_bundle release_bundle
clean:
cargo clean
cd dart && flutter clean
.PHONY: clean all \
flutter_debug flutter_profile flutter_release \
cargo_debug cargo_profile cargo_release \
debug_bundle profile_bundle release_bundle \
deb_package attach_debugger