diff --git a/make/defs-cpp.mk b/make/defs-cpp.mk index 5ea3075a..0f9e3435 100644 --- a/make/defs-cpp.mk +++ b/make/defs-cpp.mk @@ -24,6 +24,7 @@ endif TAGGED_TMPL_MAKEFILES = $(wildcard $(addsuffix .mk,$(foreach t,$(TAGGED_TMPL_DIRS),$(addprefix $(t)/,$(TAGGED_TMPL_TAGS))))) +# TODO: maybe push this whome MCU-specific stuff somewhere else ifneq ($(findstring st-nucleo-f103rb,$(TAGGED_TMPL_TAGS)),) TAGGED_TMPL_TAGS += cortex-m3 MCU_BOARD_MODEL ?= ST-NUCLEO-F103RB @@ -72,6 +73,8 @@ else ifneq ($(findstring st-disco-f769i,$(TAGGED_TMPL_TAGS)),) # modm:disco-f769ni (SIC), not disco-f769i. mbed does the same, despite the # fact that a board of this name doesn't exist. MODM_BSPS += modm:disco-f769ni +else + MCU_OPENOCD_CFG_NAME ?= openocd-$(MCU_BOARD_LC).cfg endif ifneq ($(findstring cortex-m,$(TAGGED_TMPL_TAGS)),) @@ -280,8 +283,8 @@ ifeq ($(TARGET_TRIPLET),arm-none-eabi) PROJECT_LDFLAGS += -nostartfiles # garbage collect unused input sections - PROJECT_LDFLAGS += -Xlinker --gc-sections - PROJECT_LDFLAGS += -Xlinker --print-gc-sections + PROJECT_LDFLAGS += -Xlinker --gc-sections + #PROJECT_LDFLAGS += -Xlinker --print-gc-sections # create map file PROJECT_LDFLAGS += -Wl,-Map,"$(EXE_MAP)" diff --git a/make/mcu-defs.mk b/make/mcu-defs.mk index 609938e1..32b63495 100644 --- a/make/mcu-defs.mk +++ b/make/mcu-defs.mk @@ -27,12 +27,11 @@ ifneq ($(TARGET_PRODUCT),) MCU_BOARD ?= $(TARGET_PRODUCT) MCU_BOARD_LC ?= $(TARGET_PRODUCT) else - MCU_BOARD_MODEL_LC ?= $(shell echo $(MCU_BOARD_MODEL) | tr '[A-Z]' '[a-z]') + MCU_BOARD_MODEL_LC ?= $(shell $(ECHO) $(MCU_BOARD_MODEL) | $(TR) '[A-Z]' '[a-z]') MCU_BOARD ?= $(MCU_BOARD_MODEL) - MCU_BOARD_LC ?= $(shell echo $(MCU_BOARD) | tr '[A-Z]' '[a-z]') + MCU_BOARD_LC ?= $(shell $(ECHO) $(MCU_BOARD) | $(TR) '[A-Z]' '[a-z]') endif -MCU_OPENOCD_CFG_NAME ?= openocd-$(MCU_BOARD_LC).cfg MCU_OPENOCD_CFG_DEFAULT_SEARCH_PATH ?= $(TOPDIR)/make MCU_OPENOCD_CFG_SEARCH_PATH ?= $(MCU_OPENOCD_CFG_DEFAULT_SEARCH_PATH) MCU_OPENOCD_CFG_FILE ?= $(info looking for $(MCU_OPENOCD_CFG_NAME) in $(MCU_OPENOCD_CFG_SEARCH_PATH)) $(call find_file,$(MCU_OPENOCD_CFG_NAME),$(MCU_OPENOCD_CFG_SEARCH_PATH))