Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update gnuarmeclipse to preprocess linker scripts #4069

Merged
merged 1 commit into from Apr 10, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion tools/export/gnuarmeclipse/__init__.py
Expand Up @@ -243,7 +243,9 @@ def generate(self):
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}}.
Expand All @@ -260,6 +262,7 @@ def generate(self):

jinja_ctx = {
'name': self.project_name,
'ld_script': self.ld_script,

# Compiler & linker command line options
'options': self.options,
Expand Down
10 changes: 8 additions & 2 deletions tools/export/gnuarmeclipse/makefile.targets.tmpl
Expand Up @@ -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 %}