Browse Source

Add a function to convert ERLC_OPTS to an Erlang list

For easier reusability in Erlang.mk and plugins.
Loïc Hoguin 9 years ago
parent
commit
914ee6f4f1
1 changed files with 5 additions and 2 deletions
  1. 5 2
      core/compat.mk

+ 5 - 2
core/compat.mk

@@ -14,11 +14,14 @@ $(if $(filter-out -Werror,$1),\
 		$(shell echo $1 | cut -b 2-)))
 		$(shell echo $1 | cut -b 2-)))
 endef
 endef
 
 
+define compat_erlc_opts_to_list
+	[$(call comma_list,$(foreach o,$(call compat_prepare_erlc_opts,$1),$(call compat_convert_erlc_opts,$o)))]
+endef
+
 define compat_rebar_config
 define compat_rebar_config
 {deps, [$(call comma_list,$(foreach d,$(DEPS),\
 {deps, [$(call comma_list,$(foreach d,$(DEPS),\
 	{$(call dep_name,$d),".*",{git,"$(call dep_repo,$d)","$(call dep_commit,$d)"}}))]}.
 	{$(call dep_name,$d),".*",{git,"$(call dep_repo,$d)","$(call dep_commit,$d)"}}))]}.
-{erl_opts, [$(call comma_list,$(foreach o,$(call compat_prepare_erlc_opts,$(ERLC_OPTS)),\
-	$(call compat_convert_erlc_opts,$o)))]}.
+{erl_opts, $(call compat_erlc_opts_to_list,$(ERLC_OPTS))}.
 endef
 endef
 
 
 $(eval _compat_rebar_config = $$(compat_rebar_config))
 $(eval _compat_rebar_config = $$(compat_rebar_config))