mirror of https://github.com/ARMmbed/mbed-os.git
Generalize make exporters for all toolchains
parent
17e096b369
commit
00d2a45b91
|
@ -32,8 +32,10 @@ EXPORTERS = {
|
|||
'uvision4': uvision4.Uvision4,
|
||||
'uvision5': uvision5.Uvision5,
|
||||
'lpcxpresso': codered.CodeRed,
|
||||
'gcc_arm': makefile.GccArm,
|
||||
'make_gcc_arm': makefile.GccArm,
|
||||
'gcc_arm': makefile.GccArm_Exporter,
|
||||
'make_gcc_arm': makefile.GccArm_Exporter,
|
||||
'make_armc5': makefile.Armc5_Exporter,
|
||||
'make_iar': makefile.IAR_Exporter,
|
||||
'ds5_5': ds5_5.DS5_5,
|
||||
'iar': iar.IAREmbeddedWorkbench,
|
||||
'emblocks' : emblocks.IntermediateFile,
|
||||
|
|
|
@ -0,0 +1,135 @@
|
|||
# This file was automagically generated by mbed.org. For more information,
|
||||
# see http://mbed.org/handbook/Exporting-to-GCC-ARM-Embedded
|
||||
|
||||
###############################################################################
|
||||
# Boiler-plate
|
||||
|
||||
# cross-platform directory manipulation
|
||||
ifeq ($(shell echo $$OS),$$OS)
|
||||
MAKEDIR = if not exist "$(1)" mkdir "$(1)"
|
||||
RM = rmdir /S /Q "$(1)"
|
||||
else
|
||||
MAKEDIR = $(SHELL) -c "mkdir -p \"$(1)\""
|
||||
RM = $(SHELL) -c "rm -rf \"$(1)\""
|
||||
endif
|
||||
|
||||
# Move to the build directory
|
||||
ifeq (,$(filter .build,$(notdir $(CURDIR))))
|
||||
.SUFFIXES:
|
||||
OBJDIR := .build
|
||||
mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
|
||||
MAKETARGET = $(MAKE) --no-print-directory -C $(OBJDIR) -f $(mkfile_path) \
|
||||
SRCDIR=$(CURDIR) $(MAKECMDGOALS)
|
||||
.PHONY: $(OBJDIR) clean
|
||||
all:
|
||||
+@$(call MAKEDIR,$(OBJDIR))
|
||||
+@$(MAKETARGET)
|
||||
$(OBJDIR): all
|
||||
Makefile : ;
|
||||
% :: $(OBJDIR) ; :
|
||||
clean :
|
||||
$(call RM,$(OBJDIR))
|
||||
{% block target_clean -%}
|
||||
{% endblock %}
|
||||
else
|
||||
|
||||
# trick rules into thinking we are in the root, when we are in the bulid dir
|
||||
VPATH = {{vpath|join(" ")}}
|
||||
|
||||
# Boiler-plate
|
||||
###############################################################################
|
||||
# Project settings
|
||||
|
||||
PROJECT := {{name}}
|
||||
|
||||
{% for sym in symbols %}CC_SYMBOLS += -D{{sym}}
|
||||
{% endfor %}
|
||||
|
||||
# Project settings
|
||||
###############################################################################
|
||||
# Objects and Paths
|
||||
|
||||
{% for obj in to_be_compiled %}OBJECTS += {{obj}}
|
||||
{% endfor %}
|
||||
{% for obj in object_files %} SYS_OBJECTS += {{obj}}
|
||||
{% endfor %}
|
||||
{% for path in include_paths %}INCLUDE_PATHS += -I{{path}}
|
||||
{% endfor %}
|
||||
LIBRARY_PATHS :={% for p in library_paths %} -L{{p}} {% endfor %}
|
||||
LIBRARIES :={% for lib in libraries %} -l{{lib}} {% endfor %}
|
||||
LINKER_SCRIPT := {{linker_script}}
|
||||
{%- block additional_variables -%}{% endblock %}
|
||||
|
||||
# Objects and Paths
|
||||
###############################################################################
|
||||
# Tools and Flags
|
||||
|
||||
AS = {{asm_cmd}}
|
||||
CC = {{cc_cmd}}
|
||||
CPP = {{cppc_cmd}}
|
||||
LD = {{ld_cmd}}
|
||||
ELF2BIN = {{elf2bin_cmd}}
|
||||
{% if hex_files %}
|
||||
SREC_CAT = srec_cat
|
||||
{%- endif %}
|
||||
{%- block additional_executables -%}{%- endblock %}
|
||||
|
||||
LD_FLAGS :={%- block ld_flags -%} {{ld_flags|join(" ")}} {% endblock %}
|
||||
{% block sys_libs -%}{%- endblock %}
|
||||
|
||||
# Tools and Flags
|
||||
###############################################################################
|
||||
# Rules
|
||||
|
||||
.PHONY: all lst size
|
||||
|
||||
{% if hex_files -%}
|
||||
all: $(PROJECT).bin $(PROJECT)-combined.hex size
|
||||
{% else %}
|
||||
all: $(PROJECT).bin $(PROJECT).hex size
|
||||
{% endif %}
|
||||
|
||||
.asm.o:
|
||||
+@$(call MAKEDIR,$(dir $@))
|
||||
$(AS) -c $(CC_SYMBOLS) $(INCLUDE_PATHS) -o $@ $<
|
||||
.s.o:
|
||||
+@$(call MAKEDIR,$(dir $@))
|
||||
$(AS) -c $(CC_SYMBOLS) $(INCLUDE_PATHS) -o $@ $<
|
||||
.S.o:
|
||||
+@$(call MAKEDIR,$(dir $@))
|
||||
$(AS) -c $(CC_SYMBOLS) $(INCLUDE_PATHS) -o $@ $<
|
||||
|
||||
.c.o:
|
||||
+@$(call MAKEDIR,$(dir $@))
|
||||
$(CC) $(CC_SYMBOLS) $(INCLUDE_PATHS) -o $@ $<
|
||||
|
||||
.cpp.o:
|
||||
+@$(call MAKEDIR,$(dir $@))
|
||||
$(CPP) $(CC_SYMBOLS) $(INCLUDE_PATHS) -o $@ $<
|
||||
|
||||
{% block target_project_elf %}
|
||||
$(PROJECT).elf: $(OBJECTS) $(SYS_OBJECTS) $(LINKER_SCRIPT)
|
||||
$(LD) $(LD_FLAGS) {{link_script_option}} $(filter %{{link_script_ext}}, $^) $(LIBRARY_PATHS) --output $@ $(filter %.o, $^) $(LIBRARIES) $(LD_SYS_LIBS)
|
||||
{% endblock %}
|
||||
|
||||
$(PROJECT).bin: $(PROJECT).elf
|
||||
{%- block elf2bin -%}{%- endblock %}
|
||||
|
||||
$(PROJECT).hex: $(PROJECT).elf
|
||||
{%- block elf2hex -%}{%- endblock %}
|
||||
|
||||
{% if hex_files %}
|
||||
$(PROJECT)-combined.hex: $(PROJECT).hex
|
||||
$(SREC_CAT) {% for f in hex_files %}{{f}} {% endfor %} -intel $(PROJECT).hex -intel -o $(PROJECT)-combined.hex -intel --line-length=44
|
||||
{% endif %}
|
||||
# Rules
|
||||
###############################################################################
|
||||
# Dependencies
|
||||
|
||||
DEPS = $(OBJECTS:.o=.d) $(SYS_OBJECTS:.o=.d)
|
||||
-include $(DEPS)
|
||||
endif
|
||||
|
||||
# Dependencies
|
||||
###############################################################################
|
||||
|
|
@ -18,12 +18,11 @@ from os.path import splitext, basename, relpath, join, abspath, dirname,\
|
|||
exists
|
||||
from os import curdir, getcwd
|
||||
from tools.export.exporters import Exporter
|
||||
from tools.utils import NotSupportedException
|
||||
from jinja2.exceptions import TemplateNotFound
|
||||
|
||||
|
||||
class GccArm(Exporter):
|
||||
NAME = 'GccArm'
|
||||
TOOLCHAIN = 'GCC_ARM'
|
||||
class Makefile(Exporter):
|
||||
|
||||
TARGETS = [
|
||||
'LPC1768',
|
||||
|
@ -164,11 +163,17 @@ class GccArm(Exporter):
|
|||
'linker_script': self.resources.linker_script,
|
||||
'libraries': libraries,
|
||||
'symbols': self.toolchain.get_symbols(),
|
||||
'cpu_flags': self.toolchain.cpu,
|
||||
'hex_files': self.resources.hex_files,
|
||||
'vpath': (["../../.."]
|
||||
if basename(dirname(dirname(self.export_dir))) == "projectfiles"
|
||||
else [".."])
|
||||
else [".."]),
|
||||
'cc_cmd': " ".join(self.toolchain.cc),
|
||||
'cppc_cmd': " ".join(self.toolchain.cppc),
|
||||
'asm_cmd': " ".join(self.toolchain.asm),
|
||||
'ld_cmd': " ".join(self.toolchain.ld),
|
||||
'elf2bin_cmd': self.toolchain.elf2bin,
|
||||
'link_script_ext': self.toolchain.LINKER_EXT,
|
||||
'link_script_option': self.LINK_SCRIPT_OPTION,
|
||||
}
|
||||
|
||||
for key in ['include_paths', 'library_paths', 'linker_script', 'hex_files']:
|
||||
|
@ -178,8 +183,40 @@ class GccArm(Exporter):
|
|||
ctx[key] = ctx['vpath'][0] + "/" + ctx[key]
|
||||
if "../." not in ctx["include_paths"]:
|
||||
ctx["include_paths"] += ['../.']
|
||||
ctx["include_paths"] = list(set(ctx["include_paths"]))
|
||||
for key in ['include_paths', 'library_paths', 'hex_files', 'to_be_compiled', 'symbols']:
|
||||
ctx[key] = sorted(ctx[key])
|
||||
ctx.update(self.flags)
|
||||
try:
|
||||
self.gen_file('gcc_arm_%s.tmpl' % self.target.lower(), ctx, 'Makefile')
|
||||
except TemplateNotFound:
|
||||
self.gen_file('gcc_arm_common.tmpl', ctx, 'Makefile')
|
||||
|
||||
for templatefile in \
|
||||
['makefile/%s_%s.tmpl' % (self.NAME.lower(),
|
||||
self.target.lower())] + \
|
||||
['makefile/%s_%s.tmpl' % (self.NAME.lower(),
|
||||
label.lower()) for label
|
||||
in self.toolchain.target.extra_labels] +\
|
||||
['makefile/%s.tmpl' % self.NAME.lower()]:
|
||||
try:
|
||||
self.gen_file(templatefile, ctx, 'Makefile')
|
||||
break
|
||||
except TemplateNotFound:
|
||||
pass
|
||||
else:
|
||||
raise NotSupportedException("This make tool is in development")
|
||||
|
||||
|
||||
class GccArm_Exporter(Makefile):
|
||||
NAME = 'Make-GCC-ARM'
|
||||
TOOLCHAIN = "GCC_ARM"
|
||||
LINK_SCRIPT_OPTION = "-T"
|
||||
|
||||
|
||||
class Armc5_Exporter(Makefile):
|
||||
NAME = 'Make-ARMc5'
|
||||
TOOLCHAIN = "ARM"
|
||||
LINK_SCRIPT_OPTION = "--scatter"
|
||||
|
||||
|
||||
class IAR_Exporter(Makefile):
|
||||
NAME = 'Make-IAR'
|
||||
TOOLCHAIN = "IAR"
|
||||
LINK_SCRIPT_OPTION = "--config"
|
||||
|
|
|
@ -1,141 +0,0 @@
|
|||
# This file was automagically generated by mbed.org. For more information,
|
||||
# see http://mbed.org/handbook/Exporting-to-GCC-ARM-Embedded
|
||||
|
||||
# cross-platform directory manipulation
|
||||
ifeq ($(shell echo $$OS),$$OS)
|
||||
MAKEDIR = if not exist "$(1)" mkdir "$(1)"
|
||||
RM = rmdir /S /Q "$(1)"
|
||||
else
|
||||
MAKEDIR = $(SHELL) -c "mkdir -p \"$(1)\""
|
||||
RM = $(SHELL) -c "rm -rf \"$(1)\""
|
||||
endif
|
||||
|
||||
ifeq (,$(filter .build,$(notdir $(CURDIR))))
|
||||
.SUFFIXES:
|
||||
OBJDIR := .build
|
||||
mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
|
||||
MAKETARGET = $(MAKE) --no-print-directory -C $(OBJDIR) -f $(mkfile_path) \
|
||||
SRCDIR=$(CURDIR) $(MAKECMDGOALS)
|
||||
.PHONY: $(OBJDIR) clean
|
||||
all:
|
||||
+@$(call MAKEDIR,$(OBJDIR))
|
||||
+@$(MAKETARGET)
|
||||
$(OBJDIR): all
|
||||
Makefile : ;
|
||||
% :: $(OBJDIR) ; :
|
||||
clean :
|
||||
$(call RM,$(OBJDIR))
|
||||
{% block target_clean -%}
|
||||
{% endblock %}
|
||||
else
|
||||
|
||||
VPATH = {% for path in vpath %}{{path}} {% endfor %}
|
||||
|
||||
GCC_BIN =
|
||||
PROJECT = {{name}}
|
||||
OBJECTS = {% for f in to_be_compiled %}{{f}} {% endfor %}
|
||||
SYS_OBJECTS = {% for f in object_files %}{{f}} {% endfor %}
|
||||
INCLUDE_PATHS = {% for p in include_paths %}-I{{p}} {% endfor %}
|
||||
LIBRARY_PATHS = {% for p in library_paths %}-L{{p}} {% endfor %}
|
||||
LIBRARIES = {% for lib in libraries %}-l{{lib}} {% endfor %}
|
||||
LINKER_SCRIPT = {{linker_script}}
|
||||
{%- block additional_variables -%}{% endblock %}
|
||||
|
||||
###############################################################################
|
||||
AS = $(GCC_BIN)arm-none-eabi-as
|
||||
CC = $(GCC_BIN)arm-none-eabi-gcc
|
||||
CPP = $(GCC_BIN)arm-none-eabi-g++
|
||||
LD = $(GCC_BIN)arm-none-eabi-gcc
|
||||
OBJCOPY = $(GCC_BIN)arm-none-eabi-objcopy
|
||||
OBJDUMP = $(GCC_BIN)arm-none-eabi-objdump
|
||||
SIZE = $(GCC_BIN)arm-none-eabi-size
|
||||
{% if hex_files %}
|
||||
SREC_CAT = srec_cat
|
||||
{% endif %}
|
||||
{%- block additional_executables -%}{% endblock %}
|
||||
|
||||
{%- block flags -%}
|
||||
|
||||
{% block hardfp %}
|
||||
{% if "-mfloat-abi=softfp" in cpu_flags %}
|
||||
ifeq ($(HARDFP),1)
|
||||
FLOAT_ABI = hard
|
||||
else
|
||||
FLOAT_ABI = softfp
|
||||
endif
|
||||
{% endif %}
|
||||
{%- endblock %}
|
||||
|
||||
CPU = {% block cpu %}{% for cf in cpu_flags %}{{cf|replace("-mfloat-abi=softfp","-mfloat-abi=$(FLOAT_ABI)")}} {% endfor %}{% endblock %}
|
||||
CC_FLAGS = {% block cc_flags %}{{common_flags|join(" ")}} {{c_flags|join(" ")}} -MMD -MP{% endblock %}
|
||||
CPPC_FLAGS = {% block cppc_flags %}{{common_flags|join(" ")}} {{cxx_flags|join(" ")}} -MMD -MP{% endblock %}
|
||||
ASM_FLAGS = {% block asm_flags %}{{asm_flags|join(" ")}} {{common_flags|join(" ")}}{% endblock %}
|
||||
CC_SYMBOLS = {% block cc_symbols %}{% for s in symbols %}-D{{s}} {% endfor %}{% endblock %}
|
||||
|
||||
LD_FLAGS = {%- block ld_flags -%} {{ld_flags|join(" ")}} {% endblock %}
|
||||
LD_SYS_LIBS = {% block ld_sys_libs %}-lstdc++ -lsupc++ -lm -lc -lgcc -lnosys{% endblock %}
|
||||
{% endblock %}
|
||||
|
||||
ifeq ($(DEBUG), 1)
|
||||
CC_FLAGS += -DDEBUG -O0
|
||||
else
|
||||
CC_FLAGS += -DNDEBUG -Os
|
||||
endif
|
||||
|
||||
|
||||
.PHONY: all lst size
|
||||
|
||||
{% if hex_files -%}
|
||||
all: $(PROJECT).bin $(PROJECT)-combined.hex size
|
||||
{% else %}
|
||||
all: $(PROJECT).bin $(PROJECT).hex size
|
||||
{% endif %}
|
||||
|
||||
|
||||
.asm.o:
|
||||
+@$(call MAKEDIR,$(dir $@))
|
||||
$(CC) $(CPU) -c $(ASM_FLAGS) $(CC_SYMBOLS) $(INCLUDE_PATHS) -o $@ $<
|
||||
.s.o:
|
||||
+@$(call MAKEDIR,$(dir $@))
|
||||
$(CC) $(CPU) -c $(ASM_FLAGS) $(CC_SYMBOLS) $(INCLUDE_PATHS) -o $@ $<
|
||||
.S.o:
|
||||
+@$(call MAKEDIR,$(dir $@))
|
||||
$(CC) $(CPU) -c $(ASM_FLAGS) $(CC_SYMBOLS) $(INCLUDE_PATHS) -o $@ $<
|
||||
|
||||
.c.o:
|
||||
+@$(call MAKEDIR,$(dir $@))
|
||||
$(CC) $(CC_FLAGS) $(CC_SYMBOLS) $(INCLUDE_PATHS) -o $@ $<
|
||||
|
||||
.cpp.o:
|
||||
+@$(call MAKEDIR,$(dir $@))
|
||||
$(CPP) $(CPPC_FLAGS) $(CC_SYMBOLS) $(INCLUDE_PATHS) -o $@ $<
|
||||
|
||||
|
||||
{% block target_project_elf %}
|
||||
$(PROJECT).elf: $(OBJECTS) $(SYS_OBJECTS) $(LINKER_SCRIPT)
|
||||
$(LD) $(LD_FLAGS) -T$(filter %.ld, $^) $(LIBRARY_PATHS) -o $@ $(filter %.o, $^) -Wl,--start-group $(LIBRARIES) $(LD_SYS_LIBS) -Wl,--end-group
|
||||
{% endblock %}
|
||||
|
||||
$(PROJECT).bin: $(PROJECT).elf
|
||||
$(OBJCOPY) -O binary $< $@
|
||||
|
||||
$(PROJECT).hex: $(PROJECT).elf
|
||||
@$(OBJCOPY) -O ihex $< $@
|
||||
|
||||
$(PROJECT).lst: $(PROJECT).elf
|
||||
@$(OBJDUMP) -Sdh $< > $@
|
||||
|
||||
lst: $(PROJECT).lst
|
||||
|
||||
size: $(PROJECT).elf
|
||||
$(SIZE) $(PROJECT).elf
|
||||
|
||||
DEPS = $(OBJECTS:.o=.d) $(SYS_OBJECTS:.o=.d)
|
||||
-include $(DEPS)
|
||||
|
||||
{% if hex_files %}
|
||||
$(PROJECT)-combined.hex: $(PROJECT).hex
|
||||
$(SREC_CAT) {% for f in hex_files %}{{f}} {% endfor %} -intel $(PROJECT).hex -intel -o $(PROJECT)-combined.hex -intel --line-length=44
|
||||
{% endif %}
|
||||
endif
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
{% extends "gcc_arm_common.tmpl" %}
|
||||
|
||||
{% block target_project_elf %}
|
||||
{{ super() }}
|
||||
@echo ""
|
||||
@echo "*****"
|
||||
@echo "***** You must modify vector checksum value in *.bin and *.hex files."
|
||||
@echo "*****"
|
||||
@echo ""
|
||||
{% endblock %}
|
|
@ -1,10 +0,0 @@
|
|||
{% extends "gcc_arm_common.tmpl" %}
|
||||
|
||||
{% block target_project_elf %}
|
||||
{{ super() }}
|
||||
@echo ""
|
||||
@echo "*****"
|
||||
@echo "***** You must modify vector checksum value in *.bin and *.hex files."
|
||||
@echo "*****"
|
||||
@echo ""
|
||||
{% endblock %}
|
|
@ -1,10 +0,0 @@
|
|||
{% extends "gcc_arm_common.tmpl" %}
|
||||
|
||||
{% block target_project_elf %}
|
||||
{{ super() }}
|
||||
@echo ""
|
||||
@echo "*****"
|
||||
@echo "***** You must modify vector checksum value in *.bin and *.hex files."
|
||||
@echo "*****"
|
||||
@echo ""
|
||||
{% endblock %}
|
|
@ -1,10 +0,0 @@
|
|||
{% extends "gcc_arm_common.tmpl" %}
|
||||
|
||||
{% block target_project_elf %}
|
||||
{{ super() }}
|
||||
@echo ""
|
||||
@echo "*****"
|
||||
@echo "***** You must modify vector checksum value in *.bin and *.hex files."
|
||||
@echo "*****"
|
||||
@echo ""
|
||||
{% endblock %}
|
|
@ -1,10 +0,0 @@
|
|||
{% extends "gcc_arm_common.tmpl" %}
|
||||
|
||||
{% block target_project_elf %}
|
||||
{{ super() }}
|
||||
@echo ""
|
||||
@echo "*****"
|
||||
@echo "***** You must modify vector checksum value in *.bin and *.hex files."
|
||||
@echo "*****"
|
||||
@echo ""
|
||||
{% endblock %}
|
|
@ -1,10 +0,0 @@
|
|||
{% extends "gcc_arm_common.tmpl" %}
|
||||
|
||||
{% block target_project_elf %}
|
||||
{{ super() }}
|
||||
@echo ""
|
||||
@echo "*****"
|
||||
@echo "***** You must modify vector checksum value in *.bin and *.hex files."
|
||||
@echo "*****"
|
||||
@echo ""
|
||||
{% endblock %}
|
|
@ -1,10 +0,0 @@
|
|||
{% extends "gcc_arm_common.tmpl" %}
|
||||
|
||||
{% block target_project_elf %}
|
||||
{{ super() }}
|
||||
@echo ""
|
||||
@echo "*****"
|
||||
@echo "***** You must modify vector checksum value in *.bin and *.hex files."
|
||||
@echo "*****"
|
||||
@echo ""
|
||||
{% endblock %}
|
|
@ -1,10 +0,0 @@
|
|||
{% extends "gcc_arm_common.tmpl" %}
|
||||
|
||||
{% block target_project_elf %}
|
||||
{{ super() }}
|
||||
@echo ""
|
||||
@echo "*****"
|
||||
@echo "***** You must modify vector checksum value in *.bin and *.hex files."
|
||||
@echo "*****"
|
||||
@echo ""
|
||||
{% endblock %}
|
|
@ -1,10 +0,0 @@
|
|||
{% extends "gcc_arm_common.tmpl" %}
|
||||
|
||||
{% block target_project_elf %}
|
||||
{{ super() }}
|
||||
@echo ""
|
||||
@echo "*****"
|
||||
@echo "***** You must modify vector checksum value in *.bin and *.hex files."
|
||||
@echo "*****"
|
||||
@echo ""
|
||||
{% endblock %}
|
|
@ -1,10 +0,0 @@
|
|||
{% extends "gcc_arm_common.tmpl" %}
|
||||
|
||||
{% block target_project_elf %}
|
||||
{{ super() }}
|
||||
@echo ""
|
||||
@echo "*****"
|
||||
@echo "***** You must modify vector checksum value in *.bin and *.hex files."
|
||||
@echo "*****"
|
||||
@echo ""
|
||||
{% endblock %}
|
|
@ -1,10 +0,0 @@
|
|||
{% extends "gcc_arm_common.tmpl" %}
|
||||
|
||||
{% block target_project_elf %}
|
||||
{{ super() }}
|
||||
@echo ""
|
||||
@echo "*****"
|
||||
@echo "***** You must modify vector checksum value in *.bin and *.hex files."
|
||||
@echo "*****"
|
||||
@echo ""
|
||||
{% endblock %}
|
|
@ -1,10 +0,0 @@
|
|||
{% extends "gcc_arm_common.tmpl" %}
|
||||
|
||||
{% block target_project_elf %}
|
||||
{{ super() }}
|
||||
@echo ""
|
||||
@echo "*****"
|
||||
@echo "***** You must modify vector checksum value in *.bin and *.hex files."
|
||||
@echo "*****"
|
||||
@echo ""
|
||||
{% endblock %}
|
|
@ -1,10 +0,0 @@
|
|||
{% extends "gcc_arm_common.tmpl" %}
|
||||
|
||||
{% block target_project_elf %}
|
||||
{{ super() }}
|
||||
@echo ""
|
||||
@echo "*****"
|
||||
@echo "***** You must modify vector checksum value in *.bin and *.hex files."
|
||||
@echo "*****"
|
||||
@echo ""
|
||||
{% endblock %}
|
|
@ -0,0 +1,9 @@
|
|||
{% extends "makefile/Makefile.tmpl" %}
|
||||
|
||||
{% block elf2bin %}
|
||||
$(ELF2BIN) --bin --output $@ $<
|
||||
{%- endblock %}
|
||||
|
||||
{% block elf2hex %}
|
||||
$(ELF2BIN) --i32 --output $@ $<
|
||||
{%- endblock %}
|
|
@ -0,0 +1,15 @@
|
|||
{% extends "makefile/Makefile.tmpl" %}
|
||||
|
||||
{% block sys_libs %}
|
||||
{% for lib in ["-lstdc++", "-lsupc++", "-lm", "-lc", "-lgcc", "-lnosys"] -%}
|
||||
LD_SYS_LIBS += {{lib}}
|
||||
{% endfor %}
|
||||
{%- endblock %}
|
||||
|
||||
{% block elf2bin %}
|
||||
$(ELF2BIN) -O binary $< $@
|
||||
{%- endblock %}
|
||||
|
||||
{% block elf2hex %}
|
||||
$(ELF2BIN) -O ihex $< $@
|
||||
{%- endblock %}
|
|
@ -1,4 +1,4 @@
|
|||
{% extends "gcc_arm_common.tmpl" %}
|
||||
{% extends "makefile/make-gcc-arm.tmpl" %}
|
||||
|
||||
{% block target_project_elf %}
|
||||
{{ super() }}
|
|
@ -0,0 +1,9 @@
|
|||
{% extends "makefile/Makefile.tmpl" %}
|
||||
|
||||
{% block elf2bin %}
|
||||
$(ELF2BIN) --bin $< $@
|
||||
{%- endblock %}
|
||||
|
||||
{% block elf2hex %}
|
||||
$(ELF2BIN) --ihex $< $@
|
||||
{%- endblock %}
|
|
@ -104,7 +104,7 @@ class IAR(mbedToolchain):
|
|||
self.cppc = [main_cc]
|
||||
self.cc += self.flags["common"] + c_flags_cmd + self.flags["c"]
|
||||
self.cppc += self.flags["common"] + c_flags_cmd + cxx_flags_cmd + self.flags["cxx"]
|
||||
self.ld = join(IAR_BIN, "ilinkarm")
|
||||
self.ld = [join(IAR_BIN, "ilinkarm")]
|
||||
self.ar = join(IAR_BIN, "iarchive")
|
||||
self.elf2bin = join(IAR_BIN, "ielftool")
|
||||
|
||||
|
@ -203,7 +203,7 @@ class IAR(mbedToolchain):
|
|||
def link(self, output, objects, libraries, lib_dirs, mem_map):
|
||||
# Build linker command
|
||||
map_file = splitext(output)[0] + ".map"
|
||||
cmd = [self.ld, "-o", output, "--map=%s" % map_file] + objects + libraries + self.flags['ld']
|
||||
cmd = self.ld + [ "-o", output, "--map=%s" % map_file] + objects + libraries + self.flags['ld']
|
||||
|
||||
if mem_map:
|
||||
cmd.extend(["--config", mem_map])
|
||||
|
|
Loading…
Reference in New Issue