From 5198c0b5c38b2f1ad23e71daab9d35c932bab2bf Mon Sep 17 00:00:00 2001 From: shchen Date: Tue, 2 Feb 2021 15:57:26 +0800 Subject: [PATCH 1/4] fix mbedtls --- .../demos/oc_mqtt_demo/oc_mqtt_water_meter.c | 2 +- .../iot_link/os/freertos_bl/freertos_bl_imp.c | 24 +------------------ components/security/mbedtls/bouffalo.mk | 6 ++--- customer_app/bl602_huawei_cloud/Makefile | 1 + .../bl602_huawei_cloud/bl602_demo_wifi/main.c | 4 ++-- .../bl602_huawei_cloud/proj_config.mk | 4 ++++ make_scripts_riscv/project.mk | 2 +- 7 files changed, 12 insertions(+), 31 deletions(-) diff --git a/components/3rdparty/hwcloud_iot_link/iot_link/demos/oc_mqtt_demo/oc_mqtt_water_meter.c b/components/3rdparty/hwcloud_iot_link/iot_link/demos/oc_mqtt_demo/oc_mqtt_water_meter.c index 9f226c8e..03331bb6 100644 --- a/components/3rdparty/hwcloud_iot_link/iot_link/demos/oc_mqtt_demo/oc_mqtt_water_meter.c +++ b/components/3rdparty/hwcloud_iot_link/iot_link/demos/oc_mqtt_demo/oc_mqtt_water_meter.c @@ -89,7 +89,7 @@ static const char s_server_ca[] = "CAUw7C29C79Fv1C5qfPrmAESrciIxpg0X40KPMbp1ZWVbd4=\r\n" "-----END CERTIFICATE-----\r\n"; -#define CN_EP_DEVICEID "6007910b4f04b00309bca4a3_bl602_mqtt_12345678" // watermeter水表模型 +#define CN_EP_DEVICEID "60056c19aaafca02dbd25786_bl602_mqtt_12345678" // watermeter水表模型 #define CN_EP_PASSWD "12345678" // ///< the client use the cert mode SHA-256 diff --git a/components/3rdparty/hwcloud_iot_link/iot_link/os/freertos_bl/freertos_bl_imp.c b/components/3rdparty/hwcloud_iot_link/iot_link/os/freertos_bl/freertos_bl_imp.c index 0dbdb280..f75aa871 100644 --- a/components/3rdparty/hwcloud_iot_link/iot_link/os/freertos_bl/freertos_bl_imp.c +++ b/components/3rdparty/hwcloud_iot_link/iot_link/os/freertos_bl/freertos_bl_imp.c @@ -83,13 +83,7 @@ static void __task_exit() while(1); //not supported yet } -// static void* __cur_task_id() -// { -// void *handler = xTaskGetCurrentTaskHandle(); -// return handler; -// } -///< this is implement for the mutex -//creat a mutex for the os + static bool_t __mutex_create(osal_mutex_t *mutex) { *mutex = xSemaphoreCreateMutex(); @@ -256,22 +250,6 @@ static unsigned long long __get_sys_time() return xTaskGetTickCount(); } - -#if 0 // -//interrupt -// #include -// static int __int_connect(int intnum, int prio, int mode, fn_interrupt_handle callback, void* arg) -// { -// extern unsigned int LOS_HwiCreate(HWI_HANDLE_T uwHwiNum, \ -// HWI_PRIOR_T usHwiPrio, \ -// HWI_MODE_T usMode, \ -// HWI_PROC_FUNC pfnHandler, \ -// HWI_ARG_T uwArg \ -// ); -// return LOS_HwiCreate((HWI_HANDLE_T)intnum, (HWI_PRIOR_T)prio,(HWI_MODE_T) mode, (HWI_PROC_FUNC)callback, (HWI_ARG_T)arg); -// } -#endif - static const tag_os_ops s_cmsisos_ops = { .task_sleep = __task_sleep, diff --git a/components/security/mbedtls/bouffalo.mk b/components/security/mbedtls/bouffalo.mk index 8c5e2b3e..31bdaa7b 100644 --- a/components/security/mbedtls/bouffalo.mk +++ b/components/security/mbedtls/bouffalo.mk @@ -1,10 +1,10 @@ # Component Makefile # ## These include paths would be exported to project level -COMPONENT_ADD_INCLUDEDIRS += include/mbedtls_port +COMPONENT_ADD_INCLUDEDIRS += ## not be exported to project level -COMPONENT_PRIV_INCLUDEDIRS := include/mbedtls include/icrypto +COMPONENT_PRIV_INCLUDEDIRS := include/mbedtls include/icrypto include/mbedtls_port NAME := imbedtls @@ -96,5 +96,3 @@ COMPONENT_SRCDIRS := src ## CPPFLAGS += -DLWIP_ENABLED -DCONFIG_PLAT_AOS -## Hwcloud -CPPFLAGS += -D MBEDTLS_CONFIG_FILE=\"los_mbedtls_config.h\" diff --git a/customer_app/bl602_huawei_cloud/Makefile b/customer_app/bl602_huawei_cloud/Makefile index f3b5ffeb..337f6bde 100644 --- a/customer_app/bl602_huawei_cloud/Makefile +++ b/customer_app/bl602_huawei_cloud/Makefile @@ -31,5 +31,6 @@ INCLUDE_COMPONENTS += $(COMPONENTS_NETWORK) INCLUDE_COMPONENTS += $(COMPONENTS_BLSYS) INCLUDE_COMPONENTS += $(COMPONENTS_VFS) INCLUDE_COMPONENTS += $(PROJECT_NAME) +## Hwcloud include $(BL60X_SDK_PATH)/make_scripts_riscv/project.mk diff --git a/customer_app/bl602_huawei_cloud/bl602_demo_wifi/main.c b/customer_app/bl602_huawei_cloud/bl602_demo_wifi/main.c index 775b7d80..180b9697 100644 --- a/customer_app/bl602_huawei_cloud/bl602_demo_wifi/main.c +++ b/customer_app/bl602_huawei_cloud/bl602_demo_wifi/main.c @@ -83,7 +83,7 @@ #include #ifdef CONFIG_HWCLOUD_IOT_LINK -#include // +#include #endif #define mainHELLO_TASK_PRIORITY ( 20 ) @@ -1015,7 +1015,7 @@ void bfl_main() xTaskCreateStatic(proc_hellow_entry, (char*)"hellow", 512, NULL, 15, proc_hellow_stack, &proc_hellow_task); #ifdef CONFIG_HWCLOUD_IOT_LINK - example_hwcloud_iot_link(); // + example_hwcloud_iot_link(); #endif puts("[OS] Starting aos_loop_proc task...\r\n"); diff --git a/customer_app/bl602_huawei_cloud/proj_config.mk b/customer_app/bl602_huawei_cloud/proj_config.mk index 1e1eeef1..ee4ade71 100644 --- a/customer_app/bl602_huawei_cloud/proj_config.mk +++ b/customer_app/bl602_huawei_cloud/proj_config.mk @@ -51,6 +51,10 @@ endif #blog enable components format :=blog_testc cli vfs helper LOG_ENABLED_COMPONENTS:=blog_testc hal_drv loopset looprt bloop + #enable huaweicloud iot link example // CONFIG_HWCLOUD_IOT_LINK := 1 +ifeq ($(CONFIG_HWCLOUD_IOT_LINK),1) +CPPFLAGS += -D MBEDTLS_CONFIG_FILE=\"los_mbedtls_config.h\" +endif \ No newline at end of file diff --git a/make_scripts_riscv/project.mk b/make_scripts_riscv/project.mk index 2df88bbe..cbd59c68 100644 --- a/make_scripts_riscv/project.mk +++ b/make_scripts_riscv/project.mk @@ -261,7 +261,7 @@ CPPFLAGS += -D BL_CHIP_NAME=\"$(BL_CHIP_NAME)\" -MMD -MP $(CPPFLAGS) $(EXTRA_CPP CPPFLAGS += -DARCH_RISCV # Warnings-related flags relevant both for C and C++ -COMMON_WARNING_FLAGS = -Wall -Werror=all \ +COMMON_WARNING_FLAGS = -Wall \ -Wno-error=unused-function \ -Wno-error=unused-but-set-variable \ -Wno-error=unused-variable \ From 9a28c6e3a6862c731aba3a81e73ea5392cbe15c3 Mon Sep 17 00:00:00 2001 From: shchen Date: Tue, 2 Feb 2021 17:03:32 +0800 Subject: [PATCH 2/4] resume os makefile --- customer_app/bl602_huawei_cloud/Makefile | 2 +- customer_app/bl602_huawei_cloud/project.mk | 546 +++++++++++++++++++++ make_scripts_riscv/project.mk | 45 +- 3 files changed, 567 insertions(+), 26 deletions(-) create mode 100644 customer_app/bl602_huawei_cloud/project.mk diff --git a/customer_app/bl602_huawei_cloud/Makefile b/customer_app/bl602_huawei_cloud/Makefile index 337f6bde..794b3b4c 100644 --- a/customer_app/bl602_huawei_cloud/Makefile +++ b/customer_app/bl602_huawei_cloud/Makefile @@ -32,5 +32,5 @@ INCLUDE_COMPONENTS += $(COMPONENTS_BLSYS) INCLUDE_COMPONENTS += $(COMPONENTS_VFS) INCLUDE_COMPONENTS += $(PROJECT_NAME) ## Hwcloud -include $(BL60X_SDK_PATH)/make_scripts_riscv/project.mk +include ./project.mk diff --git a/customer_app/bl602_huawei_cloud/project.mk b/customer_app/bl602_huawei_cloud/project.mk new file mode 100644 index 00000000..cbd59c68 --- /dev/null +++ b/customer_app/bl602_huawei_cloud/project.mk @@ -0,0 +1,546 @@ +# +# Main Project Makefile +# This Makefile is included directly from the user project Makefile in order to call the bouffalo.mk +# makefiles of all components (in a separate make process) to build all the libraries, then links them +# together into the final file. If so, PWD is the project dir (we assume). +# + +# +# This makefile requires the environment variable BL60X_SDK_PATH to be set to the top-level bl60x_sdk directory +# where this file is located. +# + +.PHONY: all build clean all_binaries list-components + +MAKECMDGOALS ?= all +all: all_binaries +# see below for recipe of 'all' target +# +# # other components will add dependencies to 'all_binaries'. The +# reason all_binaries is used instead of 'all' is so that the flash +# target can build everything without triggering the per-component "to +# flash..." output targets.) + +help: + @echo "Welcome to BL60x SDK build system. make targets:" + @echo "" + @echo "make all - Build app, components" + @echo "make clean - Remove all app components output" + @echo "make list-components - List all components in the project" + @echo "make [component name]" - build a component as a library + +# Non-interactive targets. Mostly, those for which you do not need to build a binary +# NON_INTERACTIVE_TARGET += defconfig clean% %clean help list-components print_flash_cmd + +# dependency checks +ifndef MAKE_RESTARTS +ifeq ("$(filter 4.% 3.81 3.82,$(MAKE_VERSION))","") +$(warning bl60x_sdk build system only supports GNU Make versions 3.81 or newer. You may see unexpected results with other Makes.) +endif + +endif # MAKE_RESTARTS + +# can't run 'clean' along with any non-clean targets +ifneq ("$(filter clean% %clean,$(MAKECMDGOALS))" ,"") +ifneq ("$(filter-out clean% %clean,$(MAKECMDGOALS))", "") +$(error bl60x_sdk build system doesn't support running 'clean' targets along with any others. Run 'make clean' and then run other targets separately.) +endif +endif + +OS ?= + +# make BL60X_SDK_PATH a "real" absolute path +# * works around the case where a shell character is embedded in the environment variable value. +# * changes Windows-style C:/blah/ paths to MSYS style /c/blah +ifeq ("$(OS)","Windows_NT") +# On Windows MSYS2, make wildcard function returns empty string for paths of form /xyz +# where /xyz is a directory inside the MSYS root - so we don't use it. +SANITISED_BL60X_SDK_PATH:=$(realpath $(BL60X_SDK_PATH)) +else +SANITISED_BL60X_SDK_PATH:=$(realpath $(wildcard $(BL60X_SDK_PATH))) +endif + +export BL60X_SDK_PATH := $(SANITISED_BL60X_SDK_PATH) + +ifndef BL60X_SDK_PATH +$(error BL60X_SDK_PATH variable is not set to a valid directory.) +endif + +ifneq ("$(BL60X_SDK_PATH)","$(SANITISED_BL60X_SDK_PATH)") +$(error If BL60X_SDK_PATH is overriden on command line, it must be an absolute path with no embedded shell special characters) +endif + +ifneq ("$(BL60X_SDK_PATH)","$(subst :,,$(BL60X_SDK_PATH))") +$(error BL60X_SDK_PATH cannot contain colons. If overriding BL60X_SDK_PATH on Windows, use MSYS Unix-style /c/dir instead of C:/dir) +endif + +# disable built-in make rules, makes debugging saner +MAKEFLAGS_OLD := $(MAKEFLAGS) +MAKEFLAGS +=-rR + +# Default path to the project: we assume the Makefile including this file +# is in the project directory +ifndef PROJECT_PATH +PROJECT_PATH := $(abspath $(dir $(firstword $(MAKEFILE_LIST)))) +export PROJECT_PATH +endif + +# A list of the "common" makefiles, to use as a target dependency +COMMON_MAKEFILES := $(abspath $(BL60X_SDK_PATH)/make_scripts_riscv/project.mk $(BL60X_SDK_PATH)/make_scripts_riscv/common.mk $(BL60X_SDK_PATH)/make_scripts_riscv/component_wrapper.mk $(firstword $(MAKEFILE_LIST))) +export COMMON_MAKEFILES + +# The directory where we put all objects/libraries/binaries. The project Makefile can +# configure this if needed. +ifndef BUILD_DIR_BASE +BUILD_DIR_BASE := $(PROJECT_PATH)/build_out +endif +export BUILD_DIR_BASE + +# Component directories. These directories are searched for components (either the directory is a component, +# or the directory contains subdirectories which are components.) +# The project Makefile can override these component dirs, or add extras via EXTRA_COMPONENT_DIRS +ifndef COMPONENT_DIRS +EXTRA_COMPONENT_DIRS ?= +COMPONENT_DIRS := $(PROJECT_PATH)/components $(EXTRA_COMPONENT_DIRS) $(BL60X_SDK_PATH)/components $(BL60X_SDK_PATH)/customer_components $(PROJECT_PATH)/$(PROJECT_NAME) $(PROJECT_COMPONENT) +endif +export COMPONENT_DIRS + +# The project Makefile can define a list of components, but if it does not do this we just take all available components +# in the component dirs. A component is COMPONENT_DIRS directory, or immediate subdirectory, +# which contains a bouffalo.mk file. +# +# Use the "make list-components" target to debug this step. +#ifndef COMPONENTS +# Find all component names. The component names are the same as the +# directories they're in, so /bla/components/mycomponent/bouffalo.mk -> mycomponent. +# using by https://stackoverflow.com/questions/3774568/makefile-issue-smart-way-to-scan-directory-tree-for-c-files +rwildcard = $(wildcard $1$2) $(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2)) +COMPONENTS_RAL_PATH := $(dir $(foreach cd,$(COMPONENT_DIRS), \ + $(call rwildcard,$(cd)/,bouffalo.mk) \ + )) +COMPONENTS := $(sort $(foreach comp,$(COMPONENTS_RAL_PATH),$(lastword $(subst /, ,$(comp))))) +COMPONENTS_REAL_PATH := $(patsubst %/,%,$(COMPONENTS_RAL_PATH)) +#endif +# After a full manifest of component names is determined, subtract the ones explicitly omitted by the project Makefile. +ifdef INCLUDE_COMPONENTS +# match exclude comps with EXCLUDE_COMPONENTS variable +define include_comps_add +include_path += $(filter %/$(1), $(COMPONENTS_REAL_PATH)) +endef +$(foreach comp,$(INCLUDE_COMPONENTS),$(eval $(call include_comps_add,$(comp)))) +INCLUDE_COMPONENTS_REAL_PATH := $(include_path) +# include components +COMPONENTS := $(filter $(INCLUDE_COMPONENTS), $(COMPONENTS)) +COMPONENTS_REAL_PATH := $(filter $(INCLUDE_COMPONENTS_REAL_PATH), $(COMPONENTS_REAL_PATH)) +endif +export COMPONENTS + +# Resolve all of COMPONENTS into absolute paths in COMPONENT_PATHS. +# +# If a component name exists in multiple COMPONENT_DIRS, we take the first match. +# +# NOTE: These paths must be generated WITHOUT a trailing / so we +# can use $(notdir x) to get the component name. +# TODO remove multiple name in components +#COMPONENT_PATHS := $(foreach comp,$(COMPONENTS),$(firstword $(foreach cd,$(COMPONENT_DIRS),$(wildcard $(dir $(cd))$(comp) $(cd)/$(comp))))) +#COMPONENT_PATHS := $(patsubst %/,%,$(COMPONENTS_RAL_PATH)) +COMPONENT_PATHS := $(COMPONENTS_REAL_PATH) +export COMPONENT_PATHS + + +# Initialise project-wide variables which can be added to by +# each component. +# +# These variables are built up via the component_project_vars.mk +# generated makefiles (one per component). +# +# See docs/build-system.rst for more details. +COMPONENT_INCLUDES := +COMPONENT_LDFLAGS := +COMPONENT_SUBMODULES := +COMPONENT_LIBRARIES := + +# COMPONENT_PROJECT_VARS is the list of component_project_vars.mk generated makefiles +# for each component. +# +# Including $(COMPONENT_PROJECT_VARS) builds the COMPONENT_INCLUDES, +# COMPONENT_LDFLAGS variables and also targets for any inter-component +# dependencies. +# +# See the component_project_vars.mk target in component_wrapper.mk +COMPONENT_PROJECT_VARS := $(addsuffix /component_project_vars.mk,$(notdir $(COMPONENT_PATHS) )) +COMPONENT_PROJECT_VARS := $(sort $(COMPONENT_PROJECT_VARS)) +COMPONENT_PROJECT_VARS := $(addprefix $(BUILD_DIR_BASE)/,$(COMPONENT_PROJECT_VARS)) +# this line is -include instead of include to prevent a spurious error message on make 3.81 +-include $(COMPONENT_PROJECT_VARS) + +# Also add top-level project include path, for top-level includes +# COMPONENT_INCLUDES += $(abspath $(BUILD_DIR_BASE)/include/) + +export COMPONENT_INCLUDES + +# Set variables common to both project & component +include $(BL60X_SDK_PATH)/make_scripts_riscv/common.mk +include $(BL60X_SDK_PATH)/make_scripts_riscv/toolchain.mk + +all: +ifeq ("$(OS)","Windows_NT") +else +ifeq ("$(CONFIG_CHIP_NAME)", "BL602") + #@cd $(BL60X_SDK_PATH)/image_conf; python3 flash_build.py $(PROJECT_NAME) $(CONFIG_CHIP_NAME) + @cd $(BL60X_SDK_PATH)/image_conf; ./flash_build $(PROJECT_NAME) $(CONFIG_CHIP_NAME) +endif +endif + @echo "Building Finish. To flash build output." + + +# If we have `version.txt` then prefer that for extracting BL60x_SP_SDK version +ifeq ("$(wildcard ${BL60X_SDK_PATH}/version.txt)","") +BL_SDK_VER := $(shell cd ${BL60X_SDK_PATH} && git describe --always --tags --dirty) +ifeq ("$(CONFIG_CHIP_NAME)", "BL602") +BL_SDK_PHY_VER := $(shell cd ${BL60X_SDK_PATH}/components/bl602/bl602_wifi/plf/refip/src/driver/phy/bl602_phy_rf/ && git describe --always --tags --dirty) +BL_SDK_RF_VER := $(shell cd ${BL60X_SDK_PATH}/components/bl602/bl602_wifi/plf/refip/src/driver/phy/bl602_phy_rf/rf && git describe --always --tags --dirty) +endif +$(info use git describe to generate version.txt) +else +BL_SDK_VER := `cat ${BL60X_SDK_PATH}/version.txt |head -n1` +ifeq ("$(CONFIG_CHIP_NAME)", "BL602") +BL_SDK_PHY_VER := `cat ${BL60X_SDK_PATH}/version.txt |head -n2|tail -n1` +BL_SDK_RF_VER := `cat ${BL60X_SDK_PATH}/version.txt |head -n3|tail -n1` +endif +$(info use exsting version.txt file) +endif +BL_CHIP_NAME := ${CONFIG_CHIP_NAME} + +# Set default LDFLAGS +# -nostdlib +# --specs=nosys.specs +EXTRA_LDFLAGS ?= -Wl,--cref -nostartfiles +ifeq ($(CONFIG_ZIGBEE), 1) +EXTRA_LDFLAGS += --specs=nosys.specs +endif + +E21_CPU_LDFLAGS := -march=rv32imfc \ + -mabi=ilp32f + +LDFLAGS ?= $(E21_CPU_LDFLAGS) \ + $(EXTRA_LDFLAGS) \ + -Wl,--gc-sections \ + -Wl,-static \ + -Wl,--start-group \ + $(COMPONENT_LDFLAGS) \ + -Wl,--end-group \ + -Wl,-EL \ + -lm + +# Set default CPPFLAGS, CFLAGS, CXXFLAGS +# These are exported so that components can use them when compiling. +# If you need your component to add CFLAGS/etc for it's own source compilation only, set CFLAGS += in your component's Makefile. +# If you need your component to add CFLAGS/etc globally for all source +# files, set CFLAGS += in your component's Makefile.projbuild +# If you need to set CFLAGS/CPPFLAGS/CXXFLAGS at project level, set them in application Makefile +# before including project.mk. Default flags will be added before the ones provided in application Makefile. + +# CPPFLAGS used by C preprocessor +# If any flags are defined in application Makefile, add them at the end. +CPPFLAGS ?= +ifeq ($(CONFIG_ENABLE_ACP),1) +CPPFLAGS += -DCONF_USER_ENABLE_ACP +endif +ifeq ($(CONFIG_ENABLE_CAMERA),1) +CPPFLAGS += -DCONF_USER_ENABLE_CAMERA +endif +ifeq ($(CONFIG_ENABLE_PSM_RAM),1) +CPPFLAGS += -DCONF_USER_ENABLE_PSRAM +endif +EXTRA_CPPFLAGS ?= +CPPFLAGS := -D BL_SDK_VER=\"$(BL_SDK_VER)\" +CPPFLAGS += -D BL_SDK_PHY_VER=\"$(BL_SDK_PHY_VER)\" +CPPFLAGS += -D BL_SDK_RF_VER=\"$(BL_SDK_RF_VER)\" +CPPFLAGS += -D BL_CHIP_NAME=\"$(BL_CHIP_NAME)\" -MMD -MP $(CPPFLAGS) $(EXTRA_CPPFLAGS) +CPPFLAGS += -DARCH_RISCV + +# Warnings-related flags relevant both for C and C++ +COMMON_WARNING_FLAGS = -Wall \ + -Wno-error=unused-function \ + -Wno-error=unused-but-set-variable \ + -Wno-error=unused-variable \ + -Wno-error=deprecated-declarations \ + -Wextra \ + -Wno-unused-parameter -Wno-sign-compare + +ifdef CONFIG_WARN_WRITE_STRINGS +COMMON_WARNING_FLAGS += -Wwrite-strings +endif #CONFIG_WARN_WRITE_STRINGS + +ifdef CONFIG_ENABLE_PSM_RAM +COMMON_WARNING_FLAGS += -DCONF_USER_ENABLE_PSRAM +endif + +# Flags which control code generation and dependency generation, both for C and C++ +# -nostdlib +# -fno-common +# -funwind-tables +COMMON_FLAGS = \ + -ffunction-sections -fdata-sections \ + -fstrict-volatile-bitfields \ + -fshort-enums + + +COMMON_FLAGS_M4_EXT := \ + -ffreestanding \ + -fno-strict-aliasing + + +COMMON_FLAGS += $(COMMON_FLAGS_M4_EXT) + +ifdef CONFIG_STACK_CHECK_NORM +COMMON_FLAGS += -fstack-protector +endif +ifdef CONFIG_STACK_CHECK_STRONG +COMMON_FLAGS += -fstack-protector-strong +endif +ifdef CONFIG_STACK_CHECK_ALL +COMMON_FLAGS += -fstack-protector-all +endif +ifeq ($(CONFIG_ENABLE_FP),1) +COMMON_FLAGS += -fno-omit-frame-pointer -DCONF_ENABLE_FRAME_PTR +endif + +ifdef CONFIG_OPTIMIZATION_LEVEL_RELEASE +OPTIMIZATION_FLAGS = -Os +else +OPTIMIZATION_FLAGS = -Os +endif + +ifdef CONFIG_OPTIMIZATION_ASSERTIONS_DISABLED +CPPFLAGS += -DNDEBUG +endif + +# Enable generation of debugging symbols +# (we generate even in Release mode, as this has no impact on final binary size.) +DEBUG_FLAGS ?= -gdwarf + +# List of flags to pass to C compiler +# If any flags are defined in application Makefile, add them at the end. +EXTRA_CFLAGS ?= + +E21_CPU_CFLAGS := -march=rv32imfc \ + -mabi=ilp32f + +ASMFLAGS := $(E21_CPU_CFLAGS) + +CFLAGS := $(strip \ + -std=gnu99 \ + $(OPTIMIZATION_FLAGS) $(DEBUG_FLAGS) \ + $(COMMON_FLAGS) \ + $(COMMON_WARNING_FLAGS) -Wno-old-style-declaration \ + $(CFLAGS) \ + $(E21_CPU_CFLAGS) \ + $(EXTRA_CFLAGS)) \ + -save-temps=obj + +CXXFLAGS := $(strip \ + -std=c++11 \ + $(OPTIMIZATION_FLAGS) $(DEBUG_FLAGS) \ + $(COMMON_FLAGS) \ + $(COMMON_WARNING_FLAGS) \ + $(CXXFLAGS) \ + $(E21_CPU_CFLAGS) \ + -nostdlib \ + -g3 \ + -fms-extensions \ + -ffunction-sections \ + -fdata-sections \ + -Wall \ + -Wchar-subscripts \ + -Wformat \ + -Winit-self \ + -Wignored-qualifiers \ + -Wswitch-default \ + -Wunused \ + -Wundef \ + -fno-rtti -fno-exceptions \ + -save-temps=obj \ + ) + +export CFLAGS CPPFLAGS CXXFLAGS ASMFLAGS + +# Set default values that were not previously defined +CC ?= gcc +LD ?= ld +AR ?= ar +OBJCOPY ?= objcopy +SIZE ?= size +STRIP ?= strip + +# Set host compiler and binutils +HOSTCC := $(CC) +HOSTLD := $(LD) +HOSTAR := $(AR) +HOSTOBJCOPY := $(OBJCOPY) +HOSTSIZE := $(SIZE) +export HOSTCC HOSTLD HOSTAR HOSTOBJCOPY SIZE + +ifndef CONFIG_TOOLPREFIX +$(error Please Configure CONFIG_TOOLPREFIX at toolchain.mk) +endif + +# Set target compiler. Defaults to whatever the user has +# configured as prefix + ye olde gcc commands +CC := $(call dequote,$(CONFIG_TOOLPREFIX))gcc +CXX := $(call dequote,$(CONFIG_TOOLPREFIX))g++ +LD := $(call dequote,$(CONFIG_TOOLPREFIX))ld +AR := $(call dequote,$(CONFIG_TOOLPREFIX))ar +OBJCOPY := $(call dequote,$(CONFIG_TOOLPREFIX))objcopy +SIZE := $(call dequote,$(CONFIG_TOOLPREFIX))size +STRIP := $(call dequote,$(CONFIG_TOOLPREFIX))strip +export CC CXX LD AR OBJCOPY SIZE + +PYTHON=$(call dequote,$(CONFIG_PYTHON)) + +# the app is the main executable built by the project +APP_ELF:=$(BUILD_DIR_BASE)/$(PROJECT_NAME).elf +APP_MAP:=$(APP_ELF:.elf=.map) +APP_BIN:=$(APP_ELF:.elf=.bin) + +# Include any Makefile.projbuild file letting components add +# configuration at the project level +define includeProjBuildMakefile +$(if $(V),$$(info including $(1)/Makefile.projbuild...)) +COMPONENT_PATH := $(1) +include $(1)/Makefile.projbuild +endef +$(foreach componentpath,$(COMPONENT_PATHS), \ + $(if $(wildcard $(componentpath)/Makefile.projbuild), \ + $(eval $(call includeProjBuildMakefile,$(componentpath))))) + +# ELF depends on the library archive files for COMPONENT_LIBRARIES +# the rules to build these are emitted as part of GenerateComponentTarget below +# +# also depends on additional dependencies (linker scripts & binary libraries) +# stored in COMPONENT_LINKER_DEPS, built via bouffalo.mk files' COMPONENT_ADD_LINKER_DEPS variable +COMPONENT_LINKER_DEPS ?= +$(APP_ELF): $(foreach libcomp,$(COMPONENT_LIBRARIES),$(BUILD_DIR_BASE)/$(libcomp)/lib$(libcomp).a) $(COMPONENT_LINKER_DEPS) $(COMPONENT_PROJECT_VARS) + $(summary) LD $(patsubst $(PWD)/%,%,$@) +ifeq ($(CONFIG_ZIGBEE), 1) + $(CXX) -o $@ $(LDFLAGS) -Wl,-Map=$(APP_MAP) +else + $(CC) $(LDFLAGS) -o $@ -Wl,-Map=$(APP_MAP) +endif + +all_binaries: $(APP_BIN) + +## TODO move to bl60x_elftool component +$(APP_BIN): $(APP_ELF) + @echo "Generating BIN File to $@" +ifeq ($(CONFIG_ENABLE_ACP),1) + $(OBJCOPY) -S -O binary -R .rom.cpu1 $< $(@:.bin=.cpu0.bin) + $(OBJCOPY) -S -O binary -j .rom.cpu1 $< $(@:.bin=.cpu1.bin) + cp $(@:.bin=.cpu0.bin) $(@:.bin=.acp.bin) + dd if=$(@:.bin=.cpu1.bin) of=$(@:.bin=.acp.bin) bs=512 seek=2 conv=notrunc + cp $(@:.bin=.acp.bin) $@ +else +ifeq ($(CONFIG_LINK_ROM),1) + $(OBJCOPY) -S -O binary -R .romdata -R .rom $< $@ + $(OBJCOPY) -S -O binary -j .rom $< $(@:.bin=.rom.bin) + $(OBJCOPY) -S -O binary -j .romdata $< $(@:.bin=.romdata.bin) + $(OBJCOPY) -S -O binary -R .romdata -R .rom $< $(@:.bin=.flash.bin) +else +ifeq ($(CONFIG_GEN_ROM),1) + $(OBJCOPY) -S -O binary -R .bleromro -R .bleromrw -R .rtosromro -R .rtosromrw $< $@ + $(OBJCOPY) -S -O binary -j .bleromro $< $(@:.bin=.bleromro.bin) + $(OBJCOPY) -S -O binary -j .bleromrw $< $(@:.bin=.bleromrw.bin) + $(OBJCOPY) -S -O binary -j .rtosromro $< $(@:.bin=.rtosromro.bin) + $(OBJCOPY) -S -O binary -j .rtosromrw $< $(@:.bin=.rtosromrw.bin) + $(OBJCOPY) -S -O binary -R .bleromro -R .bleromrw -R .rtosromro -R .rtosromrw $< $(@:.bin=.flash.bin) +else + $(OBJCOPY) -S -O binary $< $@ +endif +endif +endif + + +$(BUILD_DIR_BASE): + mkdir -p $(BUILD_DIR_BASE) + +# Macro for the recursive sub-make for each component +# $(1) - component directory +# $(2) - component name only +# +# Is recursively expanded by the GenerateComponentTargets macro +define ComponentMake ++$(MAKE) -C $(BUILD_DIR_BASE)/$(2) -f $(BL60X_SDK_PATH)/make_scripts_riscv/component_wrapper.mk COMPONENT_MAKEFILE=$(1)/bouffalo.mk COMPONENT_NAME=$(2) +endef + +# Generate top-level component-specific targets for each component +# $(1) - path to component dir +# $(2) - name of component +# +define GenerateComponentTargets +.PHONY: component-$(2)-build component-$(2)-clean + +component-$(2)-build: $(call prereq_if_explicit, component-$(2)-clean) | $(BUILD_DIR_BASE)/$(2) + $(call ComponentMake,$(1),$(2)) build + +component-$(2)-clean: | $(BUILD_DIR_BASE)/$(2) $(BUILD_DIR_BASE)/$(2)/component_project_vars.mk + $(call ComponentMake,$(1),$(2)) clean + +$(BUILD_DIR_BASE)/$(2): + @mkdir -p $(BUILD_DIR_BASE)/$(2) + +# tell make it can build any component's library by invoking the -build target +# (this target exists for all components even ones which don't build libraries, but it's +# only invoked for the targets whose libraries appear in COMPONENT_LIBRARIES and hence the +# APP_ELF dependencies.) +$(BUILD_DIR_BASE)/$(2)/lib$(2).a: component-$(2)-build + $(details) "Target '$$^' responsible for '$$@'" # echo which build target built this file + +# add a target to generate the component_project_vars.mk files that +# are used to inject variables into project make pass (see matching +# component_project_vars.mk target in component_wrapper.mk). +# +# If any component_project_vars.mk file is out of date, the make +# process will call this target to rebuild it and then restart. +# +$(BUILD_DIR_BASE)/$(2)/component_project_vars.mk: $(1)/bouffalo.mk $(COMMON_MAKEFILES) $(SDKCONFIG_MAKEFILE) | $(BUILD_DIR_BASE)/$(2) + $(call ComponentMake,$(1),$(2)) component_project_vars.mk +endef + +define GenerateComponentNameTargets +$(1):$(BUILD_DIR_BASE)/$(1)/lib$(1).a + $(details) "Target '$$^' responsible for '$$@'" +endef + +$(foreach component,$(COMPONENT_PATHS),$(eval $(call GenerateComponentTargets,$(component),$(notdir $(component))))) +$(foreach component,$(COMPONENT_PATHS),$(eval $(call GenerateComponentNameTargets,$(notdir $(component))))) + +app-clean: $(addprefix component-,$(addsuffix -clean,$(notdir $(COMPONENT_PATHS)))) + $(summary) RM $(APP_ELF) + rm -f $(APP_ELF) $(APP_BIN) $(APP_MAP) + +flash: all + cd $(BL60X_SDK_PATH)/tools/flash_tool && env SDK_APP_BIN=$(APP_BIN) SDK_BOARD=$(PROJECT_BOARD) SDK_NAME=$(PROJECT_NAME) SDK_MEDIA_BIN=$(APP_MEDIA_BIN) SDK_ROMFS_DIR=$(APP_ROMFS_DIR) SDK_DTS=$(PROJECT_DTS) SDK_XTAL=$(PROJECT_BOARD_XTAL) BL_FLASH_TOOL_INPUT_PATH_cfg2_bin_input=$(APP_BIN) python3 core/bl60x_simple_flasher.py bl602 bl602/conf/iot.toml + +flash_only: + cd $(BL60X_SDK_PATH)/tools/flash_tool && env SDK_APP_BIN=$(APP_BIN) SDK_BOARD=$(PROJECT_BOARD) SDK_NAME=$(PROJECT_NAME) SDK_MEDIA_BIN=$(APP_MEDIA_BIN) SDK_ROMFS_DIR=$(APP_ROMFS_DIR) SDK_DTS=$(PROJECT_DTS) SDK_XTAL=$(PROJECT_BOARD_XTAL) BL_FLASH_TOOL_INPUT_PATH_cfg2_bin_input=$(APP_BIN) python3 core/bl60x_simple_flasher.py bl602 bl602/conf/iot.toml + +clean: app-clean + +# PHONY target to list components in the build and their paths +list-components: + $(info $(call dequote,$(SEPARATOR))) + $(info COMPONENT_DIRS (components searched for here)) + $(foreach cd,$(COMPONENT_DIRS),$(info $(cd))) + $(info $(call dequote,$(SEPARATOR))) + $(info COMPONENTS (list of component names)) + $(info $(COMPONENTS)) + $(info $(call dequote,$(SEPARATOR))) + $(info EXCLUDE_COMPONENTS (list of excluded names)) + $(info $(if $(EXCLUDE_COMPONENTS),$(EXCLUDE_COMPONENTS),(none provided))) + $(info $(call dequote,$(SEPARATOR))) + $(info COMPONENT_PATHS (paths to all components):) + $(foreach cp,$(COMPONENT_PATHS),$(info $(cp))) + +local-ci-test: + ../../tools/ci/scripts/local-ci-test.sh diff --git a/make_scripts_riscv/project.mk b/make_scripts_riscv/project.mk index cbd59c68..5b0cae5c 100644 --- a/make_scripts_riscv/project.mk +++ b/make_scripts_riscv/project.mk @@ -129,7 +129,7 @@ include_path += $(filter %/$(1), $(COMPONENTS_REAL_PATH)) endef $(foreach comp,$(INCLUDE_COMPONENTS),$(eval $(call include_comps_add,$(comp)))) INCLUDE_COMPONENTS_REAL_PATH := $(include_path) -# include components +# include components COMPONENTS := $(filter $(INCLUDE_COMPONENTS), $(COMPONENTS)) COMPONENTS_REAL_PATH := $(filter $(INCLUDE_COMPONENTS_REAL_PATH), $(COMPONENTS_REAL_PATH)) endif @@ -214,7 +214,7 @@ BL_CHIP_NAME := ${CONFIG_CHIP_NAME} # Set default LDFLAGS # -nostdlib -# --specs=nosys.specs +# --specs=nosys.specs EXTRA_LDFLAGS ?= -Wl,--cref -nostartfiles ifeq ($(CONFIG_ZIGBEE), 1) EXTRA_LDFLAGS += --specs=nosys.specs @@ -242,7 +242,7 @@ LDFLAGS ?= $(E21_CPU_LDFLAGS) \ # before including project.mk. Default flags will be added before the ones provided in application Makefile. # CPPFLAGS used by C preprocessor -# If any flags are defined in application Makefile, add them at the end. +# If any flags are defined in application Makefile, add them at the end. CPPFLAGS ?= ifeq ($(CONFIG_ENABLE_ACP),1) CPPFLAGS += -DCONF_USER_ENABLE_ACP @@ -261,7 +261,7 @@ CPPFLAGS += -D BL_CHIP_NAME=\"$(BL_CHIP_NAME)\" -MMD -MP $(CPPFLAGS) $(EXTRA_CPP CPPFLAGS += -DARCH_RISCV # Warnings-related flags relevant both for C and C++ -COMMON_WARNING_FLAGS = -Wall \ +COMMON_WARNING_FLAGS = -Wall -Werror=all \ -Wno-error=unused-function \ -Wno-error=unused-but-set-variable \ -Wno-error=unused-variable \ @@ -291,7 +291,7 @@ COMMON_FLAGS_M4_EXT := \ -ffreestanding \ -fno-strict-aliasing - + COMMON_FLAGS += $(COMMON_FLAGS_M4_EXT) ifdef CONFIG_STACK_CHECK_NORM @@ -341,11 +341,8 @@ CFLAGS := $(strip \ -save-temps=obj CXXFLAGS := $(strip \ - -std=c++11 \ - $(OPTIMIZATION_FLAGS) $(DEBUG_FLAGS) \ - $(COMMON_FLAGS) \ - $(COMMON_WARNING_FLAGS) \ - $(CXXFLAGS) \ + $(CPPFLAGS) \ + $(OPTIMIZATION_FLAGS) \ $(E21_CPU_CFLAGS) \ -nostdlib \ -g3 \ @@ -360,9 +357,7 @@ CXXFLAGS := $(strip \ -Wswitch-default \ -Wunused \ -Wundef \ - -fno-rtti -fno-exceptions \ - -save-temps=obj \ - ) + -fno-rtti -fno-exceptions) export CFLAGS CPPFLAGS CXXFLAGS ASMFLAGS @@ -435,7 +430,7 @@ all_binaries: $(APP_BIN) $(APP_BIN): $(APP_ELF) @echo "Generating BIN File to $@" ifeq ($(CONFIG_ENABLE_ACP),1) - $(OBJCOPY) -S -O binary -R .rom.cpu1 $< $(@:.bin=.cpu0.bin) + $(OBJCOPY) -S -O binary -R .rom.cpu1 $< $(@:.bin=.cpu0.bin) $(OBJCOPY) -S -O binary -j .rom.cpu1 $< $(@:.bin=.cpu1.bin) cp $(@:.bin=.cpu0.bin) $(@:.bin=.acp.bin) dd if=$(@:.bin=.cpu1.bin) of=$(@:.bin=.acp.bin) bs=512 seek=2 conv=notrunc @@ -443,23 +438,23 @@ ifeq ($(CONFIG_ENABLE_ACP),1) else ifeq ($(CONFIG_LINK_ROM),1) $(OBJCOPY) -S -O binary -R .romdata -R .rom $< $@ - $(OBJCOPY) -S -O binary -j .rom $< $(@:.bin=.rom.bin) - $(OBJCOPY) -S -O binary -j .romdata $< $(@:.bin=.romdata.bin) - $(OBJCOPY) -S -O binary -R .romdata -R .rom $< $(@:.bin=.flash.bin) + $(OBJCOPY) -S -O binary -j .rom $< $(@:.bin=.rom.bin) + $(OBJCOPY) -S -O binary -j .romdata $< $(@:.bin=.romdata.bin) + $(OBJCOPY) -S -O binary -R .romdata -R .rom $< $(@:.bin=.flash.bin) else ifeq ($(CONFIG_GEN_ROM),1) $(OBJCOPY) -S -O binary -R .bleromro -R .bleromrw -R .rtosromro -R .rtosromrw $< $@ - $(OBJCOPY) -S -O binary -j .bleromro $< $(@:.bin=.bleromro.bin) - $(OBJCOPY) -S -O binary -j .bleromrw $< $(@:.bin=.bleromrw.bin) - $(OBJCOPY) -S -O binary -j .rtosromro $< $(@:.bin=.rtosromro.bin) - $(OBJCOPY) -S -O binary -j .rtosromrw $< $(@:.bin=.rtosromrw.bin) - $(OBJCOPY) -S -O binary -R .bleromro -R .bleromrw -R .rtosromro -R .rtosromrw $< $(@:.bin=.flash.bin) + $(OBJCOPY) -S -O binary -j .bleromro $< $(@:.bin=.bleromro.bin) + $(OBJCOPY) -S -O binary -j .bleromrw $< $(@:.bin=.bleromrw.bin) + $(OBJCOPY) -S -O binary -j .rtosromro $< $(@:.bin=.rtosromro.bin) + $(OBJCOPY) -S -O binary -j .rtosromrw $< $(@:.bin=.rtosromrw.bin) + $(OBJCOPY) -S -O binary -R .bleromro -R .bleromrw -R .rtosromro -R .rtosromrw $< $(@:.bin=.flash.bin) else $(OBJCOPY) -S -O binary $< $@ endif endif endif - + $(BUILD_DIR_BASE): mkdir -p $(BUILD_DIR_BASE) @@ -537,10 +532,10 @@ list-components: $(info $(COMPONENTS)) $(info $(call dequote,$(SEPARATOR))) $(info EXCLUDE_COMPONENTS (list of excluded names)) - $(info $(if $(EXCLUDE_COMPONENTS),$(EXCLUDE_COMPONENTS),(none provided))) + $(info $(if $(EXCLUDE_COMPONENTS),$(EXCLUDE_COMPONENTS),(none provided))) $(info $(call dequote,$(SEPARATOR))) $(info COMPONENT_PATHS (paths to all components):) $(foreach cp,$(COMPONENT_PATHS),$(info $(cp))) local-ci-test: - ../../tools/ci/scripts/local-ci-test.sh + ../../tools/ci/scripts/local-ci-test.sh \ No newline at end of file From 1e0e36fd9806e04da614a1bfd5226c24942bcfa2 Mon Sep 17 00:00:00 2001 From: shchen Date: Tue, 2 Feb 2021 17:13:00 +0800 Subject: [PATCH 3/4] fix project.mk --- make_scripts_riscv/project.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/make_scripts_riscv/project.mk b/make_scripts_riscv/project.mk index 5b0cae5c..cebbb9d3 100644 --- a/make_scripts_riscv/project.mk +++ b/make_scripts_riscv/project.mk @@ -538,4 +538,4 @@ list-components: $(foreach cp,$(COMPONENT_PATHS),$(info $(cp))) local-ci-test: - ../../tools/ci/scripts/local-ci-test.sh \ No newline at end of file + ../../tools/ci/scripts/local-ci-test.sh From a0bb1717d69665f556dadf4db0c631824f2c4899 Mon Sep 17 00:00:00 2001 From: shchen Date: Tue, 2 Feb 2021 17:21:24 +0800 Subject: [PATCH 4/4] fix makefile --- make_scripts_riscv/project.mk | 41 ++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/make_scripts_riscv/project.mk b/make_scripts_riscv/project.mk index cebbb9d3..2df88bbe 100644 --- a/make_scripts_riscv/project.mk +++ b/make_scripts_riscv/project.mk @@ -129,7 +129,7 @@ include_path += $(filter %/$(1), $(COMPONENTS_REAL_PATH)) endef $(foreach comp,$(INCLUDE_COMPONENTS),$(eval $(call include_comps_add,$(comp)))) INCLUDE_COMPONENTS_REAL_PATH := $(include_path) -# include components +# include components COMPONENTS := $(filter $(INCLUDE_COMPONENTS), $(COMPONENTS)) COMPONENTS_REAL_PATH := $(filter $(INCLUDE_COMPONENTS_REAL_PATH), $(COMPONENTS_REAL_PATH)) endif @@ -214,7 +214,7 @@ BL_CHIP_NAME := ${CONFIG_CHIP_NAME} # Set default LDFLAGS # -nostdlib -# --specs=nosys.specs +# --specs=nosys.specs EXTRA_LDFLAGS ?= -Wl,--cref -nostartfiles ifeq ($(CONFIG_ZIGBEE), 1) EXTRA_LDFLAGS += --specs=nosys.specs @@ -242,7 +242,7 @@ LDFLAGS ?= $(E21_CPU_LDFLAGS) \ # before including project.mk. Default flags will be added before the ones provided in application Makefile. # CPPFLAGS used by C preprocessor -# If any flags are defined in application Makefile, add them at the end. +# If any flags are defined in application Makefile, add them at the end. CPPFLAGS ?= ifeq ($(CONFIG_ENABLE_ACP),1) CPPFLAGS += -DCONF_USER_ENABLE_ACP @@ -291,7 +291,7 @@ COMMON_FLAGS_M4_EXT := \ -ffreestanding \ -fno-strict-aliasing - + COMMON_FLAGS += $(COMMON_FLAGS_M4_EXT) ifdef CONFIG_STACK_CHECK_NORM @@ -341,8 +341,11 @@ CFLAGS := $(strip \ -save-temps=obj CXXFLAGS := $(strip \ - $(CPPFLAGS) \ - $(OPTIMIZATION_FLAGS) \ + -std=c++11 \ + $(OPTIMIZATION_FLAGS) $(DEBUG_FLAGS) \ + $(COMMON_FLAGS) \ + $(COMMON_WARNING_FLAGS) \ + $(CXXFLAGS) \ $(E21_CPU_CFLAGS) \ -nostdlib \ -g3 \ @@ -357,7 +360,9 @@ CXXFLAGS := $(strip \ -Wswitch-default \ -Wunused \ -Wundef \ - -fno-rtti -fno-exceptions) + -fno-rtti -fno-exceptions \ + -save-temps=obj \ + ) export CFLAGS CPPFLAGS CXXFLAGS ASMFLAGS @@ -430,7 +435,7 @@ all_binaries: $(APP_BIN) $(APP_BIN): $(APP_ELF) @echo "Generating BIN File to $@" ifeq ($(CONFIG_ENABLE_ACP),1) - $(OBJCOPY) -S -O binary -R .rom.cpu1 $< $(@:.bin=.cpu0.bin) + $(OBJCOPY) -S -O binary -R .rom.cpu1 $< $(@:.bin=.cpu0.bin) $(OBJCOPY) -S -O binary -j .rom.cpu1 $< $(@:.bin=.cpu1.bin) cp $(@:.bin=.cpu0.bin) $(@:.bin=.acp.bin) dd if=$(@:.bin=.cpu1.bin) of=$(@:.bin=.acp.bin) bs=512 seek=2 conv=notrunc @@ -438,23 +443,23 @@ ifeq ($(CONFIG_ENABLE_ACP),1) else ifeq ($(CONFIG_LINK_ROM),1) $(OBJCOPY) -S -O binary -R .romdata -R .rom $< $@ - $(OBJCOPY) -S -O binary -j .rom $< $(@:.bin=.rom.bin) - $(OBJCOPY) -S -O binary -j .romdata $< $(@:.bin=.romdata.bin) - $(OBJCOPY) -S -O binary -R .romdata -R .rom $< $(@:.bin=.flash.bin) + $(OBJCOPY) -S -O binary -j .rom $< $(@:.bin=.rom.bin) + $(OBJCOPY) -S -O binary -j .romdata $< $(@:.bin=.romdata.bin) + $(OBJCOPY) -S -O binary -R .romdata -R .rom $< $(@:.bin=.flash.bin) else ifeq ($(CONFIG_GEN_ROM),1) $(OBJCOPY) -S -O binary -R .bleromro -R .bleromrw -R .rtosromro -R .rtosromrw $< $@ - $(OBJCOPY) -S -O binary -j .bleromro $< $(@:.bin=.bleromro.bin) - $(OBJCOPY) -S -O binary -j .bleromrw $< $(@:.bin=.bleromrw.bin) - $(OBJCOPY) -S -O binary -j .rtosromro $< $(@:.bin=.rtosromro.bin) - $(OBJCOPY) -S -O binary -j .rtosromrw $< $(@:.bin=.rtosromrw.bin) - $(OBJCOPY) -S -O binary -R .bleromro -R .bleromrw -R .rtosromro -R .rtosromrw $< $(@:.bin=.flash.bin) + $(OBJCOPY) -S -O binary -j .bleromro $< $(@:.bin=.bleromro.bin) + $(OBJCOPY) -S -O binary -j .bleromrw $< $(@:.bin=.bleromrw.bin) + $(OBJCOPY) -S -O binary -j .rtosromro $< $(@:.bin=.rtosromro.bin) + $(OBJCOPY) -S -O binary -j .rtosromrw $< $(@:.bin=.rtosromrw.bin) + $(OBJCOPY) -S -O binary -R .bleromro -R .bleromrw -R .rtosromro -R .rtosromrw $< $(@:.bin=.flash.bin) else $(OBJCOPY) -S -O binary $< $@ endif endif endif - + $(BUILD_DIR_BASE): mkdir -p $(BUILD_DIR_BASE) @@ -532,7 +537,7 @@ list-components: $(info $(COMPONENTS)) $(info $(call dequote,$(SEPARATOR))) $(info EXCLUDE_COMPONENTS (list of excluded names)) - $(info $(if $(EXCLUDE_COMPONENTS),$(EXCLUDE_COMPONENTS),(none provided))) + $(info $(if $(EXCLUDE_COMPONENTS),$(EXCLUDE_COMPONENTS),(none provided))) $(info $(call dequote,$(SEPARATOR))) $(info COMPONENT_PATHS (paths to all components):) $(foreach cp,$(COMPONENT_PATHS),$(info $(cp)))