defs-cpp.mk, mcu-defs.mk: Do MCU_OPENOCD_CFG_NAME definition from one place

MCU_OPENOCD_CFG_NAME was defined in cfg-cpp.mk and mcu-defs.mk. Not sure which
is the best place, but have them compete is clearly the worst idea. This patch
puts them into defs-cpp.mk. A future patch should place the whole bunch
somewhere else, I guess.

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2019-03-30 10:17:19 +00:00
commit c6fa2f3807
2 changed files with 7 additions and 5 deletions

View file

@ -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)"

View file

@ -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))