Skip to content

Force preprocessing of asm for make_armc5 #5166

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

Merged
merged 1 commit into from
Sep 25, 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions tools/export/makefile/Makefile.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -97,20 +97,26 @@ all: $(PROJECT).bin $(PROJECT)-combined.hex size
all: $(PROJECT).bin $(PROJECT).hex size
{% endif %}

.asm.o:
+@$(call MAKEDIR,$(dir $@))
+@echo "Assemble: $(notdir $<)"
@$(AS) -c $(ASM_FLAGS) $(INCLUDE_PATHS) -o $@ $<

.s.o:
+@$(call MAKEDIR,$(dir $@))
+@echo "Assemble: $(notdir $<)"
{% if needs_asm_preproc %}
@$(AS) -c $(ASM_FLAGS) $(INCLUDE_PATHS) -E -o $(@:.o=.E.s) $<
@$(AS) -c $(ASM_FLAGS) $(INCLUDE_PATHS) -o $@ $(@:.o=.E.s)
{% else %}
@$(AS) -c $(ASM_FLAGS) $(INCLUDE_PATHS) -o $@ $<
{% endif %}


.S.o:
+@$(call MAKEDIR,$(dir $@))
+@echo "Assemble: $(notdir $<)"
{% if needs_asm_preproc %}
@$(AS) -c $(ASM_FLAGS) $(INCLUDE_PATHS) -E -o $(@:.o=.E.s) $<
@$(AS) -c $(ASM_FLAGS) $(INCLUDE_PATHS) -o $@ $(@:.o=.E.s)
{% else %}
@$(AS) -c $(ASM_FLAGS) $(INCLUDE_PATHS) -o $@ $<
{% endif %}

.c.o:
+@$(call MAKEDIR,$(dir $@))
Expand Down
4 changes: 4 additions & 0 deletions tools/export/makefile/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ class Makefile(Exporter):

MBED_CONFIG_HEADER_SUPPORTED = True

PREPROCESS_ASM = False

POST_BINARY_WHITELIST = set([
"MCU_NRF51Code.binary_hook",
"TEENSY3_1Code.binary_hook",
Expand Down Expand Up @@ -96,6 +98,7 @@ def generate(self):
'link_script_ext': self.toolchain.LINKER_EXT,
'link_script_option': self.LINK_SCRIPT_OPTION,
'user_library_flag': self.USER_LIBRARY_FLAG,
'needs_asm_preproc': self.PREPROCESS_ASM,
}

if hasattr(self.toolchain, "preproc"):
Expand Down Expand Up @@ -236,6 +239,7 @@ class Armc5(Arm):
"""ARM Compiler 5 (armcc) specific makefile target"""
NAME = 'Make-ARMc5'
TOOLCHAIN = "ARM"
PREPROCESS_ASM = True

class Armc6(Arm):
"""ARM Compiler 6 (armclang) specific generic makefile target"""
Expand Down