Implementation of connectivity abstraction feature Release v0.5
[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
13 #Modify below values to enable/disable the Adapter
14 #Suffix "NO_" to disable given adapter  
15 EDR                     = EDR_ADAPTER
16 WIFI            = WIFI_ADAPTER
17 LE                      = LE_ADAPTER
18 ETHERNET        = NO_ETHERNET_ADAPTER
19
20 #Add Pre processor definitions
21 DEFINE_FLAG =  -DWITH_POSIX -D__ANDROID__
22 DEFINE_FLAG += -D$(EDR) -D$(LE) -D$(WIFI) -D$(ETHERNET) 
23
24 #Add Debug flags here
25 DEBUG_FLAG      = -DTB_LOG
26 #DEBUG_FLAG     += -DADB_SHELL
27
28 BUILD_FLAG.debug        = $(DEFINE_FLAG) $(DEBUG_FLAG) 
29 BUILD_FLAG.release      =       $(DEFINE_FLAG)
30 BUILD_FLAG = $(BUILD_FLAG.$(BUILD))
31
32 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
33 #Build glib
34 include $(CLEAR_VARS)
35
36 include $(PROJECT_LIB_PATH)/android/glib-master/Android.mk
37 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
38
39 #Build CACommon
40 include $(CLEAR_VARS)
41
42 #Build Common Libraries
43 LOCAL_PATH = $(PROJECT_COMMON_SRC_PATH)
44 LOCAL_MODULE = CACommon
45 LOCAL_LDLIBS += -L$(SYSROOT)/usr/lib -llog
46
47 LOCAL_SHARED_LIBRARIES = glib-2.0 gthread-2.0
48
49 LOCAL_CFLAGS = -D__ANDROID__ $(DEBUG_FLAG)
50
51 LOCAL_C_INCLUDES = $(PROJECT_COMMON_INC_PATH)
52 LOCAL_C_INCLUDES += $(PROJECT_API_PATH)
53 LOCAL_C_INCLUDES += $(PROJECT_LIB_PATH)/android/glib-master \
54                                         $(PROJECT_LIB_PATH)/android/glib-master/android
55
56 LOCAL_SRC_FILES =       oic_logger.c \
57                                         oic_console_logger.c logger.c oic_malloc.c \
58                                         uarraylist.c uqueue.c oic_string.c \
59                                         uthreadpool.c umutex.c
60
61 include $(BUILD_STATIC_LIBRARY)
62
63 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
64 #Build CACoap
65
66 include $(CLEAR_VARS)
67
68 LOCAL_LDLIBS += -L$(SYSROOT)/usr/lib -llog
69 LOCAL_PATH = $(PROJECT_LIB_PATH)/libcoap-4.1.1
70 LOCAL_MODULE = CACoap
71 LOCAL_EXPORT_C_INCLUDES = $(PROJECT_LIB_PATH)/libcoap-4.1.1
72 LOCAL_CFLAGS = -DWITH_POSIX
73 LOCAL_SRC_FILES = pdu.c net.c debug.c encode.c uri.c coap_list.c resource.c hashkey.c \
74                                         str.c option.c async.c subscribe.c block.c
75
76 include $(BUILD_STATIC_LIBRARY)
77
78 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
79 #Build CA
80
81 #Relative path to LOCAL_PATH (PROJECT_SRC_PATH)
82 LOCAL_PLATFORM                          = android
83
84 ENET_ADAPTER_PATH                       = ethernet_adapter/$(LOCAL_PLATFORM)
85 EDR_ADAPTER_PATH                        = bt_edr_adapter/$(LOCAL_PLATFORM)
86 LE_ADAPTER_PATH                         = bt_le_adapter/$(LOCAL_PLATFORM)
87 WIFI_ADAPTER_PATH                       = wifi_adapter/$(LOCAL_PLATFORM)
88 ADAPTER_UTILS                           = adapter_util
89
90 include $(CLEAR_VARS)
91
92 LOCAL_LDLIBS += -L$(SYSROOT)/usr/lib -llog
93 LOCAL_PATH = $(PROJECT_SRC_PATH)
94 LOCAL_MODULE = CA
95
96 LOCAL_STATIC_LIBRARIES = CACommon CACoap
97
98 LOCAL_C_INCLUDES = $(PROJECT_API_PATH)
99 LOCAL_C_INCLUDES += $(PROJECT_COMMON_INC_PATH)
100 LOCAL_C_INCLUDES += $(PROJECT_INC_PATH)
101 LOCAL_C_INCLUDES += $(PROJECT_LIB_PATH)/libcoap-4.1.1
102
103 LOCAL_C_INCLUDES += $(PROJECT_LIB_PATH)/android/glib-master \
104                                         $(PROJECT_LIB_PATH)/android/glib-master/android
105
106 LOCAL_CFLAGS += $(BUILD_FLAG)
107
108 LOCAL_SRC_FILES = \
109                                         caconnectivitymanager.c caremotehandler.c cainterfacecontroller.c camessagehandler.c \
110                                         canetworkconfigurator.c caprotocolmessage.c \
111                                         caqueueingthread.c \
112                                         $(ADAPTER_UTILS)/caadapterutils.c $(ADAPTER_UTILS)/camessagequeue.c \
113                                         $(ADAPTER_UTILS)/camsgparser.c \
114                                         $(EDR_ADAPTER_PATH)/caedradapter.c \
115                                         $(LE_ADAPTER_PATH)/caleadapter.c $(LE_ADAPTER_PATH)/caleclient.c $(LE_ADAPTER_PATH)/caleserver.c \
116                                         wifi_adapter/cawifiadapter.c $(WIFI_ADAPTER_PATH)/cawifiserver.c \
117                                         $(WIFI_ADAPTER_PATH)/cawificlient.c $(WIFI_ADAPTER_PATH)/cawifinwmonitor.c 
118
119 include $(BUILD_STATIC_LIBRARY)