aboutsummaryrefslogtreecommitdiffstats
path: root/core/compat.mk
diff options
context:
space:
mode:
Diffstat (limited to 'core/compat.mk')
-rw-r--r--core/compat.mk10
1 files changed, 6 insertions, 4 deletions
diff --git a/core/compat.mk b/core/compat.mk
index 906faac..f9dcfe7 100644
--- a/core/compat.mk
+++ b/core/compat.mk
@@ -3,6 +3,8 @@
.PHONY: rebar.config
+compat_ref = {$(shell (git -C $(DEPS_DIR)/$1 show-ref -q --verify "refs/heads/$2" && echo branch) || (git -C $(DEPS_DIR)/$1 show-ref -q --verify "refs/tags/$2" && echo tag) || echo ref),"$2"}
+
# We strip out -Werror because we don't want to fail due to
# warnings when used as a dependency.
@@ -21,12 +23,12 @@ endef
define compat_rebar_config
{deps, [
$(call comma_list,$(foreach d,$(DEPS),\
- $(if $(filter hex,$(call dep_fetch,$d)),\
- {$(call dep_name,$d)$(comma)"$(call dep_repo,$d)"},\
- {$(call dep_name,$d)$(comma)".*"$(comma){git,"$(call dep_repo,$d)"$(comma)"$(call dep_commit,$d)"}})))
+ $(if $(filter hex,$(call query_fetch_method,$d)),\
+ {$(call query_name,$d)$(comma)"$(call query_version_hex,$d)"},\
+ {$(call query_name,$d)$(comma)".*"$(comma){git,"$(call query_repo,$d)"$(comma)$(call compat_ref,$(call query_name,$d),$(call query_version,$d))}})))
]}.
{erl_opts, $(call compat_erlc_opts_to_list,$(ERLC_OPTS))}.
endef
-rebar.config:
+rebar.config: deps
$(gen_verbose) $(call core_render,compat_rebar_config,rebar.config)