-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Makefile.android
31 lines (26 loc) · 1.41 KB
/
Makefile.android
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
ANDROID_HOME?=$(HOME)/Android/Sdk
ANDROID_NDK_HOME?=$(ANDROID_HOME)/ndk/21.3.6528147
ANDROID_NDK_TOOLCHAIN?=$(ANDROID_NDK_HOME)/toolchains/llvm/prebuilt/linux-x86_64/bin
ANDROID_OUTPUT?=android/jniLibs
ANDROID_BINDING_NAME?=$(BINDING_NAME).so
binding_android: binding_android_arm64 binding_android_armv7a binding_android_x86 binding_android_x86_64
binding_android_arm64:
BINDING_FILE=$(ANDROID_OUTPUT)/arm64-v8a/$(ANDROID_BINDING_NAME) \
CC=$(ANDROID_NDK_TOOLCHAIN)/aarch64-linux-android21-clang \
EXTRA_LD_FLAGS="-extldflags=-Wl,-soname,$(ANDROID_BINDING_NAME)" \
GOOS=android GOARCH=arm64 CGO_ENABLED=1 make binding
binding_android_armv7a:
BINDING_FILE=$(ANDROID_OUTPUT)/armeabi-v7a/$(ANDROID_BINDING_NAME) \
CC=$(ANDROID_NDK_TOOLCHAIN)/armv7a-linux-androideabi21-clang \
EXTRA_LD_FLAGS="-extldflags=-Wl,-soname,$(ANDROID_BINDING_NAME)" \
GOOS=android GOARCH=arm GOARM=7 CGO_ENABLED=1 make binding
binding_android_x86:
BINDING_FILE=$(ANDROID_OUTPUT)/x86/$(ANDROID_BINDING_NAME) \
CC=$(ANDROID_NDK_TOOLCHAIN)/i686-linux-android21-clang \
EXTRA_LD_FLAGS="-extldflags=-Wl,-soname,$(ANDROID_BINDING_NAME)" \
GOOS=android GOARCH=386 CGO_ENABLED=1 make binding
binding_android_x86_64:
BINDING_FILE=$(ANDROID_OUTPUT)/x86_64/$(ANDROID_BINDING_NAME) \
CC=$(ANDROID_NDK_TOOLCHAIN)/x86_64-linux-android21-clang \
EXTRA_LD_FLAGS="-extldflags=-Wl,-soname,$(ANDROID_BINDING_NAME)" \
GOOS=android GOARCH=amd64 CGO_ENABLED=1 make binding