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_RADIO_CLI
124bin_PROGRAMS                                                            += \
125    ot-cli-radio                                                           \
126    $(NULL)
127endif
128
129ot_cli_radio_CPPFLAGS                                                    = \
130    $(CPPFLAGS_COMMON)                                                     \
131    $(NULL)
132
133ot_cli_radio_LDADD                                                       = \
134    $(top_builddir)/src/cli/libopenthread-cli-radio.a                      \
135    $(top_builddir)/src/core/libopenthread-radio-cli.a                     \
136    $(LDADD_COMMON)                                                        \
137    $(top_builddir)/src/core/libopenthread-radio-cli.a                     \
138    $(LDADD_COMMON)                                                        \
139    $(NULL)
140
141ot_cli_radio_LDFLAGS                                                     = \
142    $(LDFLAGS_COMMON)                                                      \
143    $(NULL)
144
145ot_cli_radio_LIBTOOLFLAGS                                                = \
146    $(LIBTOOLFLAGS_COMMON)                                                 \
147    $(NULL)
148
149ot_cli_radio_SOURCES                                                     = \
150    $(SOURCES_COMMON)                                                      \
151    $(NULL)
152
153if OPENTHREAD_ENABLE_LINKER_MAP
154ot_cli_ftd_LDFLAGS                                                    += -Wl,-Map=ot-cli-ftd.map
155ot_cli_mtd_LDFLAGS                                                    += -Wl,-Map=ot-cli-mtd.map
156ot_cli_radio_LDFLAGS                                                  += -Wl,-Map=ot-cli-radio.map
157endif
158
159if OPENTHREAD_BUILD_COVERAGE
160CPPFLAGS_COMMON                                                       += \
161    -DOPENTHREAD_ENABLE_COVERAGE                                         \
162    $(NULL)
163
164CLEANFILES                                                             = $(wildcard *.gcda *.gcno)
165endif # OPENTHREAD_BUILD_COVERAGE
166
167include $(abs_top_nlbuild_autotools_dir)/automake/post.am
168