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
30include $(top_srcdir)/examples/platforms/Makefile.platform.am
31
32bin_PROGRAMS                                                           = \
33    $(NULL)
34
35CPPFLAGS_COMMON                                                       += \
36    -I$(top_srcdir)/include                                              \
37    -I$(top_srcdir)/src                                                  \
38    -I$(top_srcdir)/src/core                                             \
39    -I$(top_srcdir)/examples/platforms                                   \
40    $(NULL)
41
42LDADD_COMMON                                                          += \
43    $(top_builddir)/third_party/tcplp/libtcplp.a                         \
44    $(NULL)
45
46LDFLAGS_COMMON                                                        += \
47    $(NULL)
48
49LIBTOOLFLAGS_COMMON                                                   += \
50    $(NULL)
51
52SOURCES_COMMON                                                        += \
53    cli_uart.cpp                                                         \
54    main.c                                                               \
55    $(NULL)
56
57if OPENTHREAD_ENABLE_BUILTIN_MBEDTLS
58LDADD_COMMON                                                          += \
59    $(top_builddir)/third_party/mbedtls/libmbedcrypto.a                  \
60    $(NULL)
61endif # OPENTHREAD_ENABLE_BUILTIN_MBEDTLS
62
63if OPENTHREAD_ENABLE_FTD
64bin_PROGRAMS                                                          += \
65    ot-cli-ftd                                                           \
66    $(NULL)
67endif
68
69ot_cli_ftd_CPPFLAGS                                                    = \
70    $(CPPFLAGS_COMMON)                                                   \
71    $(NULL)
72
73ot_cli_ftd_LDADD                                                       = \
74    $(top_builddir)/src/cli/libopenthread-cli-ftd.a                      \
75    $(top_builddir)/src/core/libopenthread-ftd.a                         \
76    $(LDADD_COMMON)                                                      \
77    $(top_builddir)/src/core/libopenthread-ftd.a                         \
78    $(LDADD_COMMON)                                                      \
79    $(NULL)
80
81ot_cli_ftd_LDFLAGS                                                     = \
82    $(LDFLAGS_COMMON)                                                    \
83    $(NULL)
84
85ot_cli_ftd_LIBTOOLFLAGS                                                = \
86    $(LIBTOOLFLAGS_COMMON)                                               \
87    $(NULL)
88
89ot_cli_ftd_SOURCES                                                     = \
90    $(SOURCES_COMMON)                                                    \
91    $(NULL)
92
93if OPENTHREAD_ENABLE_MTD
94bin_PROGRAMS                                                          += \
95    ot-cli-mtd                                                           \
96    $(NULL)
97endif
98
99ot_cli_mtd_CPPFLAGS                                                    = \
100    $(CPPFLAGS_COMMON)                                                   \
101    $(NULL)
102
103ot_cli_mtd_LDADD                                                       = \
104    $(top_builddir)/src/cli/libopenthread-cli-mtd.a                      \
105    $(top_builddir)/src/core/libopenthread-mtd.a                         \
106    $(LDADD_COMMON)                                                      \
107    $(top_builddir)/src/core/libopenthread-mtd.a                         \
108    $(LDADD_COMMON)                                                      \
109    $(NULL)
110
111ot_cli_mtd_LDFLAGS                                                     = \
112    $(LDFLAGS_COMMON)                                                    \
113    $(NULL)
114
115ot_cli_mtd_LIBTOOLFLAGS                                                = \
116    $(LIBTOOLFLAGS_COMMON)                                               \
117    $(NULL)
118
119ot_cli_mtd_SOURCES                                                     = \
120    $(SOURCES_COMMON)                                                    \
121    $(NULL)
122
123if OPENTHREAD_ENABLE_LINKER_MAP
124ot_cli_ftd_LDFLAGS                                                    += -Wl,-Map=ot-cli-ftd.map
125ot_cli_mtd_LDFLAGS                                                    += -Wl,-Map=ot-cli-mtd.map
126endif
127
128if OPENTHREAD_BUILD_COVERAGE
129CPPFLAGS_COMMON                                                       += \
130    -DOPENTHREAD_ENABLE_COVERAGE                                         \
131    $(NULL)
132
133CLEANFILES                                                             = $(wildcard *.gcda *.gcno)
134endif # OPENTHREAD_BUILD_COVERAGE
135
136include $(abs_top_nlbuild_autotools_dir)/automake/post.am
137