Browse Source

Add support for .S files to the gcc make system

inmarket 2 years ago
parent
commit
e5497f2ac0
1 changed files with 17 additions and 1 deletions
  1. 17 1
      tools/gmake_scripts/compiler_gcc.mk

+ 17 - 1
tools/gmake_scripts/compiler_gcc.mk

@@ -215,7 +215,13 @@ ifneq ($(OPT_VERBOSE_COMPILE),yes)
215 215
   ifneq ($(filter %.s,$(SRC) $(SRC_NOTHUMB) $(SRC_THUMB)),)
216 216
 	@echo .
217 217
 	@echo Assembler Options.....
218
-	@echo $(XCC) -c $(CPPFLAGS) $(CFLAGS) $(SRCFLAGS) $(@:.o=.s) -o $(OBJDIR)/$@
218
+	@echo $(XAS) -c $(CPPFLAGS) $(CFLAGS) $(SRCFLAGS) $(@:.o=.s) -o $(OBJDIR)/$@
219
+  else
220
+   ifneq ($(filter %.S,$(SRC) $(SRC_NOTHUMB) $(SRC_THUMB)),)
221
+	@echo .
222
+	@echo Assembler Options.....
223
+	@echo $(XAS) -c $(CPPFLAGS) $(CFLAGS) $(SRCFLAGS) $(@:.o=.S) -o $(OBJDIR)/$@
224
+   endif
219 225
   endif
220 226
   ifneq ($(OPT_MAKE_LIB),yes)
221 227
 	@echo .
@@ -278,6 +284,16 @@ else
278 284
 	@$(XAS) -c $(CPPFLAGS) $(ASFLAGS) $(SRCFLAGS) $< -o $@
279 285
 endif
280 286
 
287
+$(OBJDIR)/%.o : $$(call obj_src,%.S)
288
+	@mkdir -p $(dir $@)
289
+ifeq ($(OPT_VERBOSE_COMPILE),yes)
290
+	@echo .
291
+	$(XAS) -c $(CPPFLAGS) $(ASFLAGS) $(SRCFLAGS) $< -o $@
292
+else
293
+	@echo Compiling $<
294
+	@$(XAS) -c $(CPPFLAGS) $(ASFLAGS) $(SRCFLAGS) $< -o $@
295
+endif
296
+
281 297
 $(EXEFILE): $(OBJS_THUMB) $(OBJS_NOTHUMB) $(LDSCRIPT)
282 298
 	@mkdir -p $(dir $@)
283 299
 ifeq ($(OPT_VERBOSE_COMPILE),yes)