Merge pull request #4069 from theotherjimmy/preproc-linker-gnuarmeclipse

Update gnuarmeclipse to preprocess linker scripts
pull/4148/head
Sam Grove 2017-04-10 11:10:58 -05:00 committed by GitHub
commit 0b1117793f
2 changed files with 12 additions and 3 deletions

View File

@ -244,7 +244,9 @@ class GNUARMEclipse(Exporter):
opts['ld']['object_files'] = objects
opts['ld']['user_libraries'] = libraries
opts['ld']['system_libraries'] = self.system_libraries
opts['ld']['script'] = self.ld_script
opts['ld']['script'] = join(id.capitalize(),
"linker-script-%s.ld" % id)
opts['cpp_cmd'] = " ".join(toolchain.preproc)
# Unique IDs used in multiple places.
# Those used only once are implemented with {{u.id}}.
@ -261,6 +263,7 @@ class GNUARMEclipse(Exporter):
jinja_ctx = {
'name': self.project_name,
'ld_script': self.ld_script,
# Compiler & linker command line options
'options': self.options,

View File

@ -3,5 +3,11 @@
mbedclean:
$(RM) $(OBJS)
$(RM) $(CC_DEPS)$(C++_DEPS)$(C_UPPER_DEPS)$(CXX_DEPS)$(ASM_DEPS)$(S_UPPER_DEPS)$(C_DEPS)$(CPP_DEPS)
$(RM) $(SECONDARY_FLASH)$(SECONDARY_SIZE) {{name}}.*
-@echo ' '
$(RM) $(SECONDARY_FLASH)$(SECONDARY_SIZE) {{name}}.* linker-script-*.ld
-@echo ' '
{% for config, data in options.iteritems() %}
linker-script-{{config}}.ld: ../{{ld_script}}
{{data.cpp_cmd}} {{data.ld.other}} $< -o $@
{{name}}.elf: linker-script-{{config}}.ld
{% endfor %}