]> rtime.felk.cvut.cz Git - omk.git/blobdiff - snippets/linux.omk
Add rules for .s assembler files
[omk.git] / snippets / linux.omk
index d477ab1eee853d145e905152b1deb480bb79dd9c..60ab085bcfe730237ff951bea691b5220f455af4 100644 (file)
@@ -167,6 +167,16 @@ $(2): $(1) $$(GEN_HEADERS)
 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
 
@@ -191,7 +201,9 @@ $(foreach src,$(filter %.cxx,$(1)),$(call COMPILE_cc_o_template,$(src),$(3)$(not
 )
 $(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