]> rtime.felk.cvut.cz Git - omk.git/commitdiff
It is not necessary to evaluate C++ compilation separately for every possible file...
authorMichal Sojka <sojkam1@fel.cvut.cz>
Thu, 26 Jun 2014 13:59:35 +0000 (15:59 +0200)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Thu, 26 Jun 2014 13:59:35 +0000 (15:59 +0200)
One call to $(filter) can handle all the extensions.

snippets/linux.omk

index 60ab085bcfe730237ff951bea691b5220f455af4..fc1af354269fed427c77cec680c4b6de1d2627d4 100644 (file)
@@ -195,11 +195,7 @@ endef
 define COMPILE_templates
 $(foreach src,$(filter %.c,$(1)),$(call COMPILE_c_o_template,$(src),$(3)$(notdir $(src:%.c=%$(2))),)
 )
-$(foreach src,$(filter %.cc,$(1)),$(call COMPILE_cc_o_template,$(src),$(3)$(notdir $(src:%.cc=%$(2))),)
-)
-$(foreach src,$(filter %.cxx,$(1)),$(call COMPILE_cc_o_template,$(src),$(3)$(notdir $(src:%.cxx=%$(2))),)
-)
-$(foreach src,$(filter %.cpp,$(1)),$(call COMPILE_cc_o_template,$(src),$(3)$(notdir $(src:%.cpp=%$(2))),)
+$(foreach src,$(filter %.cc %.cxx %.cpp,$(1)),$(call COMPILE_cc_o_template,$(src),$(3)$(notdir $(basename $(src))$(2)),)
 )
 $(foreach src,$(filter %.S,$(1)),$(call COMPILE_S_o_template,$(src),$(3)$(notdir $(basename $(src))$(2)),)
 )