0e87f2a862922cdddf2ce30d71af1e09df899e68
[platform/upstream/iotivity.git] / service / easy-setup / sdk / mediator / android / jni / Android.mk
1 LOCAL_PATH := $(call my-dir)
2
3 ifeq ($(strip $(ANDROID_NDK)),)
4 $(error ANDROID_NDK is not set!)
5 endif
6
7 $(warning "Current path" $(LOCAL_PATH))
8 $(info TC_PREFIX=$(TOOLCHAIN_PREFIX))
9 $(info CFLAGS=$(TARGET_CFLAGS))
10 $(info CXXFLAGS=$(TARGET_CXXFLAGS) $(TARGET_NO_EXECUTE_CFLAGS))
11 $(info CPPFLAGS=$(TARGET_CPPFLAGS))
12 $(info CPPPATH=$(TARGET_C_INCLUDES) $(__ndk_modules.$(APP_STL).EXPORT_C_INCLUDES))
13 $(info SYSROOT=$(SYSROOT_LINK))
14 $(info LDFLAGS=$(TARGET_LDFLAGS) $(TARGET_NO_EXECUTE_LDFLAGS) $(TARGET_NO_UNDEFINED_LDFLAGS) $(TARGET_RELRO_LDFLAGS))
15 $(info TC_VER=$(TOOLCHAIN_VERSION))
16 $(info PLATFORM=$(APP_PLATFORM))
17
18 include $(CLEAR_VARS)
19 OIC_LIB_PATH := ../../../../../../out/android/$(TARGET_ARCH_ABI)/debug
20 LOCAL_MODULE := android-octbstack
21 LOCAL_SRC_FILES := $(OIC_LIB_PATH)/liboctbstack.so
22 include $(PREBUILT_SHARED_LIBRARY)
23
24 include $(CLEAR_VARS)
25 OIC_LIB_PATH := ../../../../../../out/android/$(TARGET_ARCH_ABI)/debug
26 LOCAL_MODULE := android-connectivity_abstraction
27 LOCAL_SRC_FILES := $(OIC_LIB_PATH)/libconnectivity_abstraction.so
28 include $(PREBUILT_SHARED_LIBRARY)
29
30 include $(CLEAR_VARS)
31 OIC_LIB_PATH := ../../../../../../out/android/$(TARGET_ARCH_ABI)/debug
32 LOCAL_MODULE := android-easysetup
33 LOCAL_SRC_FILES := $(OIC_LIB_PATH)/libESSDK.a
34 include $(PREBUILT_STATIC_LIBRARY)
35
36 include $(CLEAR_VARS)
37
38 LOCAL_MODULE    := easysetup-jni
39
40 #Add Pre processor definitions
41 DEFINE_FLAG =  -DWITH_POSIX -D__ANDROID__
42
43 #Add Debug flags here
44 DEBUG_FLAG      = -DTB_LOG
45
46 BUILD_FLAG = $(DEFINE_FLAG) $(DEBUG_FLAG)
47
48 LOCAL_CPPFLAGS = $(BUILD_FLAG)
49 LOCAL_CPPFLAGS += -std=c++0x -frtti -fexceptions
50
51 $(info CPPFLAGSUPDATED=$(LOCAL_CPPFLAGS))
52
53 NDK_ROOT         := /home/madan/android-ndk-r10d
54
55 LOCAL_C_INCLUDES := $(LOCAL_PATH) \
56                                         $(LOCAL_PATH)/jniutil/inc \
57                                         $(LOCAL_PATH)/../../../../../../service/easy-setup/sdk/mediator/inc \
58                                         $(LOCAL_PATH)/../../../../../../service/easy-setup/sdk/common \
59                                         $(LOCAL_PATH)/../../../../../../resource/csdk/logger/include \
60                                         $(LOCAL_PATH)/../../../../../../resource/csdk/connectivity/common/inc \
61                                         $(LOCAL_PATH)/../../../../../../resource/include \
62                                         $(LOCAL_PATH)/../../../../../../resource/c_common \
63                                         $(LOCAL_PATH)/../../../../../../resource/oc_logger/include \
64                                         $(LOCAL_PATH)/../../../../../../resource/csdk/ocmalloc/include \
65                                         $(LOCAL_PATH)/../../../../../../resource/csdk/connectivity/api \
66                                         $(LOCAL_PATH)/../../../../../../resource/csdk/stack/include \
67                                         $(LOCAL_PATH)/../../../../../../resource/csdk/logger/include \
68                                         $(LOCAL_PATH)/../../../../../../resource/csdk/security/include \
69                                         $(LOCAL_PATH)/../../../../../../extlibs/cjson \
70                                         $(LOCAL_PATH)/../../../../../../extlibs/boost/boost_1_58_0 \
71                     $(LOCAL_PATH)/../../../../../../extlibs/timer \
72                                         $(LOCAL_PATH)/../../../../../../android/android_api/base/jni \
73                                         $(NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/$(TOOLCHAIN_VERSION)/include \
74                     $(NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/$(TOOLCHAIN_VERSION)/libs/$(TARGET_ARCH_ABI)/include \
75                                         
76 LOCAL_SRC_FILES += $(patsubst $(LOCAL_PATH)/%, %, $(wildcard $(LOCAL_PATH)/jni_easy_setup.cpp))
77 LOCAL_SRC_FILES += $(patsubst $(LOCAL_PATH)/%, %, $(wildcard $(LOCAL_PATH)/jniutil/src/*.cpp))
78
79 LOCAL_LDLIBS := -llog 
80 LOCAL_LDLIBS += -L$(NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/$(TOOLCHAIN_VERSION)/libs/$(TARGET_ARCH_ABI)
81 LOCAL_SHARED_LIBRARIES := android-easysetup
82 LOCAL_SHARED_LIBRARIES += android-connectivity_abstraction
83 LOCAL_SHARED_LIBRARIES += android-octbstack
84
85 include $(BUILD_SHARED_LIBRARY)