build: Support both .s & .S files

Change-Id: I61d213f28e542d7a5df388312281b7601af2f86a
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
This commit is contained in:
Huang Qi 2020-09-08 19:23:33 +08:00 committed by Xiang Xiao
parent bd537f286d
commit e5e3c36b35

View File

@ -70,7 +70,11 @@ PROGNAME := $(shell echo $(PROGNAME))
# Object files
AOBJS = $(ASRCS:.S=$(SUFFIX)$(OBJEXT))
RASRCS = $(filter %.s,$(ASRCS))
CASRCS = $(filter %.S,$(ASRCS))
AOBJS = $(RASRCS:.s=$(SUFFIX)$(OBJEXT))
AOBJS += $(CASRCS:.S=$(SUFFIX)$(OBJEXT))
COBJS = $(CSRCS:.c=$(SUFFIX)$(OBJEXT))
CXXOBJS = $(CXXSRCS:$(CXXEXT)=$(SUFFIX)$(OBJEXT))
@ -119,7 +123,7 @@ define ELFLD
$(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) $(ARCHCRT0OBJ) $1 $(LDLIBS) -o $2
endef
$(AOBJS): %$(SUFFIX)$(OBJEXT): %.S
$(AOBJS): %$(SUFFIX)$(OBJEXT): $(ASRCS)
$(if $(and $(CONFIG_BUILD_LOADABLE),$(AELFFLAGS)), \
$(call ELFASSEMBLE, $<, $@), $(call ASSEMBLE, $<, $@))