-
Notifications
You must be signed in to change notification settings - Fork 3
/
android_build.sh
executable file
·78 lines (69 loc) · 2.44 KB
/
android_build.sh
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
70
71
72
73
74
75
76
77
78
#JAVA 8 is required
#sudo apt-get install android-platform-build-headers xcb-proto android-platform-frameworks-native-headers android-platform-system-core-headers android-libcutils-dev
export ANDROID_HOME=~/Android/Sdk
export PATH=$ANDROID_HOME/tools:$PATH
export PATH=$ANDROID_HOME/tools/bin:$PATH
export PATH=$ANDROID_HOME/platform-tools:$PATH
export PATH=$PATH:$ANDROID_HOME/ndk-bundle/build/
#export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64
DEBUG=0
TRACE=0
if [ "$#" == 0 ]; then
echo "Building GLOVE for Android"
else
# Parse options
while [[ $# > 0 ]]
do
option="$1"
case $option in
# option to build in Debug mode
-d|--debug)
DEBUG=1
echo "Building in Debug mode"
;;
# option to activate GL logs
-t|--trace-build)
TRACE=1
echo "Activating logs"
;;
*)
echo "Unrecognized option: $option"
echo "Try the following:"
echo " -d | --debug # build in Debug mode (default Release)"
echo " -t | --trace-build # activate logs (default OFF)"
exit 1
;;
esac
shift
done
fi
ndk-build NDK_DEBUG=$DEBUG \
NDK_PROJECT_PATH=./android \
APP_BUILD_SCRIPT=./android/jni/Android_glslang.mk \
NDK_APPLICATION_MK=./android/jni/Application.mk \
TARGET_OUT=./android/obj/build \
-j8
if [ $TRACE == 1 ];then
ndk-build NDK_DEBUG=$DEBUG \
NDK_PROJECT_PATH=./android \
APP_BUILD_SCRIPT=./android/jni/Android_glove.mk \
NDK_APPLICATION_MK=./android/jni/Application.mk \
TARGET_OUT=./android/obj/build/glove \
APP_CPPFLAGS=-DTRACE_BUILD \
-j8 -B
else
ndk-build NDK_DEBUG=$DEBUG \
NDK_PROJECT_PATH=./android \
APP_BUILD_SCRIPT=./android/jni/Android_glove.mk \
NDK_APPLICATION_MK=./android/jni/Application.mk \
TARGET_OUT=./android/obj/build/glove \
-j8 -B
fi
ndk-build NDK_DEBUG=$DEBUG \
NDK_PROJECT_PATH=./android \
APP_BUILD_SCRIPT=./android/jni/Android_app.mk \
NDK_APPLICATION_MK=./android/jni/Application.mk \
TARGET_OUT=./android/obj/build \
-j8
android update project -s -p ./android -t "android-24"
ant -file android/build.xml debug