-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
59 lines (49 loc) · 1.61 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
IOS_OUT=build
ios-arm64:
CGO_ENABLED=1 \
GOOS=darwin \
GOARCH=arm64 \
SDK=iphoneos \
CC=$(PWD)/clangwrap.sh \
CGO_CFLAGS="-fembed-bitcode" \
go build -buildmode=c-archive -tags ios -o $(IOS_OUT)/arm64.a main.go
ios-x86_64:
CGO_ENABLED=1 \
GOOS=darwin \
GOARCH=amd64 \
SDK=iphonesimulator \
CC=$(PWD)/clangwrap.sh \
go build -buildmode=c-archive -tags ios -o $(IOS_OUT)/x86_64.a main.go
ios: ios-arm64 ios-x86_64
lipo $(IOS_OUT)/x86_64.a $(IOS_OUT)/arm64.a -create -output $(IOS_OUT)/lattigo.a
cp $(IOS_OUT)/arm64.h $(IOS_OUT)/lib_lattigo.h
ANDROID_OUT=/Users/andru/Desktop/contact-tracing-he/phone-app/android/app/src/main/jniLibs
ANDROID_SDK=$(HOME)/Library/Android/sdk
NDK_BIN=$(HOME)/Library/Android/sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/darwin-x86_64/bin
android-armv7a:
CGO_ENABLED=1 \
GOOS=android \
GOARCH=arm \
GOARM=7 \
CC=$(NDK_BIN)/armv7a-linux-androideabi21-clang \
go build -buildmode=c-shared -o $(ANDROID_OUT)/armeabi-v7a/lib_lattigo.so main.go
android-arm64:
CGO_ENABLED=1 \
GOOS=android \
GOARCH=arm64 \
CC=$(NDK_BIN)/aarch64-linux-android21-clang \
go build -buildmode=c-shared -o $(ANDROID_OUT)/arm64-v8a/lib_lattigo.so main.go
android-x86:
CGO_ENABLED=1 \
GOOS=android \
GOARCH=386 \
CC=$(NDK_BIN)/i686-linux-android21-clang \
go build -buildmode=c-shared -o $(ANDROID_OUT)/x86/lib_lattigo.so main.go
android-x86_64:
CGO_ENABLED=1 \
GOOS=android \
GOARCH=amd64 \
CC=$(NDK_BIN)/x86_64-linux-android21-clang \
go build -buildmode=c-shared -o $(ANDROID_OUT)/x86_64/lib_lattigo.so main.go
android: android-armv7a android-arm64 android-x86 android-x86_64
android-ios: android ios