mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-pkg
synced 2026-01-15 12:03:31 +01:00
defs-cpp.mk, mcu-defs.mk, mcu-tags.mk: Dissolve mcu-tags.mk into defs-cpp.mk
Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
58ab619f0b
commit
f09eb174ef
3 changed files with 60 additions and 65 deletions
|
|
@ -76,6 +76,66 @@ ifeq ($(USE_VERSION_MACROS),true)
|
||||||
BUILD_CPPFLAGS += -DVERSION=$(HEX_VERSION) -DVERSION_STR=\"$(VERSION)\"
|
BUILD_CPPFLAGS += -DVERSION=$(HEX_VERSION) -DVERSION_STR=\"$(VERSION)\"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifneq ($(findstring cortex-m3,$(TAGGED_TMPL_TAGS)),)
|
||||||
|
|
||||||
|
# -- set jw-build mcu choices
|
||||||
|
MCU_CPU ?= cortex-m3
|
||||||
|
|
||||||
|
# -- set flags
|
||||||
|
|
||||||
|
# don't wrap error message lines
|
||||||
|
#PROJECT_LDFLAGS += -fmessage-length=0
|
||||||
|
|
||||||
|
# don't know what kind of optimization that is
|
||||||
|
#PROJECT_LDFLAGS += -Og
|
||||||
|
|
||||||
|
# stick with what janware code tends to expect
|
||||||
|
PROJECT_LDFLAGS += -fsigned-char
|
||||||
|
|
||||||
|
# I have no clue which part would evaluate these names
|
||||||
|
PROJECT_LDFLAGS += -ffunction-sections
|
||||||
|
PROJECT_LDFLAGS += -fdata-sections
|
||||||
|
PROJECT_LDFLAGS += -ffreestanding
|
||||||
|
PROJECT_LDFLAGS += -fno-move-loop-invariants
|
||||||
|
|
||||||
|
# skip any automatic initialization
|
||||||
|
PROJECT_LDFLAGS += -nostartfiles
|
||||||
|
|
||||||
|
# garbage collect unused input sections
|
||||||
|
PROJECT_LDFLAGS += -Xlinker --gc-sections
|
||||||
|
|
||||||
|
# create map file
|
||||||
|
PROJECT_LDFLAGS += -Wl,-Map,"$(EXE_MAP)"
|
||||||
|
|
||||||
|
# use newlib-nano, provides symbols _write _close _fstat _isatty _lseek (at least)
|
||||||
|
# (TODO: No -Wl necessary?)
|
||||||
|
PROJECT_LDFLAGS += --specs=nano.specs
|
||||||
|
PROJECT_LDFLAGS += --specs=nosys.specs
|
||||||
|
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifneq ($(findstring gnu-mcu-eclipse,$(TAGGED_TMPL_TAGS)),)
|
||||||
|
LD_DEFINE_SYMBOLS += _sbrk
|
||||||
|
endif
|
||||||
|
|
||||||
|
# ----- build options based on product choices
|
||||||
|
|
||||||
|
ifneq ($(findstring $(MCU_CPU),cortex-m3),)
|
||||||
|
|
||||||
|
PROJECT_CPPFLAGS += -mcpu=cortex-m3 -mthumb
|
||||||
|
PROJECT_LDFLAGS += -mcpu=cortex-m3 -mthumb
|
||||||
|
|
||||||
|
endif
|
||||||
|
|
||||||
|
# ----- tagged templates
|
||||||
|
#MCU_LD_DIR = $(wildcard $(firstword $(call $(TAGGED_TMPL_DIRS),ld)))
|
||||||
|
#MCU_LD_DIR = $(firstword $(foreach tag,$(TAGGED_TMPL_TAGS),$(foreach repo,$(TOPDIR)/tmpl/tagged $(MODDIR)/tmpl/tagged,$(wildcard $(repo)/$(tag)/ld))))
|
||||||
|
#MCU_LD_DIR = $(firstword $(wildcard $(foreach tag,$(TAGGED_TMPL_TAGS),$(foreach repo,$(TOPDIR)/tmpl/tagged $(MODDIR)/tmpl/tagged,$(repo)/$(tag)/ld))))
|
||||||
|
MCU_LD_CHECK_DIRS = $(foreach tag,$(TAGGED_TMPL_TAGS),$(foreach repo,$(TOPDIR)/tmpl/tagged $(MODDIR)/tmpl/tagged,$(repo)/$(tag)/ld))
|
||||||
|
MCU_LD_DIRS = $(wildcard $(MCU_LD_CHECK_DIRS))
|
||||||
|
MCU_LD_DIR = $(firstword $(MCU_LD_DIRS))
|
||||||
|
|
||||||
|
PROJECT_LDFLAGS += -L$(MCU_LD_DIR) $(addprefix -T ,$(sort $(notdir $(wildcard $(MCU_LD_DIR)/*.ld))))
|
||||||
# ----- tool chain
|
# ----- tool chain
|
||||||
|
|
||||||
ifneq ($(TARGET_TRIPLET),$(HOST_TRIPLET)) # we're cross-compiling
|
ifneq ($(TARGET_TRIPLET),$(HOST_TRIPLET)) # we're cross-compiling
|
||||||
|
|
@ -123,7 +183,6 @@ endif
|
||||||
ifeq ($(TARGET_TRIPLET),arm-none-eabi)
|
ifeq ($(TARGET_TRIPLET),arm-none-eabi)
|
||||||
USE_DISABLE_COMPILER_OPTIMISATION_OPTS = false
|
USE_DISABLE_COMPILER_OPTIMISATION_OPTS = false
|
||||||
USE_EXCEPTIONS_IN_C = false
|
USE_EXCEPTIONS_IN_C = false
|
||||||
ARM_NONE_EABI_ALLFLAGS += -mcpu=cortex-m3 -mthumb
|
|
||||||
ARM_NONE_EABI_ALLFLAGS += -fno-exceptions
|
ARM_NONE_EABI_ALLFLAGS += -fno-exceptions
|
||||||
ARM_NONE_EABI_ALLFLAGS += -Os
|
ARM_NONE_EABI_ALLFLAGS += -Os
|
||||||
BUILD_LDFLAGS += $(ARM_NONE_EABI_ALLFLAGS)
|
BUILD_LDFLAGS += $(ARM_NONE_EABI_ALLFLAGS)
|
||||||
|
|
|
||||||
|
|
@ -6,8 +6,6 @@
|
||||||
# endif
|
# endif
|
||||||
#endef
|
#endef
|
||||||
|
|
||||||
include $(MODDIR)/make/mcu-tags.mk
|
|
||||||
|
|
||||||
ifneq ($(MAKECMDGOALS),clean)
|
ifneq ($(MAKECMDGOALS),clean)
|
||||||
ifeq ($(MCU_BOARD_MODEL),)
|
ifeq ($(MCU_BOARD_MODEL),)
|
||||||
$(error MCU_BOARD_MODEL not specified)
|
$(error MCU_BOARD_MODEL not specified)
|
||||||
|
|
|
||||||
|
|
@ -1,62 +0,0 @@
|
||||||
# ----- product specific part
|
|
||||||
|
|
||||||
ifneq ($(findstring cortex-m3,$(TAGGED_TMPL_TAGS)),)
|
|
||||||
|
|
||||||
# -- set jw-build mcu choices
|
|
||||||
MCU_CPU ?= cortex-m3
|
|
||||||
|
|
||||||
# -- set flags
|
|
||||||
|
|
||||||
# don't wrap error message lines
|
|
||||||
#PROJECT_LDFLAGS += -fmessage-length=0
|
|
||||||
|
|
||||||
# don't know what kind of optimization that is
|
|
||||||
#PROJECT_LDFLAGS += -Og
|
|
||||||
|
|
||||||
# stick with what janware code tends to expect
|
|
||||||
PROJECT_LDFLAGS += -fsigned-char
|
|
||||||
|
|
||||||
# I have no clue which part would evaluate these names
|
|
||||||
PROJECT_LDFLAGS += -ffunction-sections
|
|
||||||
PROJECT_LDFLAGS += -fdata-sections
|
|
||||||
PROJECT_LDFLAGS += -ffreestanding
|
|
||||||
PROJECT_LDFLAGS += -fno-move-loop-invariants
|
|
||||||
|
|
||||||
# skip any automatic initialization
|
|
||||||
PROJECT_LDFLAGS += -nostartfiles
|
|
||||||
|
|
||||||
# garbage collect unused input sections
|
|
||||||
PROJECT_LDFLAGS += -Xlinker --gc-sections
|
|
||||||
|
|
||||||
# create map file
|
|
||||||
PROJECT_LDFLAGS += -Wl,-Map,"$(EXE_MAP)"
|
|
||||||
|
|
||||||
# use newlib-nano, provides symbols _write _close _fstat _isatty _lseek (at least)
|
|
||||||
# (TODO: No -Wl necessary?)
|
|
||||||
PROJECT_LDFLAGS += --specs=nano.specs
|
|
||||||
PROJECT_LDFLAGS += --specs=nosys.specs
|
|
||||||
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifneq ($(findstring gnu-mcu-eclipse,$(TAGGED_TMPL_TAGS)),)
|
|
||||||
LD_DEFINE_SYMBOLS += _sbrk
|
|
||||||
endif
|
|
||||||
|
|
||||||
# ----- build options based on product choices
|
|
||||||
|
|
||||||
ifneq ($(findstring $(MCU_CPU),cortex-m3),)
|
|
||||||
|
|
||||||
PROJECT_LDFLAGS += -mcpu=cortex-m3
|
|
||||||
PROJECT_LDFLAGS += -mthumb
|
|
||||||
|
|
||||||
endif
|
|
||||||
|
|
||||||
# ----- tagged templates
|
|
||||||
#MCU_LD_DIR = $(wildcard $(firstword $(call $(TAGGED_TMPL_DIRS),ld)))
|
|
||||||
#MCU_LD_DIR = $(firstword $(foreach tag,$(TAGGED_TMPL_TAGS),$(foreach repo,$(TOPDIR)/tmpl/tagged $(MODDIR)/tmpl/tagged,$(wildcard $(repo)/$(tag)/ld))))
|
|
||||||
#MCU_LD_DIR = $(firstword $(wildcard $(foreach tag,$(TAGGED_TMPL_TAGS),$(foreach repo,$(TOPDIR)/tmpl/tagged $(MODDIR)/tmpl/tagged,$(repo)/$(tag)/ld))))
|
|
||||||
MCU_LD_CHECK_DIRS = $(foreach tag,$(TAGGED_TMPL_TAGS),$(foreach repo,$(TOPDIR)/tmpl/tagged $(MODDIR)/tmpl/tagged,$(repo)/$(tag)/ld))
|
|
||||||
MCU_LD_DIRS = $(wildcard $(MCU_LD_CHECK_DIRS))
|
|
||||||
MCU_LD_DIR = $(firstword $(MCU_LD_DIRS))
|
|
||||||
|
|
||||||
PROJECT_LDFLAGS += -L$(MCU_LD_DIR) $(addprefix -T ,$(sort $(notdir $(wildcard $(MCU_LD_DIR)/*.ld))))
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue