2 # Copyright (c) 2019, The OpenThread Authors.
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.
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.
29 include $(abs_top_nlbuild_autotools_dir)/automake/pre.am
30 include $(top_srcdir)/examples/platforms/Makefile.platform.am
32 override CFLAGS := $(filter-out -Wconversion,$(CFLAGS))
33 override CXXFLAGS := $(filter-out -Wconversion,$(CXXFLAGS))
35 EFR32_BOARD_DIR = $(shell echo $(BOARD) | tr A-Z a-z)
37 SDK_SRC_DIR = $(top_srcdir)/third_party/silabs/gecko_sdk_suite/v2.7
39 $(top_builddir)/examples/platforms/efr32mg21/libopenthread-efr32mg21.a:
40 (cd $(top_builddir)/examples/platforms/efr32mg21/ && $(MAKE) $(AM_MAKEFLAGS) libopenthread-efr32mg21.a )
46 -DEFR32_SERIES2_CONFIG1_MICRO \
47 -DNVIC_CONFIG=\"platform/base/hal/micro/cortexm3/efm32/nvic-config.h\" \
48 -DPLATFORM_HEADER=\"platform/base/hal/micro/cortexm3/compiler/gcc.h\" \
50 -I$(top_srcdir)/examples/platforms \
51 -I$(top_srcdir)/examples/platforms/efr32mg21/$(EFR32_BOARD_DIR) \
52 -I$(top_srcdir)/include \
53 -I$(top_srcdir)/src/core \
54 -I$(top_srcdir)/third_party/silabs/rail_config \
55 -I$(SDK_SRC_DIR)/hardware/kit/common/bsp \
56 -I$(SDK_SRC_DIR)/hardware/kit/common/drivers \
57 -I$(SDK_SRC_DIR)/hardware/kit/EFR32MG21_$(BOARD)/config \
58 -I$(SDK_SRC_DIR)/platform/base/hal/micro/cortexm3/efm32 \
59 -I$(SDK_SRC_DIR)/platform/base/hal/micro/cortexm3/efm32/config \
60 -I$(SDK_SRC_DIR)/platform/common/inc \
61 -I$(SDK_SRC_DIR)/platform/CMSIS/Include \
62 -I$(SDK_SRC_DIR)/platform/Device/SiliconLabs/EFR32MG21P/Include \
63 -I$(SDK_SRC_DIR)/platform/emdrv/common/inc \
64 -I$(SDK_SRC_DIR)/platform/emdrv/gpiointerrupt/inc \
65 -I$(SDK_SRC_DIR)/platform/emdrv/uartdrv/inc \
66 -I$(SDK_SRC_DIR)/platform/emdrv/uartdrv/config \
67 -I$(SDK_SRC_DIR)/platform/emdrv/ustimer/inc \
68 -I$(SDK_SRC_DIR)/platform/emdrv/dmadrv/inc \
69 -I$(SDK_SRC_DIR)/platform/emdrv/dmadrv/config \
70 -I$(SDK_SRC_DIR)/platform/emlib/inc \
71 -I$(SDK_SRC_DIR)/platform/halconfig/inc/hal-config \
72 -I$(SDK_SRC_DIR)/platform/radio/rail_lib/chip/efr32 \
73 -I$(SDK_SRC_DIR)/platform/radio/rail_lib/chip/efr32/efr32xg2x \
74 -I$(SDK_SRC_DIR)/platform/radio/rail_lib/chip/efr32/rf/common/cortex \
75 -I$(SDK_SRC_DIR)/platform/radio/rail_lib/common \
76 -I$(SDK_SRC_DIR)/platform/radio/rail_lib/hal \
77 -I$(SDK_SRC_DIR)/platform/radio/rail_lib/hal/efr32 \
78 -I$(SDK_SRC_DIR)/platform/radio/rail_lib/protocol/ieee802154 \
79 -I$(SDK_SRC_DIR)/platform/radio/rail_lib/plugin/pa-conversions \
80 -I$(SDK_SRC_DIR)/platform/service/mpu/inc \
81 -I$(SDK_SRC_DIR)/platform/service/sleeptimer/config \
82 -I$(SDK_SRC_DIR)/platform/service/sleeptimer/inc \
83 -I$(SDK_SRC_DIR)/util/plugin/plugin-common/fem-control \
84 -I$(SDK_SRC_DIR)/util/third_party/mbedtls/sl_crypto/include \
85 -Wno-unused-parameter \
86 -Wno-missing-field-initializers \
95 LIBTOOLFLAGS_COMMON += \
102 if OPENTHREAD_ENABLE_BUILTIN_MBEDTLS
104 $(top_builddir)/third_party/mbedtls/libmbedcrypto.a \
106 endif # OPENTHREAD_ENABLE_BUILTIN_MBEDTLS
108 if OPENTHREAD_ENABLE_EXECUTABLE
114 sleepy_demo_mtd_CPPFLAGS = \
118 sleepy_demo_mtd_LDADD = \
119 $(top_builddir)/src/cli/libopenthread-cli-mtd.a \
120 $(top_builddir)/src/core/libopenthread-mtd.a \
122 $(top_builddir)/src/core/libopenthread-mtd.a \
126 sleepy_demo_mtd_LDFLAGS = \
130 sleepy_demo_mtd_LIBTOOLFLAGS = \
131 $(LIBTOOLFLAGS_COMMON) \
134 sleepy_demo_mtd_SOURCES = \
138 if OPENTHREAD_ENABLE_LINKER_MAP
139 sleepy_demo_mtd_LDFLAGS += -Wl,-Map=sleepy-demo-mtd.map
142 if OPENTHREAD_BUILD_COVERAGE
144 -DOPENTHREAD_ENABLE_COVERAGE \
147 CLEANFILES = $(wildcard *.gcda *.gcno)
148 endif # OPENTHREAD_BUILD_COVERAGE
150 include $(abs_top_nlbuild_autotools_dir)/automake/post.am