From b55d1b16c6c3b2afba46746414f68842100af42f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-S=C3=A9bastien=20P=C3=A9dron?= Date: Thu, 30 Jul 2020 12:06:49 +0200 Subject: [PATCH] Update rabbitmq-components.mk --- deps/amqp_client/rabbitmq-components.mk | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/deps/amqp_client/rabbitmq-components.mk b/deps/amqp_client/rabbitmq-components.mk index 71f65c0522..fbb77d6a60 100644 --- a/deps/amqp_client/rabbitmq-components.mk +++ b/deps/amqp_client/rabbitmq-components.mk @@ -321,15 +321,22 @@ prepare-dist:: # disable `make distclean` so $(DEPS_DIR) is not accidentally removed. ifneq ($(wildcard ../../rabbitmq-components.mk),) -DISABLE_DISTCLEAN = 1 -DEPS_DIR ?= $(abspath ..) +supposed_deps_dir = $(abspath ..) else ifneq ($(wildcard ../../../../rabbitmq-components.mk),) -DISABLE_DISTCLEAN = 1 -DEPS_DIR ?= $(abspath ../../..) +supposed_deps_dir = $(abspath ../../..) else ifneq ($(wildcard UMBRELLA.md),) DISABLE_DISTCLEAN = 1 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 ($(notdir $(supposed_deps_dir)),deps) +DISABLE_DISTCLEAN = 1 +DEPS_DIR ?= $(supposed_deps_dir) +endif + ifeq ($(DISABLE_DISTCLEAN),1) ifneq ($(filter distclean distclean-deps,$(MAKECMDGOALS)),) SKIP_DEPS = 1