endif
endef
+# Syntax: $(call COMPILE_s_o_template,<source>,<target>,<additional c-flags>)
+define COMPILE_s_o_template
+ifeq ($$($(2)_s_TARGET),)
+$(2)_s_TARGET=1
+$(2): $(1) $$(GEN_HEADERS)
+ @$(QUIET_CMD_ECHO) " AS $$@"
+ $(Q)$$(S_o_COMPILE) $(3) -o $$@ -c $$<
+endif
+endef
+
# Syntax: $(call COMPILE_idl_template,</path/to/src.idl>,<basename>)
define COMPILE_idl_template
)
$(foreach src,$(filter %.cpp,$(1)),$(call COMPILE_cc_o_template,$(src),$(3)$(notdir $(src:%.cpp=%$(2))),)
)
-$(foreach src,$(filter %.S,$(1)),$(call COMPILE_S_o_template,$(src),$(3)$(notdir $(src:%.S=%$(2))),)
+$(foreach src,$(filter %.S,$(1)),$(call COMPILE_S_o_template,$(src),$(3)$(notdir $(basename $(src))$(2)),)
+)
+$(foreach src,$(filter %.s,$(1)),$(call COMPILE_s_o_template,$(src),$(3)$(notdir $(basename $(src))$(2)),)
)
endef