Fixed klockwork memory leaks and modified the logs
[platform/upstream/iotivity.git] / resource / csdk / connectivity / build / android / jni / Android.mk
1 #define build type
2 BUILD = debug
3
4 PROJECT_ROOT_PATH                       ?= ../..
5 PROJECT_API_PATH                        = $(PROJECT_ROOT_PATH)/api
6 PROJECT_INC_PATH                        = $(PROJECT_ROOT_PATH)/inc
7 PROJECT_SRC_PATH                        = $(PROJECT_ROOT_PATH)/src
8 PROJECT_COMMON_PATH                     = $(PROJECT_ROOT_PATH)/common
9 PROJECT_COMMON_INC_PATH         = $(PROJECT_COMMON_PATH)/inc
10 PROJECT_COMMON_SRC_PATH         = $(PROJECT_COMMON_PATH)/src
11 PROJECT_LIB_PATH                        = $(PROJECT_ROOT_PATH)/lib
12 PROJECT_EXTERNAL_PATH   = $(PROJECT_ROOT_PATH)/external/inc
13 DTLS_LIB                                        = $(PROJECT_LIB_PATH)/tinydtls
14
15 #Modify below values to enable/disable the Adapter
16 #Suffix "NO_" to disable given adapter
17 EDR                     = EDR_ADAPTER
18 WIFI            = WIFI_ADAPTER
19 LE                      = LE_ADAPTER
20 ETHERNET        = NO_ETHERNET_ADAPTER
21
22 #Add Pre processor definitions
23 DEFINE_FLAG =  -DWITH_POSIX -D__ANDROID__ -D__WITH_DTLS__
24 DEFINE_FLAG += -D$(EDR) -D$(LE) -D$(WIFI) -D$(ETHERNET) 
25
26 #Add Debug flags here
27 DEBUG_FLAG      = -DTB_LOG
28 #DEBUG_FLAG     += -DADB_SHELL
29
30 BUILD_FLAG.debug        = $(DEFINE_FLAG) $(DEBUG_FLAG) 
31 BUILD_FLAG.release      =       $(DEFINE_FLAG)
32 BUILD_FLAG = $(BUILD_FLAG.$(BUILD))
33
34 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
35 #include glib
36
37 include $(CLEAR_VARS)
38 LOCAL_PATH = $(PROJECT_LIB_PATH)/android
39 LOCAL_MODULE = Glib
40 LOCAL_SRC_FILES := libglib-2.40.2.so
41 LOCAL_EXPORT_C_INCLUDES = $(PROJECT_LIB_PATH)/android/glib-2.40.2 \
42                           $(PROJECT_LIB_PATH)/android/glib-2.40.2/glib
43
44 include $(PREBUILT_SHARED_LIBRARY)
45
46 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
47 #include glibthread
48
49 include $(CLEAR_VARS)
50 LOCAL_PATH = $(PROJECT_LIB_PATH)/android
51 LOCAL_MODULE = GLibThread
52 LOCAL_SRC_FILES := libgthread-2.40.2.so
53 LOCAL_EXPORT_C_INCLUDES = $(PROJECT_LIB_PATH)/android/glib-2.40.2 \
54                           $(PROJECT_LIB_PATH)/android/glib-2.40.2/glib
55
56 include $(PREBUILT_SHARED_LIBRARY)
57
58 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
59
60 #Build TinyDtls
61
62 include $(CLEAR_VARS)
63 include $(DTLS_LIB)/Android.mk
64
65 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
66 #Build CACommon
67
68 include $(CLEAR_VARS)
69
70 #Build Common Libraries
71 LOCAL_PATH = $(PROJECT_COMMON_SRC_PATH)
72 LOCAL_MODULE = CACommon
73 LOCAL_LDLIBS += -L$(SYSROOT)/usr/lib -llog
74
75 LOCAL_SHARED_LIBRARIES = Glib GLibThread
76
77 LOCAL_CFLAGS = -D__ANDROID__ $(DEBUG_FLAG)
78
79 LOCAL_C_INCLUDES = $(PROJECT_COMMON_INC_PATH)
80 LOCAL_C_INCLUDES += $(PROJECT_API_PATH)
81
82 LOCAL_SRC_FILES =       oic_logger.c \
83                                         oic_console_logger.c logger.c oic_malloc.c \
84                                         uarraylist.c uqueue.c oic_string.c \
85                                         uthreadpool.c umutex.c
86
87 include $(BUILD_STATIC_LIBRARY)
88
89 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
90 #Build CACoap
91
92 include $(CLEAR_VARS)
93
94 LOCAL_LDLIBS += -L$(SYSROOT)/usr/lib -llog
95 LOCAL_PATH = $(PROJECT_LIB_PATH)/libcoap-4.1.1
96 LOCAL_MODULE = CACoap
97 LOCAL_EXPORT_C_INCLUDES = $(PROJECT_LIB_PATH)/libcoap-4.1.1
98 LOCAL_CFLAGS = -DWITH_POSIX
99 LOCAL_SRC_FILES = pdu.c net.c debug.c encode.c uri.c coap_list.c resource.c hashkey.c \
100                                         str.c option.c async.c subscribe.c block.c
101
102 include $(BUILD_STATIC_LIBRARY)
103
104 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
105 #Build CA
106
107 #Relative path to LOCAL_PATH (PROJECT_SRC_PATH)
108 LOCAL_PLATFORM                          = android
109
110 ENET_ADAPTER_PATH                       = ethernet_adapter/$(LOCAL_PLATFORM)
111 EDR_ADAPTER_PATH                        = bt_edr_adapter/$(LOCAL_PLATFORM)
112 LE_ADAPTER_PATH                         = bt_le_adapter/$(LOCAL_PLATFORM)
113 WIFI_ADAPTER_PATH                       = wifi_adapter/$(LOCAL_PLATFORM)
114 ADAPTER_UTILS                           = adapter_util
115
116 include $(CLEAR_VARS)
117
118 LOCAL_LDLIBS += -L$(SYSROOT)/usr/lib -llog
119 LOCAL_PATH = $(PROJECT_SRC_PATH)
120 LOCAL_MODULE = CA
121
122 LOCAL_STATIC_LIBRARIES = CACommon CACoap TinyDtls
123
124 LOCAL_C_INCLUDES = $(PROJECT_API_PATH)
125 LOCAL_C_INCLUDES += $(PROJECT_COMMON_INC_PATH)
126 LOCAL_C_INCLUDES += $(PROJECT_INC_PATH)
127 LOCAL_C_INCLUDES += $(PROJECT_LIB_PATH)/libcoap-4.1.1
128 LOCAL_C_INCLUDES += $(PROJECT_EXTERNAL_PATH)
129 LOCAL_C_INCLUDES += $(DTLS_LIB)
130
131 LOCAL_CFLAGS += $(BUILD_FLAG)
132
133 LOCAL_SRC_FILES = \
134                                         caconnectivitymanager.c caremotehandler.c cainterfacecontroller.c \
135                                         camessagehandler.c canetworkconfigurator.c caprotocolmessage.c \
136                                         caretransmission.c caqueueingthread.c \
137                                         $(ADAPTER_UTILS)/caadapternetdtls.c $(ADAPTER_UTILS)/caadapterutils.c \
138                                         $(ADAPTER_UTILS)/camsgparser.c \
139                                         $(LE_ADAPTER_PATH)/caleadapter.c $(LE_ADAPTER_PATH)/caleclient.c \
140                                         $(LE_ADAPTER_PATH)/caleserver.c $(LE_ADAPTER_PATH)/caleutils.c \
141                                         $(LE_ADAPTER_PATH)/calenwmonitor.c \
142                                         bt_edr_adapter/caedradapter.c $(EDR_ADAPTER_PATH)/caedrutils.c \
143                                         $(EDR_ADAPTER_PATH)/caedrclient.c $(EDR_ADAPTER_PATH)/caedrserver.c \
144                                         $(EDR_ADAPTER_PATH)/caedrnwmonitor.c \
145                                         wifi_adapter/cawifiadapter.c $(WIFI_ADAPTER_PATH)/cawifiserver.c \
146                                         $(WIFI_ADAPTER_PATH)/cawificlient.c $(WIFI_ADAPTER_PATH)/cawifinwmonitor.c \
147
148 include $(BUILD_STATIC_LIBRARY)