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
15 #Modify below values to enable/disable the Adapter
16 #Suffix "NO_" to disable given adapter
20 ETHERNET = NO_ETHERNET_ADAPTER
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)
28 #DEBUG_FLAG += -DADB_SHELL
30 BUILD_FLAG.debug = $(DEFINE_FLAG) $(DEBUG_FLAG)
31 BUILD_FLAG.release = $(DEFINE_FLAG)
32 BUILD_FLAG = $(BUILD_FLAG.$(BUILD))
34 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
38 LOCAL_PATH = $(PROJECT_LIB_PATH)/android
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
44 include $(PREBUILT_SHARED_LIBRARY)
46 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
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
56 include $(PREBUILT_SHARED_LIBRARY)
58 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
63 include $(DTLS_LIB)/Android.mk
65 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
70 #Build Common Libraries
71 LOCAL_PATH = $(PROJECT_COMMON_SRC_PATH)
72 LOCAL_MODULE = CACommon
73 LOCAL_LDLIBS += -L$(SYSROOT)/usr/lib -llog
75 LOCAL_SHARED_LIBRARIES = Glib GLibThread
77 LOCAL_CFLAGS = -D__ANDROID__ $(DEBUG_FLAG)
79 LOCAL_C_INCLUDES = $(PROJECT_COMMON_INC_PATH)
80 LOCAL_C_INCLUDES += $(PROJECT_API_PATH)
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
87 include $(BUILD_STATIC_LIBRARY)
89 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
94 LOCAL_LDLIBS += -L$(SYSROOT)/usr/lib -llog
95 LOCAL_PATH = $(PROJECT_LIB_PATH)/libcoap-4.1.1
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
102 include $(BUILD_STATIC_LIBRARY)
104 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
107 #Relative path to LOCAL_PATH (PROJECT_SRC_PATH)
108 LOCAL_PLATFORM = android
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
116 include $(CLEAR_VARS)
118 LOCAL_LDLIBS += -L$(SYSROOT)/usr/lib -llog
119 LOCAL_PATH = $(PROJECT_SRC_PATH)
122 LOCAL_STATIC_LIBRARIES = CACommon CACoap TinyDtls
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)
131 LOCAL_CFLAGS += $(BUILD_FLAG)
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 \
148 include $(BUILD_STATIC_LIBRARY)