build: Allow support for .S assembly file in SRC

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
This commit is contained in:
Sylvain Munaut 2019-08-05 15:41:46 +02:00
parent 804ec24df9
commit 544bcd9845
1 changed files with 5 additions and 1 deletions

View File

@ -73,7 +73,7 @@ ifndef OWN_HL
SRC += jtag_scan.c jtagtap.c swdptap.c SRC += jtag_scan.c jtagtap.c swdptap.c
endif endif
OBJ = $(SRC:.c=.o) OBJ = $(patsubst %.S,%.o,$(patsubst %.c,%.o,$(SRC)))
$(TARGET): include/version.h $(OBJ) $(TARGET): include/version.h $(OBJ)
@echo " LD $@" @echo " LD $@"
@ -83,6 +83,10 @@ $(TARGET): include/version.h $(OBJ)
@echo " CC $<" @echo " CC $<"
$(Q)$(CC) $(CFLAGS) -c $< -o $@ $(Q)$(CC) $(CFLAGS) -c $< -o $@
%.o: %.S
@echo " AS $<"
$(Q)$(CC) $(CFLAGS) -c $< -o $@
%.bin: % %.bin: %
@echo " OBJCOPY $@" @echo " OBJCOPY $@"
$(Q)$(OBJCOPY) -O binary $^ $@ $(Q)$(OBJCOPY) -O binary $^ $@