!40 fix no compile .s source file.

Merge pull request !40 from iysheng/gitee_master
This commit is contained in:
RT-Thread 2020-07-28 05:32:31 +08:00 committed by Gitee
commit a0897d684a
1 changed files with 17 additions and 0 deletions

View File

@ -55,6 +55,20 @@ $(if $(strip $(LOCALS)),$(eval $(LOCALS): $(S_SRC)
@$(CROSS_COMPILE)gcc $$(AFLAGS) -c $$< -o $$@))
endef
define add_s_file
$(eval S_SRC := $(1:$(BSP_ROOT)/%=%)) \
$(eval S_SRC := $(S_SRC:$(RTT_ROOT)/%=%)) \
$(eval SOBJ := $(1:%.s=%.o)) \
$(eval SOBJ := $(SOBJ:$(BSP_ROOT)/%=$(BSP_BUILD_DIR)/%)) \
$(eval SOBJ := $(SOBJ:$(RTT_ROOT)/%=$(RTT_BUILD_DIR)/%)) \
$(eval LOCALS := $(addprefix $(BUILD_DIR)/,$(SOBJ))) \
$(eval OBJS += $(LOCALS)) \
$(if $(strip $(LOCALS)),$(eval $(LOCALS): $(S_SRC)
@if [ ! -d $$(@D) ]; then mkdir -p $$(@D); fi
@echo cc $$<
@$(CROSS_COMPILE)gcc $$(AFLAGS) -c $$< -o $$@))
endef
add_flg = $(eval CFLAGS += $1) \
$(eval AFLAGS += $1) \
$(eval CXXFLAGS += $1)
@ -89,6 +103,9 @@ $(if $(SRCS),$(foreach f,$(SRCS),$(call add_cxx_file,$(f))))
SRCS := $(strip $(filter %.S,$(SRC_FILES)))
$(if $(SRCS),$(foreach f,$(SRCS),$(call add_S_file,$(f))))
SRCS := $(strip $(filter %.s,$(SRC_FILES)))
$(if $(SRCS),$(foreach f,$(SRCS),$(call add_s_file,$(f))))
CFLAGS += $(CPPPATHS)
CXXFLAGS += $(CPPPATHS)
AFLAGS += $(CPPPATHS)