Skip to content

Commit

Permalink
Update rabbitmq-components.mk
Browse files Browse the repository at this point in the history
  • Loading branch information
dumbbell committed Jul 31, 2020
1 parent bb99e8c commit 46bf724
Showing 1 changed file with 19 additions and 12 deletions.
31 changes: 19 additions & 12 deletions rabbitmq-components.mk
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ dep_cowlib = hex 2.7.0
dep_jsx = hex 2.11.0
dep_lager = hex 3.8.0
dep_prometheus = hex 4.6.0
dep_ra = hex 1.1.5
dep_ra = hex 1.1.6
dep_ranch = hex 1.7.1
dep_recon = hex 2.5.1
dep_observer_cli = hex 1.5.4
Expand Down Expand Up @@ -316,21 +316,28 @@ prepare-dist::
# Umbrella-specific settings.
# --------------------------------------------------------------------

# If this project is under the Umbrella project, we override $(DEPS_DIR)
# to point to the Umbrella's one. We also disable `make distclean` so
# $(DEPS_DIR) is not accidentally removed.
# 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 ../../UMBRELLA.md),)
UNDER_UMBRELLA = 1
DEPS_DIR ?= $(abspath ..)
else ifneq ($(wildcard ../../../../UMBRELLA.md),)
UNDER_UMBRELLA = 1
DEPS_DIR ?= $(abspath ../../..)
ifneq ($(wildcard ../../rabbitmq-components.mk),)
supposed_deps_dir = $(abspath ..)
else ifneq ($(wildcard ../../../../rabbitmq-components.mk),)
supposed_deps_dir = $(abspath ../../..)
else ifneq ($(wildcard UMBRELLA.md),)
UNDER_UMBRELLA = 1
DISABLE_DISTCLEAN = 1
endif

ifeq ($(UNDER_UMBRELLA),1)
# 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
endif
Expand Down

0 comments on commit 46bf724

Please sign in to comment.