1#
2#  Copyright (c) 2016, 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
29include $(abs_top_nlbuild_autotools_dir)/automake/pre.am
30
31lib_LIBRARIES                              = $(NULL)
32
33if OPENTHREAD_ENABLE_FTD
34lib_LIBRARIES                             += libopenthread-ftd.a
35endif
36
37if OPENTHREAD_ENABLE_MTD
38lib_LIBRARIES                             += libopenthread-mtd.a
39endif
40
41if OPENTHREAD_ENABLE_RADIO_ONLY
42lib_LIBRARIES                             += libopenthread-radio.a
43endif
44
45CPPFLAGS_COMMON                            = \
46    -I$(top_srcdir)/include                  \
47    $(OPENTHREAD_TARGET_DEFINES)             \
48    $(NULL)
49
50libopenthread_radio_a_CPPFLAGS             = \
51    $(CPPFLAGS_COMMON)                       \
52    -DOPENTHREAD_MTD=0                       \
53    -DOPENTHREAD_FTD=0                       \
54    -DOPENTHREAD_RADIO=1                     \
55    $(NULL)
56
57libopenthread_ftd_a_CPPFLAGS               = \
58    $(CPPFLAGS_COMMON)                       \
59    -DOPENTHREAD_MTD=0                       \
60    -DOPENTHREAD_FTD=1                       \
61    -DOPENTHREAD_RADIO=0                     \
62    $(NULL)
63
64libopenthread_mtd_a_CPPFLAGS               = \
65    $(CPPFLAGS_COMMON)                       \
66    -DOPENTHREAD_MTD=1                       \
67    -DOPENTHREAD_FTD=0                       \
68    -DOPENTHREAD_RADIO=0                     \
69    $(NULL)
70
71#------------------------------------------------------
72# Note to maintainer/developers about "SOURCES_COMMON"
73#
74# The traditional method for GNU style Makefile.am files
75# is to have IF statements within the Makefile
76#
77# These IF statements would add (or not add) certain
78# source files from the build/library being built.
79#
80# In general, IDEs do not easily support this.
81# Some do, some do not, those that do support it
82# often do so in a very different or complex way.
83# Bottom line: It is a very mixed bag of results.
84#
85# Thus we bend to the IDEs, and impose these rules:
86#
87# Rule #1
88#     All code(files) should be compiled
89#     Even if it is not used or required
90#
91#     For example: In the MTD build, some features
92#     are disabled and thus in the traditional scheme
93#     source files could be excluded SOURCES_COMMON
94#     via makefile IF/ELSE/ENDIF constructs.
95#
96#     This makes it impossibly hard for IDEs.
97#     Thus we compile everything.
98#
99#     And then rely upon Rule #2.
100#
101# Rule #2
102#     Files that are not required, in certain
103#     configurations require appropriate wrappers
104#     Such as #if/#else/#endif
105#
106#     The net result is sort of an "empty translation
107#     unit"
108#
109
110SOURCES_COMMON                                  = \
111    api/backbone_router_api.cpp                   \
112    api/backbone_router_ftd_api.cpp               \
113    api/border_agent_api.cpp                      \
114    api/border_router_api.cpp                     \
115    api/channel_manager_api.cpp                   \
116    api/channel_monitor_api.cpp                   \
117    api/child_supervision_api.cpp                 \
118    api/coap_api.cpp                              \
119    api/coap_secure_api.cpp                       \
120    api/commissioner_api.cpp                      \
121    api/crypto_api.cpp                            \
122    api/dataset_api.cpp                           \
123    api/dataset_ftd_api.cpp                       \
124    api/dataset_updater_api.cpp                   \
125    api/diags_api.cpp                             \
126    api/dns_api.cpp                               \
127    api/dns_server_api.cpp                        \
128    api/entropy_api.cpp                           \
129    api/error_api.cpp                             \
130    api/heap_api.cpp                              \
131    api/history_tracker_api.cpp                   \
132    api/icmp6_api.cpp                             \
133    api/instance_api.cpp                          \
134    api/ip6_api.cpp                               \
135    api/jam_detection_api.cpp                     \
136    api/joiner_api.cpp                            \
137    api/link_api.cpp                              \
138    api/link_metrics_api.cpp                      \
139    api/link_raw_api.cpp                          \
140    api/logging_api.cpp                           \
141    api/message_api.cpp                           \
142    api/multi_radio_api.cpp                       \
143    api/netdata_api.cpp                           \
144    api/netdata_publisher_api.cpp                 \
145    api/netdiag_api.cpp                           \
146    api/network_time_api.cpp                      \
147    api/ping_sender_api.cpp                       \
148    api/random_crypto_api.cpp                     \
149    api/random_noncrypto_api.cpp                  \
150    api/server_api.cpp                            \
151    api/sntp_api.cpp                              \
152    api/srp_client_api.cpp                        \
153    api/srp_client_buffers_api.cpp                \
154    api/srp_server_api.cpp                        \
155    api/tasklet_api.cpp                           \
156    api/tcp_api.cpp                               \
157    api/thread_api.cpp                            \
158    api/thread_ftd_api.cpp                        \
159    api/udp_api.cpp                               \
160    backbone_router/backbone_tmf.cpp              \
161    backbone_router/bbr_leader.cpp                \
162    backbone_router/bbr_local.cpp                 \
163    backbone_router/bbr_manager.cpp               \
164    backbone_router/multicast_listeners_table.cpp \
165    backbone_router/ndproxy_table.cpp             \
166    border_router/infra_if_platform.cpp           \
167    border_router/router_advertisement.cpp        \
168    border_router/routing_manager.cpp             \
169    coap/coap.cpp                                 \
170    coap/coap_message.cpp                         \
171    coap/coap_secure.cpp                          \
172    common/crc16.cpp                              \
173    common/error.cpp                              \
174    common/heap_string.cpp                        \
175    common/instance.cpp                           \
176    common/logging.cpp                            \
177    common/message.cpp                            \
178    common/notifier.cpp                           \
179    common/random_manager.cpp                     \
180    common/settings.cpp                           \
181    common/string.cpp                             \
182    common/tasklet.cpp                            \
183    common/time_ticker.cpp                        \
184    common/timer.cpp                              \
185    common/tlvs.cpp                               \
186    common/trickle_timer.cpp                      \
187    crypto/aes_ccm.cpp                            \
188    crypto/aes_ecb.cpp                            \
189    crypto/ecdsa.cpp                              \
190    crypto/hkdf_sha256.cpp                        \
191    crypto/hmac_sha256.cpp                        \
192    crypto/mbedtls.cpp                            \
193    crypto/pbkdf2_cmac.cpp                        \
194    crypto/sha256.cpp                             \
195    diags/factory_diags.cpp                       \
196    mac/channel_mask.cpp                          \
197    mac/data_poll_handler.cpp                     \
198    mac/data_poll_sender.cpp                      \
199    mac/link_raw.cpp                              \
200    mac/mac.cpp                                   \
201    mac/mac_filter.cpp                            \
202    mac/mac_frame.cpp                             \
203    mac/mac_links.cpp                             \
204    mac/mac_types.cpp                             \
205    mac/sub_mac.cpp                               \
206    mac/sub_mac_callbacks.cpp                     \
207    meshcop/announce_begin_client.cpp             \
208    meshcop/border_agent.cpp                      \
209    meshcop/commissioner.cpp                      \
210    meshcop/dataset.cpp                           \
211    meshcop/dataset_local.cpp                     \
212    meshcop/dataset_manager.cpp                   \
213    meshcop/dataset_manager_ftd.cpp               \
214    meshcop/dataset_updater.cpp                   \
215    meshcop/dtls.cpp                              \
216    meshcop/energy_scan_client.cpp                \
217    meshcop/joiner.cpp                            \
218    meshcop/joiner_router.cpp                     \
219    meshcop/meshcop.cpp                           \
220    meshcop/meshcop_leader.cpp                    \
221    meshcop/meshcop_tlvs.cpp                      \
222    meshcop/panid_query_client.cpp                \
223    meshcop/timestamp.cpp                         \
224    net/checksum.cpp                              \
225    net/dhcp6_client.cpp                          \
226    net/dhcp6_server.cpp                          \
227    net/dns_client.cpp                            \
228    net/dns_types.cpp                             \
229    net/dnssd_server.cpp                          \
230    net/icmp6.cpp                                 \
231    net/ip4_address.cpp                           \
232    net/ip6.cpp                                   \
233    net/ip6_address.cpp                           \
234    net/ip6_filter.cpp                            \
235    net/ip6_headers.cpp                           \
236    net/ip6_mpl.cpp                               \
237    net/nd_agent.cpp                              \
238    net/netif.cpp                                 \
239    net/sntp_client.cpp                           \
240    net/socket.cpp                                \
241    net/srp_client.cpp                            \
242    net/srp_server.cpp                            \
243    net/tcp6.cpp                                  \
244    net/udp6.cpp                                  \
245    radio/radio.cpp                               \
246    radio/radio_callbacks.cpp                     \
247    radio/radio_platform.cpp                      \
248    radio/trel_interface.cpp                      \
249    radio/trel_link.cpp                           \
250    radio/trel_packet.cpp                         \
251    thread/address_resolver.cpp                   \
252    thread/announce_begin_server.cpp              \
253    thread/announce_sender.cpp                    \
254    thread/child_table.cpp                        \
255    thread/csl_tx_scheduler.cpp                   \
256    thread/discover_scanner.cpp                   \
257    thread/dua_manager.cpp                        \
258    thread/energy_scan_server.cpp                 \
259    thread/indirect_sender.cpp                    \
260    thread/key_manager.cpp                        \
261    thread/link_metrics.cpp                       \
262    thread/link_quality.cpp                       \
263    thread/lowpan.cpp                             \
264    thread/mesh_forwarder.cpp                     \
265    thread/mesh_forwarder_ftd.cpp                 \
266    thread/mesh_forwarder_mtd.cpp                 \
267    thread/mle.cpp                                \
268    thread/mle_router.cpp                         \
269    thread/mle_types.cpp                          \
270    thread/mlr_manager.cpp                        \
271    thread/neighbor_table.cpp                     \
272    thread/network_data.cpp                       \
273    thread/network_data_leader.cpp                \
274    thread/network_data_leader_ftd.cpp            \
275    thread/network_data_local.cpp                 \
276    thread/network_data_notifier.cpp              \
277    thread/network_data_publisher.cpp             \
278    thread/network_data_service.cpp               \
279    thread/network_data_tlvs.cpp                  \
280    thread/network_data_types.cpp                 \
281    thread/network_diagnostic.cpp                 \
282    thread/panid_query_server.cpp                 \
283    thread/radio_selector.cpp                     \
284    thread/router_table.cpp                       \
285    thread/src_match_controller.cpp               \
286    thread/thread_netif.cpp                       \
287    thread/time_sync_service.cpp                  \
288    thread/tmf.cpp                                \
289    thread/topology.cpp                           \
290    thread/uri_paths.cpp                          \
291    utils/channel_manager.cpp                     \
292    utils/channel_monitor.cpp                     \
293    utils/child_supervision.cpp                   \
294    utils/flash.cpp                               \
295    utils/heap.cpp                                \
296    utils/history_tracker.cpp                     \
297    utils/jam_detector.cpp                        \
298    utils/lookup_table.cpp                        \
299    utils/otns.cpp                                \
300    utils/parse_cmdline.cpp                       \
301    utils/ping_sender.cpp                         \
302    utils/slaac_address.cpp                       \
303    utils/srp_client_buffers.cpp                  \
304    $(NULL)
305
306EXTRA_DIST                                 = \
307    common/extension_example.cpp             \
308    $(NULL)
309
310libopenthread_radio_a_SOURCES              = \
311    api/diags_api.cpp                        \
312    api/error_api.cpp                        \
313    api/heap_api.cpp                         \
314    api/instance_api.cpp                     \
315    api/link_raw_api.cpp                     \
316    api/logging_api.cpp                      \
317    api/random_noncrypto_api.cpp             \
318    api/tasklet_api.cpp                      \
319    common/error.cpp                         \
320    common/instance.cpp                      \
321    common/logging.cpp                       \
322    common/random_manager.cpp                \
323    common/string.cpp                        \
324    common/tasklet.cpp                       \
325    common/timer.cpp                         \
326    crypto/aes_ccm.cpp                       \
327    crypto/aes_ecb.cpp                       \
328    diags/factory_diags.cpp                  \
329    mac/link_raw.cpp                         \
330    mac/mac_frame.cpp                        \
331    mac/mac_types.cpp                        \
332    mac/sub_mac.cpp                          \
333    mac/sub_mac_callbacks.cpp                \
334    radio/radio.cpp                          \
335    radio/radio_callbacks.cpp                \
336    radio/radio_platform.cpp                 \
337    thread/link_quality.cpp                  \
338    utils/lookup_table.cpp                   \
339    utils/parse_cmdline.cpp                  \
340    $(NULL)
341
342libopenthread_mtd_a_SOURCES                = \
343    $(SOURCES_COMMON)                        \
344    $(NULL)
345
346libopenthread_ftd_a_SOURCES                = \
347    $(SOURCES_COMMON)                        \
348    $(NULL)
349
350if OPENTHREAD_ENABLE_VENDOR_EXTENSION
351
352.INTERMEDIATE: vendor_extension_temp.cpp
353vendor_extension_temp.cpp: ${OPENTHREAD_VENDOR_EXTENSION_SOURCE}
354	$(AM_V_GEN)cp $< $@
355
356# "nodist_" prefix tells automake not to include in 'make dist'
357
358nodist_libopenthread_ftd_a_SOURCES         = \
359    vendor_extension_temp.cpp                \
360    $(NULL)
361
362nodist_libopenthread_mtd_a_SOURCES         = \
363    vendor_extension_temp.cpp                \
364    $(NULL)
365
366nodist_libopenthread_radio_a_SOURCES       = \
367    vendor_extension_temp.cpp                \
368    $(NULL)
369
370endif # OPENTHREAD_ENABLE_VENDOR_EXTENSION
371
372HEADERS_COMMON                                  = \
373    backbone_router/backbone_tmf.hpp              \
374    backbone_router/bbr_leader.hpp                \
375    backbone_router/bbr_local.hpp                 \
376    backbone_router/bbr_manager.hpp               \
377    backbone_router/multicast_listeners_table.hpp \
378    backbone_router/ndproxy_table.hpp             \
379    border_router/router_advertisement.hpp        \
380    border_router/routing_manager.hpp             \
381    coap/coap.hpp                                 \
382    coap/coap_message.hpp                         \
383    coap/coap_secure.hpp                          \
384    common/arg_macros.hpp                         \
385    common/array.hpp                              \
386    common/bit_vector.hpp                         \
387    common/clearable.hpp                          \
388    common/code_utils.hpp                         \
389    common/crc16.hpp                              \
390    common/debug.hpp                              \
391    common/encoding.hpp                           \
392    common/equatable.hpp                          \
393    common/error.hpp                              \
394    common/extension.hpp                          \
395    common/heap_string.hpp                        \
396    common/instance.hpp                           \
397    common/iterator_utils.hpp                     \
398    common/linked_list.hpp                        \
399    common/locator.hpp                            \
400    common/locator_getters.hpp                    \
401    common/logging.hpp                            \
402    common/message.hpp                            \
403    common/new.hpp                                \
404    common/non_copyable.hpp                       \
405    common/notifier.hpp                           \
406    common/numeric_limits.hpp                     \
407    common/pool.hpp                               \
408    common/random.hpp                             \
409    common/random_manager.hpp                     \
410    common/settings.hpp                           \
411    common/settings_driver.hpp                    \
412    common/string.hpp                             \
413    common/tasklet.hpp                            \
414    common/time.hpp                               \
415    common/time_ticker.hpp                        \
416    common/timer.hpp                              \
417    common/tlvs.hpp                               \
418    common/trickle_timer.hpp                      \
419    common/type_traits.hpp                        \
420    config/announce_sender.h                      \
421    config/backbone_router.h                      \
422    config/border_router.h                        \
423    config/channel_manager.h                      \
424    config/channel_monitor.h                      \
425    config/child_supervision.h                    \
426    config/coap.h                                 \
427    config/commissioner.h                         \
428    config/dataset_updater.h                      \
429    config/dhcp6_client.h                         \
430    config/dhcp6_server.h                         \
431    config/diag.h                                 \
432    config/dns_client.h                           \
433    config/dnssd_server.h                         \
434    config/dtls.h                                 \
435    config/history_tracker.h                      \
436    config/ip6.h                                  \
437    config/joiner.h                               \
438    config/link_quality.h                         \
439    config/link_raw.h                             \
440    config/logging.h                              \
441    config/mac.h                                  \
442    config/mle.h                                  \
443    config/netdata_publisher.h                    \
444    config/openthread-core-config-check.h         \
445    config/openthread-core-default-config.h       \
446    config/parent_search.h                        \
447    config/ping_sender.h                          \
448    config/platform.h                             \
449    config/radio_link.h                           \
450    config/sntp_client.h                          \
451    config/srp_client.h                           \
452    config/srp_server.h                           \
453    config/time_sync.h                            \
454    config/tmf.h                                  \
455    crypto/aes_ccm.hpp                            \
456    crypto/aes_ecb.hpp                            \
457    crypto/ecdsa.hpp                              \
458    crypto/hkdf_sha256.hpp                        \
459    crypto/hmac_sha256.hpp                        \
460    crypto/mbedtls.hpp                            \
461    crypto/pbkdf2_cmac.hpp                        \
462    crypto/sha256.hpp                             \
463    diags/factory_diags.hpp                       \
464    mac/channel_mask.hpp                          \
465    mac/data_poll_handler.hpp                     \
466    mac/data_poll_sender.hpp                      \
467    mac/link_raw.hpp                              \
468    mac/mac.hpp                                   \
469    mac/mac_filter.hpp                            \
470    mac/mac_frame.hpp                             \
471    mac/mac_links.hpp                             \
472    mac/mac_types.hpp                             \
473    mac/sub_mac.hpp                               \
474    meshcop/announce_begin_client.hpp             \
475    meshcop/border_agent.hpp                      \
476    meshcop/commissioner.hpp                      \
477    meshcop/dataset.hpp                           \
478    meshcop/dataset_local.hpp                     \
479    meshcop/dataset_manager.hpp                   \
480    meshcop/dataset_updater.hpp                   \
481    meshcop/dtls.hpp                              \
482    meshcop/energy_scan_client.hpp                \
483    meshcop/joiner.hpp                            \
484    meshcop/joiner_router.hpp                     \
485    meshcop/meshcop.hpp                           \
486    meshcop/meshcop_leader.hpp                    \
487    meshcop/meshcop_tlvs.hpp                      \
488    meshcop/panid_query_client.hpp                \
489    meshcop/timestamp.hpp                         \
490    net/checksum.hpp                              \
491    net/dhcp6.hpp                                 \
492    net/dhcp6_client.hpp                          \
493    net/dhcp6_server.hpp                          \
494    net/dns_client.hpp                            \
495    net/dns_types.hpp                             \
496    net/dnssd_server.hpp                          \
497    net/icmp6.hpp                                 \
498    net/ip4_address.hpp                           \
499    net/ip6.hpp                                   \
500    net/ip6_address.hpp                           \
501    net/ip6_filter.hpp                            \
502    net/ip6_headers.hpp                           \
503    net/ip6_mpl.hpp                               \
504    net/nd_agent.hpp                              \
505    net/netif.hpp                                 \
506    net/sntp_client.hpp                           \
507    net/socket.hpp                                \
508    net/srp_client.hpp                            \
509    net/srp_server.hpp                            \
510    net/tcp6.hpp                                  \
511    net/udp6.hpp                                  \
512    openthread-core-config.h                      \
513    radio/max_power_table.hpp                     \
514    radio/radio.hpp                               \
515    radio/trel_interface.hpp                      \
516    radio/trel_link.hpp                           \
517    radio/trel_packet.hpp                         \
518    thread/address_resolver.hpp                   \
519    thread/announce_begin_server.hpp              \
520    thread/announce_sender.hpp                    \
521    thread/child_mask.hpp                         \
522    thread/child_table.hpp                        \
523    thread/csl_tx_scheduler.hpp                   \
524    thread/discover_scanner.hpp                   \
525    thread/dua_manager.hpp                        \
526    thread/energy_scan_server.hpp                 \
527    thread/indirect_sender.hpp                    \
528    thread/indirect_sender_frame_context.hpp      \
529    thread/key_manager.hpp                        \
530    thread/link_metrics.hpp                       \
531    thread/link_metrics_tlvs.hpp                  \
532    thread/link_quality.hpp                       \
533    thread/lowpan.hpp                             \
534    thread/mesh_forwarder.hpp                     \
535    thread/mle.hpp                                \
536    thread/mle_router.hpp                         \
537    thread/mle_tlvs.hpp                           \
538    thread/mle_types.hpp                          \
539    thread/mlr_manager.hpp                        \
540    thread/mlr_types.hpp                          \
541    thread/neighbor_table.hpp                     \
542    thread/network_data.hpp                       \
543    thread/network_data_leader.hpp                \
544    thread/network_data_leader_ftd.hpp            \
545    thread/network_data_local.hpp                 \
546    thread/network_data_notifier.hpp              \
547    thread/network_data_publisher.hpp             \
548    thread/network_data_service.hpp               \
549    thread/network_data_tlvs.hpp                  \
550    thread/network_data_types.hpp                 \
551    thread/network_diagnostic.hpp                 \
552    thread/network_diagnostic_tlvs.hpp            \
553    thread/panid_query_server.hpp                 \
554    thread/radio_selector.hpp                     \
555    thread/router_table.hpp                       \
556    thread/src_match_controller.hpp               \
557    thread/thread_netif.hpp                       \
558    thread/thread_tlvs.hpp                        \
559    thread/time_sync_service.hpp                  \
560    thread/tmf.hpp                                \
561    thread/topology.hpp                           \
562    thread/uri_paths.hpp                          \
563    utils/channel_manager.hpp                     \
564    utils/channel_monitor.hpp                     \
565    utils/child_supervision.hpp                   \
566    utils/flash.hpp                               \
567    utils/heap.hpp                                \
568    utils/history_tracker.hpp                     \
569    utils/jam_detector.hpp                        \
570    utils/lookup_table.hpp                        \
571    utils/otns.hpp                                \
572    utils/parse_cmdline.hpp                       \
573    utils/ping_sender.hpp                         \
574    utils/slaac_address.hpp                       \
575    utils/srp_client_buffers.hpp                  \
576    $(NULL)
577
578noinst_HEADERS                             = \
579    $(HEADERS_COMMON)                        \
580    $(NULL)
581
582if OPENTHREAD_BUILD_COVERAGE
583Dash       = -
584CLEANFILES = $(shell find $(top_builddir)/src/core $(Dash)name "*.gcda" $(Dash)o $(Dash)name "*.gcno")
585endif
586
587include $(abs_top_nlbuild_autotools_dir)/automake/post.am
588