diff --git a/build/efr32/efr32-app.mk b/build/efr32/efr32-app.mk index dd6da5459bb3a3..0fafc675a3f30b 100644 --- a/build/efr32/efr32-app.mk +++ b/build/efr32/efr32-app.mk @@ -1,6 +1,5 @@ # -# Copyright (c) 2019 Google LLC. -# All rights reserved. +# # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -23,7 +22,7 @@ # # This makefile is primarily intended to support building the -# OpenWeave example applications on Silicon Labs platforms. However +# CHIP example applications on Silicon Labs platforms. However # external developers should feel free to use it if they find # it useful. # @@ -31,32 +30,30 @@ # in a project-specific Makefile, define make variables describing # the application and how it should be built, and then call the # GenerateBuildRules function. E.g.: -# +# # PROJECT_ROOT = $(realpath .) # -# BUILD_SUPPORT_DIR = $(PROJECT_ROOT)/third_party/openweave-core/build/efr32 -# +# BUILD_SUPPORT_DIR = $(PROJECT_ROOT)/third_party/connectedhomeip/build/efr32 +# # include $(BUILD_SUPPORT_DIR)/efr32-app.mk -# include $(BUILD_SUPPORT_DIR)/efr32-openweave.mk -# include $(BUILD_SUPPORT_DIR)/efr32-openthread.mk -# include $(BUILD_SUPPORT_DIR)/efr32-freertos.mk -# -# APP := openweave-efr32-bringup -# +# include $(BUILD_SUPPORT_DIR)/efr32-chip.mk +# +# APP := chip-efr32-bringup +# # SRCS = \ # $(PROJECT_ROOT)/main.cpp \ # ... -# +# # INC_DIRS = \ # $(PROJECT_ROOT) \ # ... -# +# # LIBS = \ # ... -# +# # DEFINES = \ # ... -# +# # $(call GenerateBuildRules) # @@ -134,8 +131,9 @@ EXTRA_SRCS += \ $(EFR32_SDK_ROOT)/util/third_party/mbedtls/sl_crypto/src/crypto_sha.c \ $(EFR32_SDK_ROOT)/util/third_party/mbedtls/sl_crypto/src/shax.c \ $(EFR32_SDK_ROOT)/util/third_party/mbedtls/sl_crypto/src/crypto_management.c - + STD_INC_DIRS += \ + $(CHIP_ROOT)/src/include/platform/EFR32 \ $(OPENTHREAD_ROOT)/output/include \ $(OPENTHREAD_ROOT)/src/core/ \ $(OPENTHREAD_ROOT)/third_party/jlink/SEGGER_RTT_V640/RTT \ @@ -175,7 +173,6 @@ STD_INC_DIRS += \ $(EFR32_SDK_ROOT)/platform/radio/rail_lib/plugin/pa-conversions \ $(EFR32_SDK_ROOT)/util/plugin/plugin-common/fem-control \ $(EFR32_SDK_ROOT)/util/third_party/mbedtls/sl_crypto/include \ - $(OPENWEAVE_ROOT)/src/adaptations/device-layer/include/Weave/DeviceLayer/EFR32 \ $(OPENTHREAD_ROOT)/examples/platforms/$(EFR32FAMILY)/ \ $(OPENTHREAD_ROOT)/examples/platforms/$(EFR32FAMILY)/$(BOARD_LC) \ $(OPENTHREAD_ROOT)/examples/platforms/$(EFR32FAMILY)/crypto @@ -236,10 +233,10 @@ STD_CFLAGS = \ -fno-strict-aliasing \ -fshort-enums \ --specs=nosys.specs - + MBEDTLS_FLAGS = \ -DMBEDTLS_CONFIG_FILE='"mbedtls-config.h"' \ - -DMBEDTLS_USER_CONFIG_FILE='"efr32-weave-mbedtls-config.h"' + -DMBEDTLS_USER_CONFIG_FILE='"efr32-chip-mbedtls-config.h"' STD_CXXFLAGS = \ -fno-rtti \ @@ -358,7 +355,7 @@ VERBOSE ?= 0 ifeq ($(VERBOSE),1) NO_ECHO := - HDR_PREFIX := ==================== + HDR_PREFIX := ==================== else NO_ECHO := @ HDR_PREFIX := @@ -371,7 +368,7 @@ DEBUG_FLAGS = -g0 endif ifeq ($(OPT),1) -OPT_FLAGS = -Os +OPT_FLAGS = -Os else OPT_FLAGS = -Og endif @@ -383,7 +380,7 @@ endif # Convert source file name to object file name define ObjFileName -$(OBJS_DIR)/$(notdir $1).o +$(OBJS_DIR)/$(notdir $1).o endef # Convert source file name to dependency file name @@ -484,7 +481,7 @@ include $$(wildcard $(DEPS_DIR)/*.d) endef -# Generates late-bound rule for building an object file from a C file +# Generates late-bound rule for building an object file from a C file define CCRule $(call DepFileName,$1) : ; $(call ObjFileName,$1): $1 $(call DepFileName,$1) | $(OBJS_DIR) $(DEPS_DIR) $(STD_COMPILE_PREREQUISITES) @@ -494,7 +491,7 @@ $(call ObjFileName,$1): $1 $(call DepFileName,$1) | $(OBJS_DIR) $(DEPS_DIR) $(ST $(NL) endef -# Generates late-bound rule for building an object file from a C++ file +# Generates late-bound rule for building an object file from a C++ file define CXXRule $(call DepFileName,$1) : ; $(call ObjFileName,$1): $1 $(call DepFileName,$1) | $(OBJS_DIR) $(DEPS_DIR) $(STD_COMPILE_PREREQUISITES) @@ -504,7 +501,7 @@ $(call ObjFileName,$1): $1 $(call DepFileName,$1) | $(OBJS_DIR) $(DEPS_DIR) $(ST $(NL) endef -# Generates late-bound rule for building an object file from an assembly file +# Generates late-bound rule for building an object file from an assembly file define ASRule $(call ObjFileName,$1): $1 | $(OBJS_DIR) $(STD_COMPILE_PREREQUISITES) @echo "$$(HDR_PREFIX)AS $1" @@ -533,22 +530,22 @@ endef # Desciptions of make targets define TargetHelp all Build the $(APP) application. - + clean Clean all build outputs. - + flash Build and flash the application onto the device. - + flash-app Flash the application onto the device without building it first. - + erase Wipe the device's flash memory. - + help Print this help message. endef # Desciptions of build options define OptionHelp - BOARD=board Build image for a particular module. + BOARD=board Build image for a particular module. Supported boards are BRD4161A, BRD4166A, BRD4170A, BRD4304A and BRD4180A. SERIALNO=serial Serial number of board to flash or erase when multiple @@ -558,7 +555,7 @@ define OptionHelp information. OPT=[1|0] Build the application with optimization. - + VERBOSE=[1|0] Show commands as they are being executed. endef diff --git a/build/efr32/efr32-chip.mk b/build/efr32/efr32-chip.mk new file mode 100644 index 00000000000000..8b6c07ff0030e5 --- /dev/null +++ b/build/efr32/efr32-chip.mk @@ -0,0 +1,250 @@ +# +# +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# +# @file +# Component makefile for incorporating CHIP into an EFR32 +# application. +# + +# +# This makefile is intended to work in conjunction with the efr32-app.mk +# makefile to build the CHIP example applications on Silicon Labs platforms. +# EFR32 applications should include this file in their top level Makefile +# along with the other makefiles in this directory. E.g.: +# +# PROJECT_ROOT = $(realpath .) +# +# BUILD_SUPPORT_DIR = $(PROJECT_ROOT)/third_party/connectedhomeip/build/efr32 +# +# include $(BUILD_SUPPORT_DIR)/efr32-app.mk +# include $(BUILD_SUPPORT_DIR)/efr32-chip.mk +# +# PROJECT_ROOT := $(realpath .) +# +# APP := chip-efr32-bringup +# +# SRCS = \ +# $(PROJECT_ROOT)/main.cpp \ +# ... +# +# $(call GenerateBuildRules) +# + +# ================================================== +# General settings +# ================================================== + +# Location of CHIP source tree +CHIP_ROOT ?= $(PROJECT_ROOT)/third_party/connectedhomeip + +# Archtecture for which CHIP will be built. +CHIP_HOST_ARCH := armv7-unknown-linux-gnu + +# Directory into which the CHIP build system will place its output. +CHIP_OUTPUT_DIR = $(OUTPUT_DIR)/chip + +# An optional file containing application-specific configuration overrides. +CHIP_PROJECT_CONFIG = $(wildcard $(PROJECT_ROOT)/CHIPProjectConfig.h) + +# Architcture on which CHIP is being built. +CHIP_BUILD_ARCH = $(shell $(CHIP_ROOT)/third_party/nlbuild-autotools/repo/third_party/autoconf/config.guess | sed -e 's/[[:digit:].]*$$//g') + +# ================================================== +# Compilation flags specific to building CHIP +# ================================================== + +CHIP_DEFINES += \ + EFR32_OPENTHREAD_API + +# Reduce number of buffers on efr32mg21 to fit within 96k RAM +ifeq ($(EFR32FAMILY), efr32mg21) +CHIP_DEFINES += \ + CHIP_CONFIG_EFR32MG21_PBUF_POOLS +endif + +CHIP_DEFINE_FLAGS = $(foreach def,$(CHIP_DEFINES),-D$(def)) +CHIP_CPPFLAGS = $(STD_CFLAGS) $(CFLAGS) $(DEBUG_FLAGS) $(OPT_FLAGS) $(DEFINE_FLAGS) $(CHIP_DEFINE_FLAGS) $(INC_FLAGS) +CHIP_CXXFLAGS = $(STD_CXXFLAGS) $(CXXFLAGS) + + +# ================================================== +# CHIP configuration options +# ================================================== + +CHIP_CONFIGURE_OPTIONS = \ + AR="$(AR)" AS="$(AS)" CC="$(CCACHE) $(CC)" CXX="$(CCACHE) $(CXX)" \ + LD="$(LD)" OBJCOPY="$(OBJCOPY)" RANLIB="$(RANLIB)" INSTALL="$(INSTALL) $(INSTALLFLAGS)" \ + CPPFLAGS="$(CHIP_CPPFLAGS)" \ + CXXFLAGS="$(CHIP_CXXFLAGS)" \ + --prefix=$(CHIP_OUTPUT_DIR) \ + --exec-prefix=$(CHIP_OUTPUT_DIR) \ + --host=$(CHIP_HOST_ARCH) \ + --build=$(CHIP_BUILD_ARCH) \ + --with-target-style=embedded \ + --with-device-layer=efr32 \ + --with-network-layer=all \ + --with-target-network=lwip \ + --with-lwip=internal \ + --with-lwip-target=efr32 \ + --with-inet-endpoint="tcp udp" \ + --with-openssl=no \ + --with-logging-style=external \ + --with-chip-project-includes=$(CHIP_PROJECT_CONFIG) \ + --with-chip-system-project-includes=$(CHIP_PROJECT_CONFIG) \ + --with-chip-inet-project-includes=$(CHIP_PROJECT_CONFIG) \ + --with-chip-ble-project-includes=$(CHIP_PROJECT_CONFIG) \ + --with-chip-warm-project-includes=$(CHIP_PROJECT_CONFIG) \ + --with-chip-device-project-includes=$(CHIP_PROJECT_CONFIG) \ + --disable-ipv4 \ + --disable-tests \ + --disable-tools \ + --disable-docs \ + --disable-java \ + --disable-device-manager \ + +# Enable / disable optimization. +ifeq ($(OPT),1) +CHIP_CONFIGURE_OPTIONS += --enable-optimization=yes +else +CHIP_CONFIGURE_OPTIONS += --enable-optimization=no +endif + +ifeq ($(DEBUG),1) +CHIP_CONFIGURE_OPTIONS += --enable-debug +endif + +# ================================================== +# Adjustments to standard build settings to +# incorporate CHIP +# ================================================== + +# Add CHIP-specific paths to the standard include directories. +STD_INC_DIRS += \ + $(CHIP_OUTPUT_DIR)/include \ + $(CHIP_OUTPUT_DIR)/src/include \ + $(CHIP_ROOT)/src/adaptations/device-layer/trait-support \ + $(CHIP_ROOT)/third_party/lwip/repo/lwip/src/include \ + $(CHIP_ROOT)/src/lwip \ + $(CHIP_ROOT)/src/lwip/efr32 \ + $(CHIP_ROOT)/src/lwip/freertos \ + $(EFR32_SDK_ROOT)/protocol/bluetooth/ble_stack/inc/soc \ + $(EFR32_SDK_ROOT)/protocol/bluetooth/ble_stack/inc/common \ + $(EFR32_SDK_ROOT)/app/bluetooth/common/util \ + $(EFR32_SDK_ROOT)/platform/radio/rail_lib/protocol/ble \ + $(EFR32_SDK_ROOT)/platform/radio/rail_lib/common + +# Add the location of CHIP libraries to application link action. +STD_LDFLAGS += -L$(CHIP_OUTPUT_DIR)/lib + +# Add CHIP libraries to standard libraries list. +STD_LIBS += \ + -lDeviceLayer \ + -lchip \ + -lWarm \ + -lInetLayer \ + -lmincrypt \ + -lnlfaultinjection \ + -lSystemLayer \ + -luECC \ + -llwip + +# Add the appropriate CHIP target as a prerequisite to all application +# compilation targets to ensure that CHIP gets built and its header +# files installed prior to compiling any dependent source files. +STD_COMPILE_PREREQUISITES += install-chip + +# Add the CHIP libraries as prerequisites for linking the application. +STD_LINK_PREREQUISITES += \ + $(CHIP_OUTPUT_DIR)/lib/libDeviceLayer.a \ + $(CHIP_OUTPUT_DIR)/lib/libchip.a \ + $(CHIP_OUTPUT_DIR)/lib/libWarm.a \ + $(CHIP_OUTPUT_DIR)/lib/libInetLayer.a \ + $(CHIP_OUTPUT_DIR)/lib/libmincrypt.a \ + $(CHIP_OUTPUT_DIR)/lib/libnlfaultinjection.a \ + $(CHIP_OUTPUT_DIR)/lib/libSystemLayer.a \ + $(CHIP_OUTPUT_DIR)/lib/libuECC.a \ + $(CHIP_OUTPUT_DIR)/lib/liblwip.a + + +# ================================================== +# Late-bound build rules for CHIP +# ================================================== + +# Add CHIPBuildRules to the list of late-bound build rules that +# will be evaluated when GenerateBuildRules is called. +LATE_BOUND_RULES += CHIPBuildRules + +# Rules for configuring, building and installing CHIP. +define CHIPBuildRules + +.PHONY : config-chip .check-config-chip build-chip install-chip clean-chip + +.check-config-chip : | $(CHIP_OUTPUT_DIR) + $(NO_ECHO)echo $(CHIP_ROOT)/configure $(CHIP_CONFIGURE_OPTIONS) > $(CHIP_OUTPUT_DIR)/config.args.tmp; \ + (test -r $(CHIP_OUTPUT_DIR)/config.args && cmp -s $(CHIP_OUTPUT_DIR)/config.args.tmp $(CHIP_OUTPUT_DIR)/config.args) || \ + mv $(CHIP_OUTPUT_DIR)/config.args.tmp $(CHIP_OUTPUT_DIR)/config.args; \ + rm -f $(CHIP_OUTPUT_DIR)/config.args.tmp; + +$(CHIP_OUTPUT_DIR)/config.args : .check-config-chip + @: # Null action required to work around make's crazy timestamp caching behavior. + +$(CHIP_ROOT)/configure : $(CHIP_ROOT)/configure.ac + @echo "$(HDR_PREFIX)BOOTSTRAP CHIP..." + $(NO_ECHO)(cd $(CHIP_ROOT) && ./bootstrap) + +$(CHIP_OUTPUT_DIR)/config.status : $(CHIP_ROOT)/configure $(CHIP_OUTPUT_DIR)/config.args + @echo "$(HDR_PREFIX)CONFIGURE CHIP..." + $(NO_ECHO)(cd $(CHIP_OUTPUT_DIR) && $(CHIP_ROOT)/configure $(CHIP_CONFIGURE_OPTIONS)) + +config-chip : $(CHIP_OUTPUT_DIR)/config.status | $(OPENTHREAD_PREREQUISITE) + +build-chip : config-chip + @echo "$(HDR_PREFIX)BUILD CHIP..." + $(NO_ECHO)MAKEFLAGS= make -C $(CHIP_OUTPUT_DIR) --no-print-directory all V=$(VERBOSE) + +install-chip : | build-chip + @echo "$(HDR_PREFIX)INSTALL CHIP..." + $(NO_ECHO)MAKEFLAGS= make -C $(CHIP_OUTPUT_DIR) --no-print-directory install V=$(VERBOSE) + +clean-chip: + @echo "$(HDR_PREFIX)RM $(CHIP_OUTPUT_DIR)" + $(NO_ECHO)rm -rf $(CHIP_OUTPUT_DIR) + +$(CHIP_OUTPUT_DIR) : + @echo "$(HDR_PREFIX)MKDIR $$@" + $(NO_ECHO)mkdir -p "$$@" + +endef + + +# ================================================== +# CHIP-specific help definitions +# ================================================== + +define TargetHelp += + + + config-chip Run the CHIP configure script. + + build-chip Build the CHIP libraries. + + install-chip Install CHIP libraries and headers in + build output directory for use by application. + + clean-chip Clean all build outputs produced by the CHIP + build process. +endef diff --git a/build/efr32/efr32-openweave.mk b/build/efr32/efr32-openweave.mk deleted file mode 100644 index e2afd7033de68a..00000000000000 --- a/build/efr32/efr32-openweave.mk +++ /dev/null @@ -1,253 +0,0 @@ -# -# Copyright (c) 2019 Google LLC. -# All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -# -# @file -# Component makefile for incorporating OpenWeave into an EFR32 -# application. -# - -# -# This makefile is intended to work in conjunction with the efr32-app.mk -# makefile to build the OpenWeave example applications on Silicon Labs platforms. -# EFR32 applications should include this file in their top level Makefile -# along with the other makefiles in this directory. E.g.: -# -# PROJECT_ROOT = $(realpath .) -# -# BUILD_SUPPORT_DIR = $(PROJECT_ROOT)/third_party/openweave-core/build/efr32 -# -# include $(BUILD_SUPPORT_DIR)/efr32-app.mk -# include $(BUILD_SUPPORT_DIR)/efr32-openweave.mk -# include $(BUILD_SUPPORT_DIR)/efr32-openthread.mk -# include $(BUILD_SUPPORT_DIR)/efr32-freertos.mk -# -# PROJECT_ROOT := $(realpath .) -# -# APP := openweave-efr32-bringup -# -# SRCS = \ -# $(PROJECT_ROOT)/main.cpp \ -# ... -# -# $(call GenerateBuildRules) -# - -# ================================================== -# General settings -# ================================================== - -# Location of OpenWeave source tree -OPENWEAVE_ROOT ?= $(PROJECT_ROOT)/third_party/openweave-core - -# Archtecture for which OpenWeave will be built. -OPENWEAVE_HOST_ARCH := armv7-unknown-linux-gnu - -# Directory into which the OpenWeave build system will place its output. -OPENWEAVE_OUTPUT_DIR = $(OUTPUT_DIR)/openweave - -# An optional file containing application-specific configuration overrides. -OPENWEAVE_PROJECT_CONFIG = $(wildcard $(PROJECT_ROOT)/WeaveProjectConfig.h) - -# Architcture on which OpenWeave is being built. -OPENWEAVE_BUILD_ARCH = $(shell $(OPENWEAVE_ROOT)/third_party/nlbuild-autotools/repo/third_party/autoconf/config.guess | sed -e 's/[[:digit:].]*$$//g') - -# ================================================== -# Compilation flags specific to building OpenWeave -# ================================================== - -OPENWEAVE_DEFINES += \ - EFR32_OPENTHREAD_API - -# Reduce number of buffers on efr32mg21 to fit within 96k RAM -ifeq ($(EFR32FAMILY), efr32mg21) -OPENWEAVE_DEFINES += \ - OPENWEAVE_CONFIG_EFR32MG21_PBUF_POOLS -endif - -OPENWEAVE_DEFINE_FLAGS = $(foreach def,$(OPENWEAVE_DEFINES),-D$(def)) -OPENWEAVE_CPPFLAGS = $(STD_CFLAGS) $(CFLAGS) $(DEBUG_FLAGS) $(OPT_FLAGS) $(DEFINE_FLAGS) $(OPENWEAVE_DEFINE_FLAGS) $(INC_FLAGS) -OPENWEAVE_CXXFLAGS = $(STD_CXXFLAGS) $(CXXFLAGS) - - -# ================================================== -# OpenWeave configuration options -# ================================================== - -OPENWEAVE_CONFIGURE_OPTIONS = \ - AR="$(AR)" AS="$(AS)" CC="$(CCACHE) $(CC)" CXX="$(CCACHE) $(CXX)" \ - LD="$(LD)" OBJCOPY="$(OBJCOPY)" RANLIB="$(RANLIB)" INSTALL="$(INSTALL) $(INSTALLFLAGS)" \ - CPPFLAGS="$(OPENWEAVE_CPPFLAGS)" \ - CXXFLAGS="$(OPENWEAVE_CXXFLAGS)" \ - --prefix=$(OPENWEAVE_OUTPUT_DIR) \ - --exec-prefix=$(OPENWEAVE_OUTPUT_DIR) \ - --host=$(OPENWEAVE_HOST_ARCH) \ - --build=$(OPENWEAVE_BUILD_ARCH) \ - --with-target-style=embedded \ - --with-device-layer=efr32 \ - --with-network-layer=all \ - --with-target-network=lwip \ - --with-lwip=internal \ - --with-lwip-target=efr32 \ - --with-inet-endpoint="tcp udp" \ - --with-openssl=no \ - --with-logging-style=external \ - --with-weave-project-includes=$(OPENWEAVE_PROJECT_CONFIG) \ - --with-weave-system-project-includes=$(OPENWEAVE_PROJECT_CONFIG) \ - --with-weave-inet-project-includes=$(OPENWEAVE_PROJECT_CONFIG) \ - --with-weave-ble-project-includes=$(OPENWEAVE_PROJECT_CONFIG) \ - --with-weave-warm-project-includes=$(OPENWEAVE_PROJECT_CONFIG) \ - --with-weave-device-project-includes=$(OPENWEAVE_PROJECT_CONFIG) \ - --disable-ipv4 \ - --disable-tests \ - --disable-tools \ - --disable-docs \ - --disable-java \ - --disable-device-manager \ - -# Enable / disable optimization. -ifeq ($(OPT),1) -OPENWEAVE_CONFIGURE_OPTIONS += --enable-optimization=yes -else -OPENWEAVE_CONFIGURE_OPTIONS += --enable-optimization=no -endif - -ifeq ($(DEBUG),1) -OPENWEAVE_CONFIGURE_OPTIONS += --enable-debug -endif - -# ================================================== -# Adjustments to standard build settings to -# incorporate OpenWeave -# ================================================== - -# Add OpenWeave-specific paths to the standard include directories. -STD_INC_DIRS += \ - $(OPENWEAVE_OUTPUT_DIR)/include \ - $(OPENWEAVE_OUTPUT_DIR)/src/include \ - $(OPENWEAVE_ROOT)/src/adaptations/device-layer/trait-support \ - $(OPENWEAVE_ROOT)/third_party/lwip/repo/lwip/src/include \ - $(OPENWEAVE_ROOT)/src/lwip \ - $(OPENWEAVE_ROOT)/src/lwip/efr32 \ - $(OPENWEAVE_ROOT)/src/lwip/freertos \ - $(EFR32_SDK_ROOT)/protocol/bluetooth/ble_stack/inc/soc \ - $(EFR32_SDK_ROOT)/protocol/bluetooth/ble_stack/inc/common \ - $(EFR32_SDK_ROOT)/app/bluetooth/common/util \ - $(EFR32_SDK_ROOT)/platform/radio/rail_lib/protocol/ble \ - $(EFR32_SDK_ROOT)/platform/radio/rail_lib/common - -# Add the location of OpenWeave libraries to application link action. -STD_LDFLAGS += -L$(OPENWEAVE_OUTPUT_DIR)/lib - -# Add OpenWeave libraries to standard libraries list. -STD_LIBS += \ - -lDeviceLayer \ - -lWeave \ - -lWarm \ - -lInetLayer \ - -lmincrypt \ - -lnlfaultinjection \ - -lSystemLayer \ - -luECC \ - -llwip - -# Add the appropriate OpenWeave target as a prerequisite to all application -# compilation targets to ensure that OpenWeave gets built and its header -# files installed prior to compiling any dependent source files. -STD_COMPILE_PREREQUISITES += install-weave - -# Add the OpenWeave libraries as prerequisites for linking the application. -STD_LINK_PREREQUISITES += \ - $(OPENWEAVE_OUTPUT_DIR)/lib/libDeviceLayer.a \ - $(OPENWEAVE_OUTPUT_DIR)/lib/libWeave.a \ - $(OPENWEAVE_OUTPUT_DIR)/lib/libWarm.a \ - $(OPENWEAVE_OUTPUT_DIR)/lib/libInetLayer.a \ - $(OPENWEAVE_OUTPUT_DIR)/lib/libmincrypt.a \ - $(OPENWEAVE_OUTPUT_DIR)/lib/libnlfaultinjection.a \ - $(OPENWEAVE_OUTPUT_DIR)/lib/libSystemLayer.a \ - $(OPENWEAVE_OUTPUT_DIR)/lib/libuECC.a \ - $(OPENWEAVE_OUTPUT_DIR)/lib/liblwip.a - - -# ================================================== -# Late-bound build rules for OpenWeave -# ================================================== - -# Add OpenWeaveBuildRules to the list of late-bound build rules that -# will be evaluated when GenerateBuildRules is called. -LATE_BOUND_RULES += OpenWeaveBuildRules - -# Rules for configuring, building and installing OpenWeave. -define OpenWeaveBuildRules - -.PHONY : config-weave .check-config-weave build-weave install-weave clean-weave - -.check-config-weave : | $(OPENWEAVE_OUTPUT_DIR) - $(NO_ECHO)echo $(OPENWEAVE_ROOT)/configure $(OPENWEAVE_CONFIGURE_OPTIONS) > $(OPENWEAVE_OUTPUT_DIR)/config.args.tmp; \ - (test -r $(OPENWEAVE_OUTPUT_DIR)/config.args && cmp -s $(OPENWEAVE_OUTPUT_DIR)/config.args.tmp $(OPENWEAVE_OUTPUT_DIR)/config.args) || \ - mv $(OPENWEAVE_OUTPUT_DIR)/config.args.tmp $(OPENWEAVE_OUTPUT_DIR)/config.args; \ - rm -f $(OPENWEAVE_OUTPUT_DIR)/config.args.tmp; - -$(OPENWEAVE_OUTPUT_DIR)/config.args : .check-config-weave - @: # Null action required to work around make's crazy timestamp caching behavior. - -$(OPENWEAVE_ROOT)/configure : $(OPENWEAVE_ROOT)/configure.ac - @echo "$(HDR_PREFIX)BOOTSTRAP OPENWEAVE..." - $(NO_ECHO)(cd $(OPENWEAVE_ROOT) && ./bootstrap) - -$(OPENWEAVE_OUTPUT_DIR)/config.status : $(OPENWEAVE_ROOT)/configure $(OPENWEAVE_OUTPUT_DIR)/config.args - @echo "$(HDR_PREFIX)CONFIGURE OPENWEAVE..." - $(NO_ECHO)(cd $(OPENWEAVE_OUTPUT_DIR) && $(OPENWEAVE_ROOT)/configure $(OPENWEAVE_CONFIGURE_OPTIONS)) - -config-weave : $(OPENWEAVE_OUTPUT_DIR)/config.status | $(OPENTHREAD_PREREQUISITE) - -build-weave : config-weave - @echo "$(HDR_PREFIX)BUILD OPENWEAVE..." - $(NO_ECHO)MAKEFLAGS= make -C $(OPENWEAVE_OUTPUT_DIR) --no-print-directory all V=$(VERBOSE) - -install-weave : | build-weave - @echo "$(HDR_PREFIX)INSTALL OPENWEAVE..." - $(NO_ECHO)MAKEFLAGS= make -C $(OPENWEAVE_OUTPUT_DIR) --no-print-directory install V=$(VERBOSE) - -clean-weave: - @echo "$(HDR_PREFIX)RM $(OPENWEAVE_OUTPUT_DIR)" - $(NO_ECHO)rm -rf $(OPENWEAVE_OUTPUT_DIR) - -$(OPENWEAVE_OUTPUT_DIR) : - @echo "$(HDR_PREFIX)MKDIR $$@" - $(NO_ECHO)mkdir -p "$$@" - -endef - - -# ================================================== -# OpenWeave-specific help definitions -# ================================================== - -define TargetHelp += - - - config-weave Run the OpenWeave configure script. - - build-weave Build the OpenWeave libraries. - - install-weave Install OpenWeave libraries and headers in - build output directory for use by application. - - clean-weave Clean all build outputs produced by the OpenWeave - build process. -endef