Commit 808e6e09 authored by farid's avatar farid Committed by Kishen Maloor
parents 1f6296b2 81498c92
Pipeline #869 passed with stage
in 10 minutes and 19 seconds
......@@ -66,8 +66,20 @@ export ANDROID_BASE := "${HOME}/android-arm-${ANDROID_API}"
else
export ANDROID_BASE := "${NDK_HOME}"
endif
ifeq ($(ANDROID_ABI),armeabi)
export ANDROID_HOST := arm-linux-androideabi-
endif
ifeq ($(ANDROID_ABI),x86_64)
export ANDROID_HOST := x86_64-linux-android-
endif
ifeq ($(ANDROID_ABI),arm64-v8a)
export ANDROID_HOST := aarch64-linux-android-
endif
# Compiler prefix
ANDROID_HOST := arm-linux-androideabi-
export ANDROID_HOST ?= arm-linux-androideabi-
BIN_BASE := ${ANDROID_BASE}/bin/${ANDROID_HOST}
ifeq ($(origin CC),default)
......
......@@ -81,7 +81,10 @@ The Makefile uses then the Android NDK that was installed above.
Either set ANDROID_API and ANDROID_BASE in the Makefile or invoke like this:
make NDK_HOME=/opt/android-ndk ANDROID_API=23
make NDK_HOME=~/android-arm-23 ANDROID_API=23 ANDROID_ABI=armeabi
ANDROID_ABI can be x86_64, arm64_v8a, armeabi
Make sure to match the toolchain path with the ANDROID_ABI.
Example Usage:
......@@ -89,7 +92,7 @@ Example Usage:
or
make NDK_HOME=~/android-arm-23 ANDROID_API=23 IPV4=1 DEBUG=1
make NDK_HOME=~/android-x86_64-27 ANDROID_API=27 ANDROID_ABI=x86_64 IPV4=1 DEBUG=1
The Make file will build and copy the library files (*.so and *.jar) into the
provided samples.
......
......@@ -116,7 +116,7 @@ ifeq ($(OS),linux)
endif
ifeq ($(OS),android)
EXTRA_HEADER_FILE = -I"$(ANDROID_BASE)/sysroot/usr/include/"
PORT_OBJ_DIR = ../port/android/arm-linux-androideabi-obj/
PORT_OBJ_DIR = ../port/android/${ANDROID_HOST}obj/
SWIG_CFLAG += -D__linux__
HEADER_FILE += -I../port/android
LDFLAG += -llog
......@@ -156,15 +156,15 @@ build_jni_so: $(JNI_SRC)
install_android_libs: build_swig build_jar build_jni_so
# copy so and jar files to samples
cp $(IOTIVITY_LITE_JAVA_LIBS_DIR)$(JNI_SO_NAME) apps/oc/android_simple_client/SimpleClient/app/src/main/jniLibs/armeabi/
cp $(IOTIVITY_LITE_JAVA_LIBS_DIR)$(JNI_SO_NAME) apps/oc/android_simple_client/SimpleClient/app/src/main/jniLibs/$(ANDROID_ABI)/
cp $(IOTIVITY_LITE_JAVA_LIBS_DIR)$(JAR_NAME) apps/oc/android_simple_client/SimpleClient/app/libs/
cp $(IOTIVITY_LITE_JAVA_LIBS_DIR)$(JNI_SO_NAME) apps/oc/android_simple_server/SimpleServer/app/src/main/jniLibs/armeabi/
cp $(IOTIVITY_LITE_JAVA_LIBS_DIR)$(JNI_SO_NAME) apps/oc/android_simple_server/SimpleServer/app/src/main/jniLibs/$(ANDROID_ABI)/
cp $(IOTIVITY_LITE_JAVA_LIBS_DIR)$(JAR_NAME) apps/oc/android_simple_server/SimpleServer/app/libs/
cp $(IOTIVITY_LITE_JAVA_LIBS_DIR)$(JNI_SO_NAME) apps/oc/android_multi_device_client/MultiDeviceClient/app/src/main/jniLibs/armeabi/
cp $(IOTIVITY_LITE_JAVA_LIBS_DIR)$(JNI_SO_NAME) apps/oc/android_multi_device_client/MultiDeviceClient/app/src/main/jniLibs/$(ANDROID_ABI)/
cp $(IOTIVITY_LITE_JAVA_LIBS_DIR)$(JAR_NAME) apps/oc/android_multi_device_client/MultiDeviceClient/app/libs/
cp $(IOTIVITY_LITE_JAVA_LIBS_DIR)$(JNI_SO_NAME) apps/oc/android_multi_device_server/MultiDeviceServer/app/src/main/jniLibs/armeabi/
cp $(IOTIVITY_LITE_JAVA_LIBS_DIR)$(JNI_SO_NAME) apps/oc/android_multi_device_server/MultiDeviceServer/app/src/main/jniLibs/$(ANDROID_ABI)/
cp $(IOTIVITY_LITE_JAVA_LIBS_DIR)$(JAR_NAME) apps/oc/android_multi_device_server/MultiDeviceServer/app/libs/
cp $(IOTIVITY_LITE_JAVA_LIBS_DIR)$(JNI_SO_NAME) apps/oc/android_on_boarding_tool/OnBoardingTool/app/src/main/jniLibs/armeabi/
cp $(IOTIVITY_LITE_JAVA_LIBS_DIR)$(JNI_SO_NAME) apps/oc/android_on_boarding_tool/OnBoardingTool/app/src/main/jniLibs/$(ANDROID_ABI)/
cp $(IOTIVITY_LITE_JAVA_LIBS_DIR)$(JAR_NAME) apps/oc/android_on_boarding_tool/OnBoardingTool/app/libs/
%_wrap.c:
......@@ -185,19 +185,19 @@ clean:
rm -rf $(IOTIVITY_LITE_JAVA_BIN_DIR)
rm -rf $(JAVA_LANG_OBJ_DIR)
# delete so and jar files copied to samples
rm -f apps/android_simple_client/SimpleClient/app/src/main/jniLibs/armeabi/$(JNI_SO_NAME)
rm -f apps/android_simple_client/SimpleClient/app/src/main/jniLibs/$(ANDROID_ABI)/$(JNI_SO_NAME)
rm -f apps/android_simple_client/SimpleClient/app/libs/$(JAR_NAME)
rm -f apps/android_simple_server/SimpleServer/app/src/main/jniLibs/armeabi/$(JNI_SO_NAME)
rm -f apps/android_simple_server/SimpleServer/app/src/main/jniLibs/$(ANDROID_ABI)/$(JNI_SO_NAME)
rm -f apps/android_simple_server/SimpleServer/app/libs/$(JAR_NAME)
rm -f apps/android_on_boarding_tool/OnBoardingTool/app/src/main/jniLibs/armeabi/$(JNI_SO_NAME)
rm -f apps/android_on_boarding_tool/OnBoardingTool/app/src/main/jniLibs/$(ANDROID_ABI)/$(JNI_SO_NAME)
rm -f apps/android_on_boarding_tool/OnBoardingTool/app/libs/$(JAR_NAME)
rm -f apps/oc/android_simple_client/SimpleClient/app/src/main/jniLibs/armeabi/$(JNI_SO_NAME)
rm -f apps/oc/android_simple_client/SimpleClient/app/src/main/jniLibs/$(ANDROID_ABI)/$(JNI_SO_NAME)
rm -f apps/oc/android_simple_client/SimpleClient/app/libs/$(JAR_NAME)
rm -f apps/oc/android_simple_server/SimpleServer/app/src/main/jniLibs/armeabi/$(JNI_SO_NAME)
rm -f apps/oc/android_simple_server/SimpleServer/app/src/main/jniLibs/$(ANDROID_ABI)/$(JNI_SO_NAME)
rm -f apps/oc/android_simple_server/SimpleServer/app/libs/$(JAR_NAME)
rm -f apps/oc/android_multi_device_client/MultiDeviceClient/app/src/main/jniLibs/armeabi/$(JNI_SO_NAME)
rm -f apps/oc/android_multi_device_client/MultiDeviceClient/app/src/main/jniLibs/$(ANDROID_ABI)/$(JNI_SO_NAME)
rm -f apps/oc/android_multi_device_client/MultiDeviceClient/app/libs/$(JAR_NAME)
rm -f apps/oc/android_multi_device_server/MultiDeviceServer/app/src/main/jniLibs/armeabi/$(JNI_SO_NAME)
rm -f apps/oc/android_multi_device_server/MultiDeviceServer/app/src/main/jniLibs/$(ANDROID_ABI)/$(JNI_SO_NAME)
rm -f apps/oc/android_multi_device_server/MultiDeviceServer/app/libs/$(JAR_NAME)
rm -f apps/oc/android_on_boarding_tool/OnBoardingTool/app/src/main/jniLibs/armeabi/$(JNI_SO_NAME)
rm -f apps/oc/android_on_boarding_tool/OnBoardingTool/app/libs/$(JAR_NAME)
\ No newline at end of file
rm -f apps/oc/android_on_boarding_tool/OnBoardingTool/app/src/main/jniLibs/$(ANDROID_ABI)/$(JNI_SO_NAME)
rm -f apps/oc/android_on_boarding_tool/OnBoardingTool/app/libs/$(JAR_NAME)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment