File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -321,15 +321,22 @@ prepare-dist::
321321# disable `make distclean` so $(DEPS_DIR) is not accidentally removed.
322322
323323ifneq ($(wildcard ../../rabbitmq-components.mk) ,)
324- DISABLE_DISTCLEAN = 1
325- DEPS_DIR ?= $(abspath ..)
324+ supposed_deps_dir = $(abspath ..)
326325else ifneq ($(wildcard ../../../../rabbitmq-components.mk),)
327- DISABLE_DISTCLEAN = 1
328- DEPS_DIR ?= $(abspath ../../..)
326+ supposed_deps_dir = $(abspath ../../..)
329327else ifneq ($(wildcard UMBRELLA.md),)
330328DISABLE_DISTCLEAN = 1
331329endif
332330
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+
333340ifeq ($(DISABLE_DISTCLEAN ) ,1)
334341ifneq ($(filter distclean distclean-deps,$(MAKECMDGOALS ) ) ,)
335342SKIP_DEPS = 1
You can’t perform that action at this time.
0 commit comments