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
--- /dev/null
+#!/bin/bash
+
+. ./wvtest.sh
+
+[[ $OMK_RULES != "linux" ]] && exit 0
+
+WVSTART "Compile assembler in .S file"
+cat > 'test.S' <<'EOF'
+.global main
+main:
+EOF
+cat > 'Makefile.omk' <<'EOF'
+bin_PROGRAMS = test
+test_SOURCES = test.S
+EOF
+needs_valid_CC
+WVPASS make V=1
+
+WVSTART "Compile assembler in .s file"
+cat > 'test.s' <<'EOF'
+.global main
+main:
+EOF
+cat > 'Makefile.omk' <<'EOF'
+bin_PROGRAMS = test
+test_SOURCES = test.s
+EOF
+needs_valid_CC
+WVPASS make V=1