1#
2#  Copyright (c) 2018, The OpenThread Authors.
3#  All rights reserved.
4#
5#  Redistribution and use in source and binary forms, with or without
6#  modification, are permitted provided that the following conditions are met:
7#  1. Redistributions of source code must retain the above copyright
8#     notice, this list of conditions and the following disclaimer.
9#  2. Redistributions in binary form must reproduce the above copyright
10#     notice, this list of conditions and the following disclaimer in the
11#     documentation and/or other materials provided with the distribution.
12#  3. Neither the name of the copyright holder nor the
13#     names of its contributors may be used to endorse or promote products
14#     derived from this software without specific prior written permission.
15#
16#  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17#  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18#  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19#  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20#  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21#  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22#  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23#  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24#  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25#  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26#  POSSIBILITY OF SUCH DAMAGE.
27#
28
29LOCAL_PATH := $(call my-dir)
30
31ifeq ($(OPENTHREAD_ENABLE_ANDROID_MK),1)
32
33OPENTHREAD_DEFAULT_VERSION := $(shell cat $(LOCAL_PATH)/.default-version)
34OPENTHREAD_SOURCE_VERSION := $(shell git -C $(LOCAL_PATH) describe --always --match "[0-9].*" 2> /dev/null)
35
36OPENTHREAD_PROJECT_CFLAGS                                                 ?= \
37    -DOPENTHREAD_PROJECT_CORE_CONFIG_FILE=\"openthread-core-posix-config.h\" \
38    -DOPENTHREAD_CONFIG_FILE=\<openthread-config-android.h\>                 \
39    $(NULL)
40
41OPENTHREAD_PUBLIC_CFLAGS                                         := \
42    -DOPENTHREAD_CONFIG_PING_SENDER_ENABLE=1                        \
43    -DOPENTHREAD_CONFIG_COMMISSIONER_ENABLE=1                       \
44    -DOPENTHREAD_CONFIG_IP6_SLAAC_ENABLE=1                          \
45    -DOPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE=1                  \
46    -DOPENTHREAD_CONFIG_MAC_FILTER_ENABLE=1                         \
47    -DOPENTHREAD_POSIX_CONFIG_RCP_PTY_ENABLE=1                      \
48    -DOPENTHREAD_FTD=1                                              \
49    -DOPENTHREAD_SPINEL_CONFIG_OPENTHREAD_MESSAGE_ENABLE=1          \
50    $(NULL)
51
52OPENTHREAD_PRIVATE_CFLAGS                                        := \
53    -DMBEDTLS_CONFIG_FILE=\"mbedtls-config.h\"                      \
54    -DPACKAGE=\"openthread\"                                        \
55    -DPACKAGE_BUGREPORT=\"openthread-devel@googlegroups.com\"       \
56    -DPACKAGE_NAME=\"OPENTHREAD\"                                   \
57    -DPACKAGE_STRING=\"OPENTHREAD\ $(OPENTHREAD_DEFAULT_VERSION)\"  \
58    -DPACKAGE_TARNAME=\"openthread\"                                \
59    -DPACKAGE_URL=\"http://github.com/openthread/openthread\"       \
60    -DPACKAGE_VERSION=\"$(OPENTHREAD_SOURCE_VERSION)\"              \
61    -DSPINEL_PLATFORM_HEADER=\"spinel_platform.h\"                  \
62    -DVERSION=\"$(OPENTHREAD_DEFAULT_VERSION)\"                     \
63    $(NULL)
64
65# Enable required features for on-device tests.
66ifeq ($(TARGET_BUILD_VARIANT),eng)
67OPENTHREAD_PUBLIC_CFLAGS                                         += \
68    -DOPENTHREAD_CONFIG_DIAG_ENABLE=1                               \
69    $(NULL)
70endif
71
72ifeq ($(USE_OTBR_DAEMON), 1)
73OPENTHREAD_PUBLIC_CFLAGS                                         += \
74    -DOPENTHREAD_CONFIG_PLATFORM_NETIF_ENABLE=1                     \
75    -DOPENTHREAD_CONFIG_PLATFORM_UDP_ENABLE=1                       \
76    -DOPENTHREAD_CONFIG_UNSECURE_TRAFFIC_MANAGED_BY_STACK_ENABLE=1  \
77    -DOPENTHREAD_POSIX_CONFIG_DAEMON_ENABLE=1                       \
78    $(NULL)
79else
80OPENTHREAD_PUBLIC_CFLAGS += -DOPENTHREAD_CONFIG_UDP_FORWARD_ENABLE=1
81endif
82
83ifeq ($(USE_OT_RCP_BUS), spi)
84OPENTHREAD_PUBLIC_CFLAGS += -DOPENTHREAD_POSIX_CONFIG_RCP_BUS=OT_POSIX_RCP_BUS_SPI
85else
86OPENTHREAD_PUBLIC_CFLAGS += -DOPENTHREAD_POSIX_CONFIG_RCP_BUS=OT_POSIX_RCP_BUS_UART
87endif
88
89# Enable all optional features for CI tests.
90ifeq ($(TARGET_PRODUCT),generic)
91OPENTHREAD_PUBLIC_CFLAGS                                         += \
92    -DOPENTHREAD_CONFIG_COAP_API_ENABLE=1                           \
93    -DOPENTHREAD_CONFIG_DHCP6_CLIENT_ENABLE=1                       \
94    -DOPENTHREAD_CONFIG_DHCP6_SERVER_ENABLE=1                       \
95    -DOPENTHREAD_CONFIG_DNS_CLIENT_ENABLE=1                         \
96    -DOPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE=0                   \
97    -DOPENTHREAD_CONFIG_TMF_NETWORK_DIAG_MTD_ENABLE=1               \
98    $(NULL)
99endif
100
101include $(CLEAR_VARS)
102
103LOCAL_MODULE := spi-hdlc-adapter
104LOCAL_MODULE_TAGS := eng
105LOCAL_SRC_FILES := tools/spi-hdlc-adapter/spi-hdlc-adapter.c
106
107include $(BUILD_EXECUTABLE)
108
109include $(CLEAR_VARS)
110
111LOCAL_MODULE := ot-core
112LOCAL_MODULE_TAGS := eng
113
114LOCAL_C_INCLUDES                                         := \
115    $(OPENTHREAD_PROJECT_INCLUDES)                          \
116    $(LOCAL_PATH)/include                                   \
117    $(LOCAL_PATH)/src                                       \
118    $(LOCAL_PATH)/src/cli                                   \
119    $(LOCAL_PATH)/src/core                                  \
120    $(LOCAL_PATH)/src/ncp                                   \
121    $(LOCAL_PATH)/src/posix/platform                        \
122    $(LOCAL_PATH)/src/posix/platform/include                \
123    $(LOCAL_PATH)/third_party                               \
124    $(LOCAL_PATH)/third_party/mbedtls                       \
125    $(LOCAL_PATH)/third_party/mbedtls/repo/include          \
126    $(LOCAL_PATH)/third_party/mbedtls/repo/library          \
127    $(NULL)
128
129LOCAL_CFLAGS                                                                := \
130    $(OPENTHREAD_PUBLIC_CFLAGS)                                                \
131    $(OPENTHREAD_PRIVATE_CFLAGS)                                               \
132    $(OPENTHREAD_PROJECT_CFLAGS)                                               \
133    $(NULL)
134
135LOCAL_EXPORT_CFLAGS                                        := \
136    $(OPENTHREAD_PUBLIC_CFLAGS)                               \
137    $(OPENTHREAD_PROJECT_CFLAGS)                              \
138    $(NULL)
139
140LOCAL_EXPORT_C_INCLUDE_DIRS     := \
141    $(OPENTHREAD_PROJECT_INCLUDES) \
142    $(LOCAL_PATH)/include          \
143    $(LOCAL_PATH)/src              \
144    $(NULL)
145
146LOCAL_CPPFLAGS                                                              := \
147    -std=c++11                                                                 \
148    -Wno-error=non-virtual-dtor                                                \
149    -pedantic-errors                                                           \
150    $(NULL)
151
152ifeq ($(ANDROID_NDK),1)
153LOCAL_SHARED_LIBRARIES := libcutils
154
155LOCAL_CFLAGS                                             += \
156    -DOPENTHREAD_ENABLE_ANDROID_NDK=1                       \
157    $(NULL)
158endif
159
160LOCAL_SRC_FILES                                                  := \
161    src/core/api/backbone_router_api.cpp                            \
162    src/core/api/backbone_router_ftd_api.cpp                        \
163    src/core/api/border_agent_api.cpp                               \
164    src/core/api/border_router_api.cpp                              \
165    src/core/api/channel_manager_api.cpp                            \
166    src/core/api/channel_monitor_api.cpp                            \
167    src/core/api/child_supervision_api.cpp                          \
168    src/core/api/coap_api.cpp                                       \
169    src/core/api/coap_secure_api.cpp                                \
170    src/core/api/commissioner_api.cpp                               \
171    src/core/api/crypto_api.cpp                                     \
172    src/core/api/dataset_api.cpp                                    \
173    src/core/api/dataset_ftd_api.cpp                                \
174    src/core/api/dataset_updater_api.cpp                            \
175    src/core/api/diags_api.cpp                                      \
176    src/core/api/dns_api.cpp                                        \
177    src/core/api/dns_server_api.cpp                                 \
178    src/core/api/entropy_api.cpp                                    \
179    src/core/api/error_api.cpp                                      \
180    src/core/api/heap_api.cpp                                       \
181    src/core/api/history_tracker_api.cpp                            \
182    src/core/api/icmp6_api.cpp                                      \
183    src/core/api/instance_api.cpp                                   \
184    src/core/api/ip6_api.cpp                                        \
185    src/core/api/jam_detection_api.cpp                              \
186    src/core/api/joiner_api.cpp                                     \
187    src/core/api/link_api.cpp                                       \
188    src/core/api/link_metrics_api.cpp                               \
189    src/core/api/link_raw_api.cpp                                   \
190    src/core/api/logging_api.cpp                                    \
191    src/core/api/message_api.cpp                                    \
192    src/core/api/multi_radio_api.cpp                                \
193    src/core/api/netdata_api.cpp                                    \
194    src/core/api/netdata_publisher_api.cpp                          \
195    src/core/api/netdiag_api.cpp                                    \
196    src/core/api/network_time_api.cpp                               \
197    src/core/api/ping_sender_api.cpp                                \
198    src/core/api/random_crypto_api.cpp                              \
199    src/core/api/random_noncrypto_api.cpp                           \
200    src/core/api/server_api.cpp                                     \
201    src/core/api/sntp_api.cpp                                       \
202    src/core/api/srp_client_api.cpp                                 \
203    src/core/api/srp_client_buffers_api.cpp                         \
204    src/core/api/srp_server_api.cpp                                 \
205    src/core/api/tasklet_api.cpp                                    \
206    src/core/api/tcp_api.cpp                                        \
207    src/core/api/thread_api.cpp                                     \
208    src/core/api/thread_ftd_api.cpp                                 \
209    src/core/api/udp_api.cpp                                        \
210    src/core/backbone_router/backbone_tmf.cpp                       \
211    src/core/backbone_router/bbr_leader.cpp                         \
212    src/core/backbone_router/bbr_local.cpp                          \
213    src/core/backbone_router/bbr_manager.cpp                        \
214    src/core/backbone_router/multicast_listeners_table.cpp          \
215    src/core/backbone_router/ndproxy_table.cpp                      \
216    src/core/border_router/infra_if_platform.cpp                    \
217    src/core/border_router/router_advertisement.cpp                 \
218    src/core/border_router/routing_manager.cpp                      \
219    src/core/coap/coap.cpp                                          \
220    src/core/coap/coap_message.cpp                                  \
221    src/core/coap/coap_secure.cpp                                   \
222    src/core/common/crc16.cpp                                       \
223    src/core/common/error.cpp                                       \
224    src/core/common/heap_string.cpp                                 \
225    src/core/common/instance.cpp                                    \
226    src/core/common/logging.cpp                                     \
227    src/core/common/message.cpp                                     \
228    src/core/common/notifier.cpp                                    \
229    src/core/common/random_manager.cpp                              \
230    src/core/common/settings.cpp                                    \
231    src/core/common/string.cpp                                      \
232    src/core/common/tasklet.cpp                                     \
233    src/core/common/time_ticker.cpp                                 \
234    src/core/common/timer.cpp                                       \
235    src/core/common/tlvs.cpp                                        \
236    src/core/common/trickle_timer.cpp                               \
237    src/core/crypto/aes_ccm.cpp                                     \
238    src/core/crypto/aes_ecb.cpp                                     \
239    src/core/crypto/ecdsa.cpp                                       \
240    src/core/crypto/hkdf_sha256.cpp                                 \
241    src/core/crypto/hmac_sha256.cpp                                 \
242    src/core/crypto/mbedtls.cpp                                     \
243    src/core/crypto/pbkdf2_cmac.cpp                                 \
244    src/core/crypto/sha256.cpp                                      \
245    src/core/diags/factory_diags.cpp                                \
246    src/core/mac/channel_mask.cpp                                   \
247    src/core/mac/data_poll_handler.cpp                              \
248    src/core/mac/data_poll_sender.cpp                               \
249    src/core/mac/link_raw.cpp                                       \
250    src/core/mac/mac.cpp                                            \
251    src/core/mac/mac_filter.cpp                                     \
252    src/core/mac/mac_frame.cpp                                      \
253    src/core/mac/mac_links.cpp                                      \
254    src/core/mac/mac_types.cpp                                      \
255    src/core/mac/sub_mac.cpp                                        \
256    src/core/mac/sub_mac_callbacks.cpp                              \
257    src/core/meshcop/announce_begin_client.cpp                      \
258    src/core/meshcop/border_agent.cpp                               \
259    src/core/meshcop/commissioner.cpp                               \
260    src/core/meshcop/dataset.cpp                                    \
261    src/core/meshcop/dataset_local.cpp                              \
262    src/core/meshcop/dataset_manager.cpp                            \
263    src/core/meshcop/dataset_manager_ftd.cpp                        \
264    src/core/meshcop/dataset_updater.cpp                            \
265    src/core/meshcop/dtls.cpp                                       \
266    src/core/meshcop/energy_scan_client.cpp                         \
267    src/core/meshcop/joiner.cpp                                     \
268    src/core/meshcop/joiner_router.cpp                              \
269    src/core/meshcop/meshcop.cpp                                    \
270    src/core/meshcop/meshcop_leader.cpp                             \
271    src/core/meshcop/meshcop_tlvs.cpp                               \
272    src/core/meshcop/panid_query_client.cpp                         \
273    src/core/meshcop/timestamp.cpp                                  \
274    src/core/net/checksum.cpp                                       \
275    src/core/net/dhcp6_client.cpp                                   \
276    src/core/net/dhcp6_server.cpp                                   \
277    src/core/net/dns_client.cpp                                     \
278    src/core/net/dns_types.cpp                                      \
279    src/core/net/dnssd_server.cpp                                   \
280    src/core/net/icmp6.cpp                                          \
281    src/core/net/ip4_address.cpp                                    \
282    src/core/net/ip6.cpp                                            \
283    src/core/net/ip6_address.cpp                                    \
284    src/core/net/ip6_filter.cpp                                     \
285    src/core/net/ip6_headers.cpp                                    \
286    src/core/net/ip6_mpl.cpp                                        \
287    src/core/net/nd_agent.cpp                                       \
288    src/core/net/netif.cpp                                          \
289    src/core/net/sntp_client.cpp                                    \
290    src/core/net/socket.cpp                                         \
291    src/core/net/srp_client.cpp                                     \
292    src/core/net/srp_server.cpp                                     \
293    src/core/net/tcp6.cpp                                           \
294    src/core/net/udp6.cpp                                           \
295    src/core/radio/radio.cpp                                        \
296    src/core/radio/radio_callbacks.cpp                              \
297    src/core/radio/radio_platform.cpp                               \
298    src/core/radio/trel_interface.cpp                               \
299    src/core/radio/trel_link.cpp                                    \
300    src/core/radio/trel_packet.cpp                                  \
301    src/core/thread/address_resolver.cpp                            \
302    src/core/thread/announce_begin_server.cpp                       \
303    src/core/thread/announce_sender.cpp                             \
304    src/core/thread/child_table.cpp                                 \
305    src/core/thread/csl_tx_scheduler.cpp                            \
306    src/core/thread/discover_scanner.cpp                            \
307    src/core/thread/dua_manager.cpp                                 \
308    src/core/thread/energy_scan_server.cpp                          \
309    src/core/thread/indirect_sender.cpp                             \
310    src/core/thread/key_manager.cpp                                 \
311    src/core/thread/link_metrics.cpp                                \
312    src/core/thread/link_quality.cpp                                \
313    src/core/thread/lowpan.cpp                                      \
314    src/core/thread/mesh_forwarder.cpp                              \
315    src/core/thread/mesh_forwarder_ftd.cpp                          \
316    src/core/thread/mesh_forwarder_mtd.cpp                          \
317    src/core/thread/mle.cpp                                         \
318    src/core/thread/mle_router.cpp                                  \
319    src/core/thread/mle_types.cpp                                   \
320    src/core/thread/mlr_manager.cpp                                 \
321    src/core/thread/neighbor_table.cpp                              \
322    src/core/thread/network_data.cpp                                \
323    src/core/thread/network_data_leader.cpp                         \
324    src/core/thread/network_data_leader_ftd.cpp                     \
325    src/core/thread/network_data_local.cpp                          \
326    src/core/thread/network_data_notifier.cpp                       \
327    src/core/thread/network_data_publisher.cpp                      \
328    src/core/thread/network_data_service.cpp                        \
329    src/core/thread/network_data_tlvs.cpp                           \
330    src/core/thread/network_data_types.cpp                          \
331    src/core/thread/network_diagnostic.cpp                          \
332    src/core/thread/panid_query_server.cpp                          \
333    src/core/thread/radio_selector.cpp                              \
334    src/core/thread/router_table.cpp                                \
335    src/core/thread/src_match_controller.cpp                        \
336    src/core/thread/thread_netif.cpp                                \
337    src/core/thread/time_sync_service.cpp                           \
338    src/core/thread/tmf.cpp                                         \
339    src/core/thread/topology.cpp                                    \
340    src/core/thread/uri_paths.cpp                                   \
341    src/core/utils/channel_manager.cpp                              \
342    src/core/utils/channel_monitor.cpp                              \
343    src/core/utils/child_supervision.cpp                            \
344    src/core/utils/flash.cpp                                        \
345    src/core/utils/heap.cpp                                         \
346    src/core/utils/history_tracker.cpp                              \
347    src/core/utils/jam_detector.cpp                                 \
348    src/core/utils/lookup_table.cpp                                 \
349    src/core/utils/otns.cpp                                         \
350    src/core/utils/parse_cmdline.cpp                                \
351    src/core/utils/ping_sender.cpp                                  \
352    src/core/utils/slaac_address.cpp                                \
353    src/core/utils/srp_client_buffers.cpp                           \
354    src/lib/hdlc/hdlc.cpp                                           \
355    src/lib/platform/exit_code.c                                    \
356    src/lib/spinel/spinel.c                                         \
357    src/lib/spinel/spinel_decoder.cpp                               \
358    src/lib/spinel/spinel_encoder.cpp                               \
359    src/lib/url/url.cpp                                             \
360    src/posix/platform/alarm.cpp                                    \
361    src/posix/platform/backbone.cpp                                 \
362    src/posix/platform/daemon.cpp                                   \
363    src/posix/platform/entropy.cpp                                  \
364    src/posix/platform/hdlc_interface.cpp                           \
365    src/posix/platform/infra_if.cpp                                 \
366    src/posix/platform/logging.cpp                                  \
367    src/posix/platform/mainloop.cpp                                 \
368    src/posix/platform/memory.cpp                                   \
369    src/posix/platform/misc.cpp                                     \
370    src/posix/platform/multicast_routing.cpp                        \
371    src/posix/platform/netif.cpp                                    \
372    src/posix/platform/radio.cpp                                    \
373    src/posix/platform/radio_url.cpp                                \
374    src/posix/platform/settings.cpp                                 \
375    src/posix/platform/spi_interface.cpp                            \
376    src/posix/platform/system.cpp                                   \
377    src/posix/platform/trel_udp6.cpp                                \
378    src/posix/platform/udp.cpp                                      \
379    third_party/mbedtls/repo/library/aes.c                          \
380    third_party/mbedtls/repo/library/aesni.c                        \
381    third_party/mbedtls/repo/library/arc4.c                         \
382    third_party/mbedtls/repo/library/aria.c                         \
383    third_party/mbedtls/repo/library/asn1parse.c                    \
384    third_party/mbedtls/repo/library/asn1write.c                    \
385    third_party/mbedtls/repo/library/base64.c                       \
386    third_party/mbedtls/repo/library/bignum.c                       \
387    third_party/mbedtls/repo/library/blowfish.c                     \
388    third_party/mbedtls/repo/library/camellia.c                     \
389    third_party/mbedtls/repo/library/ccm.c                          \
390    third_party/mbedtls/repo/library/certs.c                        \
391    third_party/mbedtls/repo/library/chacha20.c                     \
392    third_party/mbedtls/repo/library/chachapoly.c                   \
393    third_party/mbedtls/repo/library/cipher.c                       \
394    third_party/mbedtls/repo/library/cipher_wrap.c                  \
395    third_party/mbedtls/repo/library/cmac.c                         \
396    third_party/mbedtls/repo/library/ctr_drbg.c                     \
397    third_party/mbedtls/repo/library/debug.c                        \
398    third_party/mbedtls/repo/library/des.c                          \
399    third_party/mbedtls/repo/library/dhm.c                          \
400    third_party/mbedtls/repo/library/ecdh.c                         \
401    third_party/mbedtls/repo/library/ecdsa.c                        \
402    third_party/mbedtls/repo/library/ecjpake.c                      \
403    third_party/mbedtls/repo/library/ecp.c                          \
404    third_party/mbedtls/repo/library/ecp_curves.c                   \
405    third_party/mbedtls/repo/library/entropy.c                      \
406    third_party/mbedtls/repo/library/entropy_poll.c                 \
407    third_party/mbedtls/repo/library/error.c                        \
408    third_party/mbedtls/repo/library/gcm.c                          \
409    third_party/mbedtls/repo/library/havege.c                       \
410    third_party/mbedtls/repo/library/hkdf.c                         \
411    third_party/mbedtls/repo/library/hmac_drbg.c                    \
412    third_party/mbedtls/repo/library/md.c                           \
413    third_party/mbedtls/repo/library/md2.c                          \
414    third_party/mbedtls/repo/library/md4.c                          \
415    third_party/mbedtls/repo/library/md5.c                          \
416    third_party/mbedtls/repo/library/memory_buffer_alloc.c          \
417    third_party/mbedtls/repo/library/net_sockets.c                  \
418    third_party/mbedtls/repo/library/nist_kw.c                      \
419    third_party/mbedtls/repo/library/oid.c                          \
420    third_party/mbedtls/repo/library/padlock.c                      \
421    third_party/mbedtls/repo/library/pem.c                          \
422    third_party/mbedtls/repo/library/pk.c                           \
423    third_party/mbedtls/repo/library/pk_wrap.c                      \
424    third_party/mbedtls/repo/library/pkcs11.c                       \
425    third_party/mbedtls/repo/library/pkcs12.c                       \
426    third_party/mbedtls/repo/library/pkcs5.c                        \
427    third_party/mbedtls/repo/library/pkparse.c                      \
428    third_party/mbedtls/repo/library/pkwrite.c                      \
429    third_party/mbedtls/repo/library/platform.c                     \
430    third_party/mbedtls/repo/library/platform_util.c                \
431    third_party/mbedtls/repo/library/poly1305.c                     \
432    third_party/mbedtls/repo/library/psa_crypto.c                   \
433    third_party/mbedtls/repo/library/psa_crypto_driver_wrappers.c   \
434    third_party/mbedtls/repo/library/psa_crypto_se.c                \
435    third_party/mbedtls/repo/library/psa_crypto_slot_management.c   \
436    third_party/mbedtls/repo/library/psa_crypto_storage.c           \
437    third_party/mbedtls/repo/library/psa_its_file.c                 \
438    third_party/mbedtls/repo/library/ripemd160.c                    \
439    third_party/mbedtls/repo/library/rsa.c                          \
440    third_party/mbedtls/repo/library/rsa_internal.c                 \
441    third_party/mbedtls/repo/library/sha1.c                         \
442    third_party/mbedtls/repo/library/sha256.c                       \
443    third_party/mbedtls/repo/library/sha512.c                       \
444    third_party/mbedtls/repo/library/ssl_cache.c                    \
445    third_party/mbedtls/repo/library/ssl_ciphersuites.c             \
446    third_party/mbedtls/repo/library/ssl_cli.c                      \
447    third_party/mbedtls/repo/library/ssl_cookie.c                   \
448    third_party/mbedtls/repo/library/ssl_msg.c                      \
449    third_party/mbedtls/repo/library/ssl_srv.c                      \
450    third_party/mbedtls/repo/library/ssl_ticket.c                   \
451    third_party/mbedtls/repo/library/ssl_tls.c                      \
452    third_party/mbedtls/repo/library/ssl_tls13_keys.c               \
453    third_party/mbedtls/repo/library/threading.c                    \
454    third_party/mbedtls/repo/library/timing.c                       \
455    third_party/mbedtls/repo/library/version.c                      \
456    third_party/mbedtls/repo/library/version_features.c             \
457    third_party/mbedtls/repo/library/x509.c                         \
458    third_party/mbedtls/repo/library/x509_create.c                  \
459    third_party/mbedtls/repo/library/x509_crl.c                     \
460    third_party/mbedtls/repo/library/x509_crt.c                     \
461    third_party/mbedtls/repo/library/x509_csr.c                     \
462    third_party/mbedtls/repo/library/x509write_crt.c                \
463    third_party/mbedtls/repo/library/x509write_csr.c                \
464    third_party/mbedtls/repo/library/xtea.c                         \
465    $(OPENTHREAD_PROJECT_SRC_FILES)                                 \
466    $(NULL)
467
468include $(BUILD_STATIC_LIBRARY)
469
470include $(CLEAR_VARS)
471
472LOCAL_MODULE := libopenthread-cli
473LOCAL_MODULE_TAGS := eng
474
475LOCAL_C_INCLUDES                                         := \
476    $(OPENTHREAD_PROJECT_INCLUDES)                          \
477    $(LOCAL_PATH)/include                                   \
478    $(LOCAL_PATH)/src                                       \
479    $(LOCAL_PATH)/src/cli                                   \
480    $(LOCAL_PATH)/src/core                                  \
481    $(LOCAL_PATH)/src/posix/platform                        \
482    $(LOCAL_PATH)/src/posix/platform/include                \
483    $(LOCAL_PATH)/third_party/mbedtls                       \
484    $(LOCAL_PATH)/third_party/mbedtls/repo/include          \
485    $(NULL)
486
487LOCAL_CFLAGS                                                                := \
488    $(OPENTHREAD_PUBLIC_CFLAGS)                                                \
489    $(OPENTHREAD_PRIVATE_CFLAGS)                                               \
490    $(OPENTHREAD_PROJECT_CFLAGS)                                               \
491    $(NULL)
492
493LOCAL_CPPFLAGS                                                              := \
494    -std=c++11                                                                 \
495    -pedantic-errors                                                           \
496    $(NULL)
497
498LOCAL_SRC_FILES                            := \
499    src/cli/cli.cpp                           \
500    src/cli/cli_coap.cpp                      \
501    src/cli/cli_coap_secure.cpp               \
502    src/cli/cli_commissioner.cpp              \
503    src/cli/cli_dataset.cpp                   \
504    src/cli/cli_history.cpp                   \
505    src/cli/cli_joiner.cpp                    \
506    src/cli/cli_network_data.cpp              \
507    src/cli/cli_srp_client.cpp                \
508    src/cli/cli_srp_server.cpp                \
509    src/cli/cli_tcp.cpp                       \
510    src/cli/cli_udp.cpp                       \
511    $(NULL)
512
513include $(BUILD_STATIC_LIBRARY)
514
515include $(CLEAR_VARS)
516
517LOCAL_MODULE := ot-cli
518LOCAL_MODULE_TAGS := eng
519
520ifneq ($(ANDROID_NDK),1)
521LOCAL_SHARED_LIBRARIES := libcutils
522endif
523
524LOCAL_C_INCLUDES                                         := \
525    $(OPENTHREAD_PROJECT_INCLUDES)                          \
526    $(LOCAL_PATH)/include                                   \
527    $(LOCAL_PATH)/src                                       \
528    $(LOCAL_PATH)/src/cli                                   \
529    $(LOCAL_PATH)/src/core                                  \
530    $(LOCAL_PATH)/src/posix/platform                        \
531    $(LOCAL_PATH)/src/posix/platform/include                \
532    $(LOCAL_PATH)/third_party/mbedtls                       \
533    $(LOCAL_PATH)/third_party/mbedtls/repo/include          \
534    $(NULL)
535
536LOCAL_CFLAGS                                                                := \
537    $(OPENTHREAD_PUBLIC_CFLAGS)                                                \
538    $(OPENTHREAD_PRIVATE_CFLAGS)                                               \
539    $(OPENTHREAD_PROJECT_CFLAGS)                                               \
540    $(NULL)
541
542LOCAL_CPPFLAGS                                                              := \
543    -std=c++11                                                                 \
544    -pedantic-errors                                                           \
545    $(NULL)
546
547LOCAL_LDLIBS                               := \
548    -lrt                                      \
549    -lutil
550
551LOCAL_SRC_FILES                            := \
552    src/posix/cli_readline.cpp                \
553    src/posix/cli_stdio.cpp                   \
554    src/posix/main.c                          \
555    $(NULL)
556
557LOCAL_STATIC_LIBRARIES = libopenthread-cli ot-core
558include $(BUILD_EXECUTABLE)
559
560ifeq ($(USE_OTBR_DAEMON), 1)
561include $(CLEAR_VARS)
562
563LOCAL_MODULE := ot-ctl
564LOCAL_MODULE_TAGS := eng
565
566LOCAL_CPPFLAGS                                                              := \
567    -std=c++11                                                                 \
568    -pedantic-errors                                                           \
569    $(NULL)
570
571LOCAL_CFLAGS                                                                := \
572    $(OPENTHREAD_PUBLIC_CFLAGS)                                                \
573    $(OPENTHREAD_PRIVATE_CFLAGS)                                               \
574    $(OPENTHREAD_PROJECT_CFLAGS)                                               \
575    $(NULL)
576
577LOCAL_C_INCLUDES                                         := \
578    $(OPENTHREAD_PROJECT_INCLUDES)                          \
579    $(LOCAL_PATH)/include                                   \
580    $(LOCAL_PATH)/src/                                      \
581    $(LOCAL_PATH)/src/core                                  \
582    $(LOCAL_PATH)/src/posix/platform                        \
583    $(LOCAL_PATH)/src/posix/platform/include                \
584    $(NULL)
585
586LOCAL_SRC_FILES := src/posix/client.cpp
587
588include $(BUILD_EXECUTABLE)
589endif # ($(USE_OTBR_DAEMON), 1)
590
591ifneq ($(OPENTHREAD_PROJECT_ANDROID_MK),)
592include $(OPENTHREAD_PROJECT_ANDROID_MK)
593endif
594
595endif # ($(OPENTHREAD_ENABLE_ANDROID_MK),1)
596