-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathMakefile
30 lines (23 loc) · 1.2 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
NDK=~/Android/Sdk/ndk-bundle/
AL_PATH=~/Downloads/openal/openal-soft/
APK_TMP=/tmp/_bintris_apk_/
ANDROID_HOME=~/Android/Sdk/
CMAKE_PATH=~/Downloads/cmake-3.22.1-linux-x86_64/bin
GOMOBILE_PATH=~/go/src/golang.org/x/mobile/cmd/gomobile/gomobile
# Make studio builds shared objects and places them in the AS project dir.
studio: android
unzip bintris.apk -d $(APK_TMP)
cp -r $(APK_TMP)/lib/* AndroidProject/app/src/main/jniLibs/
rm -rf $(APK_TMP)
openal:
PATH="$(CMAKE_PATH):$(PATH)" ANDROID_PLATFORM=android-23 ANDROID_HOME=$(ANDROID_HOME) ANDROID_NDK_HOME=$(NDK) $(GOMOBILE_PATH) init -openal $(AL_PATH)
init:
ANDROID_NDK_HOME=$(NDK) gomobile init -openal $(AL_PATH) -ldflags="-w" -gcflags="-w -I $(AL_PATH)/include/"
android:
ANDROID_NDK_HOME=$(NDK) $(GOMOBILE_PATH) build -target android -androidapi=23 -o bintris.apk -ldflags="-w" -gcflags="-w -I $(AL_PATH)/include/"
bind:
ANDROID_HOME=$(NDK) ANDROID_NDK_HOME=$(NDK) gomobile bind -target android -androidapi=23 -o bintris.apk -ldflags="-w" -gcflags="-w -I $(AL_PATH)/include/"
android_install:
ANDROID_NDK_HOME=$(NDK) $(GOMOBILE_PATH) install -target android -androidapi=23 -o bintris.apk -ldflags="-w" -gcflags="-I $(AL_PATH)/include/" -x
linux:
go build .