-
-
Notifications
You must be signed in to change notification settings - Fork 184
Expand file tree
/
Copy pathMakefile
More file actions
69 lines (55 loc) · 2.59 KB
/
Makefile
File metadata and controls
69 lines (55 loc) · 2.59 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
clean:
cargo clean
build:
cargo build
test:
cargo test
lint:
cargo clippy --all-targets --all-features -- -D warnings
build_release:
cargo build --release
sync_bahamut:
@echo "@ bahamut sync && build ..."
@rsync -rvzc --exclude=cake-data --exclude=.git --exclude=target . bahamut.local:/home/evilsocket/cake
@rsync -rvzc cake-data/8b-test/bahamut-node bahamut.local:/home/evilsocket/cake-data
sync_blade:
@echo "@ blade sync && build ..."
@rsync -rvzc --exclude=cake-data --exclude=.git --exclude=target . blade.local:/home/evilsocket/cake
@rsync -rvzc cake-data/8b-test/blade-node blade.local:/home/evilsocket/cake-data
sync: sync_bahamut sync_blade
publish:
cargo publish -p cake-core
cargo publish -p cake-cli
# ---------------------------------------------------------------------------
# cake-mobile: Kotlin Multiplatform Worker App (iOS + Android)
# ---------------------------------------------------------------------------
# Rust static library for iOS (Metal enabled).
# Copies libcake_mobile.a to Generated/ where the KMP cinterop linker looks for it.
mobile_rust_ios:
cargo build --release --target=aarch64-apple-ios -p cake-mobile --features metal
mkdir -p cake-mobile-app/iosApp/iosApp/Generated
cp target/aarch64-apple-ios/release/libcake_mobile.a \
cake-mobile-app/iosApp/iosApp/Generated/
# Rust shared library for Android arm64 (CPU only) + UniFFI Kotlin bindings
mobile_rust_android:
cargo ndk -t aarch64-linux-android build --release -p cake-mobile
cargo run --bin uniffi-bindgen generate \
--library ./target/aarch64-linux-android/debug/libcake_mobile.so \
--language kotlin \
--out-dir ./cake-mobile-app/shared/src/androidMain/kotlin
mkdir -p cake-mobile-app/androidApp/src/main/jniLibs/arm64-v8a
cp target/aarch64-linux-android/release/libcake_mobile.so \
cake-mobile-app/androidApp/src/main/jniLibs/arm64-v8a/
# Build Android debug APK
mobile_android: mobile_rust_android
cd cake-mobile-app && ./gradlew :androidApp:assembleDebug
# Build iOS KMP shared.framework (run on macOS/stevie):
# 1. Builds libcake_mobile.a and copies to Generated/
# 2. Gradle builds the KMP framework (Kotlin/Native links against libcake_mobile.a via cinterop)
# 3. Copies the resulting shared.framework to iosApp/Frameworks/ for Xcode
mobile_ios: mobile_rust_ios
cd cake-mobile-app && ./gradlew :shared:linkReleaseFrameworkIosArm64
mkdir -p cake-mobile-app/iosApp/iosApp/Frameworks
rm -rf cake-mobile-app/iosApp/iosApp/Frameworks/shared.framework
cp -r cake-mobile-app/shared/build/bin/iosArm64/sharedReleaseFramework/shared.framework \
cake-mobile-app/iosApp/iosApp/Frameworks/