summaryrefslogtreecommitdiff
path: root/deps/rabbitmq_shovel
diff options
context:
space:
mode:
authorLuke Bakken <luke@bakken.io>2020-08-04 08:41:50 -0700
committerLuke Bakken <luke@bakken.io>2020-08-04 08:41:50 -0700
commit0db314c96d00f3cadeec2f7a95fe7097f5d0d99e (patch)
tree9b41e61393ee2be0f8b7bae05497b90616c6172e /deps/rabbitmq_shovel
parent47d87582b014377cfe7a2d8de29bb37f843a5259 (diff)
downloadrabbitmq-server-git-0db314c96d00f3cadeec2f7a95fe7097f5d0d99e.tar.gz
Update rabbitmq-components.mk
Diffstat (limited to 'deps/rabbitmq_shovel')
-rw-r--r--deps/rabbitmq_shovel/rabbitmq-components.mk39
1 files changed, 26 insertions, 13 deletions
diff --git a/deps/rabbitmq_shovel/rabbitmq-components.mk b/deps/rabbitmq_shovel/rabbitmq-components.mk
index fbb77d6a60..091a35b7c0 100644
--- a/deps/rabbitmq_shovel/rabbitmq-components.mk
+++ b/deps/rabbitmq_shovel/rabbitmq-components.mk
@@ -317,26 +317,39 @@ prepare-dist::
# --------------------------------------------------------------------
# If the top-level project is a RabbitMQ component, we override
-# $(DEPS_DIR) for this project to point to the top-level's one. We also
-# disable `make distclean` so $(DEPS_DIR) is not accidentally removed.
-
-ifneq ($(wildcard ../../rabbitmq-components.mk),)
-supposed_deps_dir = $(abspath ..)
-else ifneq ($(wildcard ../../../../rabbitmq-components.mk),)
-supposed_deps_dir = $(abspath ../../..)
-else ifneq ($(wildcard UMBRELLA.md),)
+# $(DEPS_DIR) for this project to point to the top-level's one.
+#
+# We also verify that the guessed DEPS_DIR is actually named `deps`,
+# to rule out any situation where it is a coincidence that we found a
+# `rabbitmq-components.mk` up upper directories.
+
+possible_deps_dir_1 = $(abspath ..)
+possible_deps_dir_2 = $(abspath ../../..)
+
+ifeq ($(notdir $(possible_deps_dir_1)),deps)
+ifneq ($(wildcard $(possible_deps_dir_1)/../rabbitmq-components.mk),)
+deps_dir_overriden = 1
+DEPS_DIR ?= $(possible_deps_dir_1)
DISABLE_DISTCLEAN = 1
endif
+endif
-# We also verify that the guessed DEPS_DIR is actually named `deps`, to rule
-# out any situation where it is a coincidence that we found a
-# `rabbitmq-components.mk` up upper directories.
+ifeq ($(deps_dir_overriden),)
+ifeq ($(notdir $(possible_deps_dir_2)),deps)
+ifneq ($(wildcard $(possible_deps_dir_2)/../rabbitmq-components.mk),)
+deps_dir_overriden = 1
+DEPS_DIR ?= $(possible_deps_dir_2)
+DISABLE_DISTCLEAN = 1
+endif
+endif
+endif
-ifeq ($(notdir $(supposed_deps_dir)),deps)
+ifneq ($(wildcard UMBRELLA.md),)
DISABLE_DISTCLEAN = 1
-DEPS_DIR ?= $(supposed_deps_dir)
endif
+# We disable `make distclean` so $(DEPS_DIR) is not accidentally removed.
+
ifeq ($(DISABLE_DISTCLEAN),1)
ifneq ($(filter distclean distclean-deps,$(MAKECMDGOALS)),)
SKIP_DEPS = 1