@@ -116,7 +116,7 @@ dep_cowlib = hex 2.7.0
116116dep_jsx = hex 2.11.0
117117dep_lager = hex 3.8.0
118118dep_prometheus = hex 4.6.0
119- dep_ra = hex 1.1.5
119+ dep_ra = hex 1.1.6
120120dep_ranch = hex 1.7.1
121121dep_recon = hex 2.5.1
122122dep_observer_cli = hex 1.5.4
@@ -316,21 +316,28 @@ prepare-dist::
316316# Umbrella-specific settings.
317317# --------------------------------------------------------------------
318318
319- # If this project is under the Umbrella project , we override $(DEPS_DIR)
320- # to point to the Umbrella 's one. We also disable `make distclean` so
321- # $(DEPS_DIR) is not accidentally removed.
319+ # If the top-level project is a RabbitMQ component , we override
320+ # $(DEPS_DIR) for this project to point to the top-level 's one. We also
321+ # disable `make distclean` so $(DEPS_DIR) is not accidentally removed.
322322
323- ifneq ($(wildcard ../../UMBRELLA.md) ,)
324- UNDER_UMBRELLA = 1
325- DEPS_DIR ?= $(abspath ..)
326- else ifneq ($(wildcard ../../../../UMBRELLA.md),)
327- UNDER_UMBRELLA = 1
328- DEPS_DIR ?= $(abspath ../../..)
323+ ifneq ($(wildcard ../../rabbitmq-components.mk) ,)
324+ supposed_deps_dir = $(abspath ..)
325+ else ifneq ($(wildcard ../../../../rabbitmq-components.mk),)
326+ supposed_deps_dir = $(abspath ../../..)
329327else ifneq ($(wildcard UMBRELLA.md),)
330- UNDER_UMBRELLA = 1
328+ DISABLE_DISTCLEAN = 1
331329endif
332330
333- ifeq ($(UNDER_UMBRELLA ) ,1)
331+ # We also verify that the guessed DEPS_DIR is actually named `deps`, to rule
332+ # out any situation where it is a coincidence that we found a
333+ # `rabbitmq-components.mk` up upper directories.
334+
335+ ifeq ($(notdir $(supposed_deps_dir ) ) ,deps)
336+ DISABLE_DISTCLEAN = 1
337+ DEPS_DIR ?= $(supposed_deps_dir )
338+ endif
339+
340+ ifeq ($(DISABLE_DISTCLEAN ) ,1)
334341ifneq ($(filter distclean distclean-deps,$(MAKECMDGOALS ) ) ,)
335342SKIP_DEPS = 1
336343endif
0 commit comments