Commit ead130a5 authored by farid's avatar farid

Added other build abi for Android. Now to build properly the android...

Added other build abi for Android. Now to build properly the android libraries, use make NDK_HOME=~/Android/ndk/android-x86_64-27/ ANDROID_API=27 ANDROID_ABI=x86_64 for example, or armeabi or arm64-v8a
parent 9f66512d
......@@ -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)
......
......@@ -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