File tree Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -97,20 +97,26 @@ all: $(PROJECT).bin $(PROJECT)-combined.hex size
97
97
all: $(PROJECT).bin $(PROJECT).hex size
98
98
{% endif %}
99
99
100
- .asm.o:
101
- +@$(call MAKEDIR,$(dir $@))
102
- +@echo "Assemble: $(notdir $<)"
103
- @$(AS) -c $(ASM_FLAGS) $(INCLUDE_PATHS) -o $@ $<
104
-
105
100
.s.o:
106
101
+@$(call MAKEDIR,$(dir $@))
107
102
+@echo "Assemble: $(notdir $<)"
103
+ {% if needs_asm_preproc %}
104
+ @$(AS) -c $(ASM_FLAGS) $(INCLUDE_PATHS) -E -o $(@:.o=.E.s) $<
105
+ @$(AS) -c $(ASM_FLAGS) $(INCLUDE_PATHS) -o $@ $(@:.o=.E.s)
106
+ {% else %}
108
107
@$(AS) -c $(ASM_FLAGS) $(INCLUDE_PATHS) -o $@ $<
108
+ {% endif %}
109
+
109
110
110
111
.S.o:
111
112
+@$(call MAKEDIR,$(dir $@))
112
113
+@echo "Assemble: $(notdir $<)"
114
+ {% if needs_asm_preproc %}
115
+ @$(AS) -c $(ASM_FLAGS) $(INCLUDE_PATHS) -E -o $(@:.o=.E.s) $<
116
+ @$(AS) -c $(ASM_FLAGS) $(INCLUDE_PATHS) -o $@ $(@:.o=.E.s)
117
+ {% else %}
113
118
@$(AS) -c $(ASM_FLAGS) $(INCLUDE_PATHS) -o $@ $<
119
+ {% endif %}
114
120
115
121
.c.o:
116
122
+@$(call MAKEDIR,$(dir $@))
Original file line number Diff line number Diff line change @@ -35,6 +35,8 @@ class Makefile(Exporter):
35
35
36
36
MBED_CONFIG_HEADER_SUPPORTED = True
37
37
38
+ PREPROCESS_ASM = False
39
+
38
40
POST_BINARY_WHITELIST = set ([
39
41
"MCU_NRF51Code.binary_hook" ,
40
42
"TEENSY3_1Code.binary_hook" ,
@@ -96,6 +98,7 @@ def generate(self):
96
98
'link_script_ext' : self .toolchain .LINKER_EXT ,
97
99
'link_script_option' : self .LINK_SCRIPT_OPTION ,
98
100
'user_library_flag' : self .USER_LIBRARY_FLAG ,
101
+ 'needs_asm_preproc' : self .PREPROCESS_ASM ,
99
102
}
100
103
101
104
if hasattr (self .toolchain , "preproc" ):
@@ -236,6 +239,7 @@ class Armc5(Arm):
236
239
"""ARM Compiler 5 (armcc) specific makefile target"""
237
240
NAME = 'Make-ARMc5'
238
241
TOOLCHAIN = "ARM"
242
+ PREPROCESS_ASM = True
239
243
240
244
class Armc6 (Arm ):
241
245
"""ARM Compiler 6 (armclang) specific generic makefile target"""
You can’t perform that action at this time.
0 commit comments