summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorJean-Sébastien Pédron <jean-sebastien@rabbitmq.com>2015-09-08 15:15:00 +0200
committerJean-Sébastien Pédron <jean-sebastien.pedron@dumbbell.fr>2015-10-20 11:10:48 +0200
commitb31818b598767f7c8b0109c58a37a6d626ca4abf (patch)
tree1fe1cbfd044b0421a5af65ba6953452cfb5993ad /Makefile
parent9cac28d6a7aebc0fd2c491a71f444e800ce401b8 (diff)
downloadrabbitmq-server-git-b31818b598767f7c8b0109c58a37a6d626ca4abf.tar.gz
Use dependency branches matching the parent branch
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile21
1 files changed, 19 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index b229e0dc1d..d168fc124d 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,24 @@
PROJECT = rabbit
-DEPS += rabbit_common
-dep_rabbit_common = git https://github.com/rabbitmq/rabbitmq-common.git master
+DEPS = rabbit_common
+
+# For RabbitMQ repositories, we want to checkout branches which match
+# the parent porject. For instance, if the parent project is on a
+# release tag, dependencies must be on the same release tag. If the
+# parent project is on a topic branch, dependencies must be on the same
+# topic branch or fallback to `stable` or `master` whichever was the
+# base of the topic branch.
+
+ifeq ($(origin current_rmq_ref),undefined)
+current_rmq_ref := $(shell git symbolic-ref -q --short HEAD || git describe --tags --exact-match)
+export current_rmq_ref
+endif
+ifeq ($(origin base_rmq_ref),undefined)
+base_rmq_ref := $(shell git merge-base --is-ancestor $$(git merge-base master HEAD) stable && echo stable || echo master)
+export base_rmq_ref
+endif
+
+dep_rabbit_common = git https://github.com/rabbitmq/rabbitmq-common.git $(current_rmq_ref) $(base_rmq_ref)
define usage_xml_to_erl
$(subst __,_,$(patsubst $(DOCS_DIR)/rabbitmq%.1.xml, src/rabbit_%_usage.erl, $(subst -,_,$(1))))