-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile
61 lines (53 loc) · 2.99 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
SHELL := /bin/bash
debug: clean_up generate_android_debug generate_ios_debug
release: clean_up generate_android generate_ios
clean_up:
@echo "Step: Removing target"
rm -rf ./target
rm -rf ./interfaces/ur_registry_flutter/android/src/main/jniLibs
rm -f ./interfaces/ur_registry_flutter/ios/libur_registry_ffi.a
mkdir ./interfaces/ur_registry_flutter/android/src/main/jniLibs
mkdir ./interfaces/ur_registry_flutter/android/src/main/jniLibs/arm64-v8a
mkdir ./interfaces/ur_registry_flutter/android/src/main/jniLibs/armeabi-v7a
mkdir ./interfaces/ur_registry_flutter/android/src/main/jniLibs/x86
@echo "Cleaning up"
generate_android:
@echo "Step: Generating Android builds"
@echo "1: arm64-v8a"
cargo ndk -t arm64-v8a build -p ur-registry-ffi --release
@echo "2: armeabi-v7a"
cargo ndk -t armeabi-v7a build -p ur-registry-ffi --release
@echo "3: x86"
cargo ndk -t x86 build -p ur-registry-ffi --release
@echo "Android buildup"
cp ./target/aarch64-linux-android/release/libur_registry_ffi.so ./interfaces/ur_registry_flutter/android/src/main/jniLibs/arm64-v8a/libur_registry_ffi.so
cp ./target/armv7-linux-androideabi/release/libur_registry_ffi.so ./interfaces/ur_registry_flutter/android/src/main/jniLibs/armeabi-v7a/libur_registry_ffi.so
cp ./target/i686-linux-android/release/libur_registry_ffi.so ./interfaces/ur_registry_flutter/android/src/main/jniLibs/x86/libur_registry_ffi.so
generate_ios:
@echo "Step: Generate iOS builds"
cargo lipo --release
cp ./target/universal/release/libur_registry_ffi.a ./interfaces/ur_registry_flutter/ios/
generate_xcframework:
@echo "Step: Generate XCFramework"
cargo build -r --target aarch64-apple-ios
cargo build -r --target x86_64-apple-ios
cargo build -r --target aarch64-apple-ios-sim
mkdir -p target/sim
lipo target/aarch64-apple-ios-sim/release/libur_registry_ffi.a target/x86_64-apple-ios/release/libur_registry_ffi.a -create -output target/sim/libur_registry_ffi.a
xcodebuild -create-xcframework -library target/sim/libur_registry_ffi.a -headers include -library target/aarch64-apple-ios/release/libur_registry_ffi.a -headers include -output target/URRegistryFFI.xcframework
generate_ios_debug:
@echo "Step: Generate iOS builds"
cargo lipo
cp ./target/universal/debug/libur_registry_ffi.a ./interfaces/ur_registry_flutter/ios/
generate_android_debug:
@echo "Step: Generating Android builds"
@echo "1: arm64-v8a"
cargo ndk -t arm64-v8a build -p ur-registry-ffi
@echo "2: armeabi-v7a"
cargo ndk -t armeabi-v7a build -p ur-registry-ffi
@echo "3: x86"
cargo ndk -t x86 build -p ur-registry-ffi
@echo "Android buildup"
cp ./target/aarch64-linux-android/debug/libur_registry_ffi.so ./interfaces/ur_registry_flutter/android/src/main/jniLibs/arm64-v8a/libur_registry_ffi.so
cp ./target/armv7-linux-androideabi/debug/libur_registry_ffi.so ./interfaces/ur_registry_flutter/android/src/main/jniLibs/armeabi-v7a/libur_registry_ffi.so
cp ./target/i686-linux-android/debug/libur_registry_ffi.so ./interfaces/ur_registry_flutter/android/src/main/jniLibs/x86/libur_registry_ffi.so