Initial move to erlang.mk

This commit is contained in:
Jean-Sébastien Pédron 2015-10-13 16:09:27 +02:00
parent 039b72a1df
commit a6e0adccc7
5 changed files with 6408 additions and 7 deletions

View File

@ -1,10 +1,12 @@
*~
.sw?
.*.sw?
*.beam
erl_crash.dump
/build/
/.erlang.mk/
/cover/
/dist/
/deps/
/doc/
/ebin/
/tmp/
/logs/
/plugins/
/rabbitmq_management_agent.d

View File

@ -1 +1,14 @@
include ../umbrella.mk
PROJECT = rabbitmq_management_agent
DEPS = rabbit_common amqp_client
DEP_PLUGINS = rabbit_common/mk/rabbitmq-plugin.mk
# FIXME: Use erlang.mk patched for RabbitMQ, while waiting for PRs to be
# reviewed and merged.
ERLANG_MK_REPO = https://github.com/rabbitmq/erlang.mk.git
ERLANG_MK_COMMIT = rabbitmq-tmp
include rabbitmq-components.mk
include erlang.mk

6262
deps/rabbitmq_management_agent/erlang.mk vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1 +0,0 @@
DEPS:=rabbitmq-erlang-client

View File

@ -0,0 +1,125 @@
ifeq ($(.DEFAULT_GOAL),)
# Define default goal to `all` because this file defines some targets
# before the inclusion of erlang.mk leading to the wrong target becoming
# the default.
.DEFAULT_GOAL = all
endif
# For RabbitMQ repositories, we want to checkout branches which match
# the parent project. For instance, if the parent project is on a
# release tag, dependencies must be on the same release tag. If the
# parent project is on a topic branch, dependencies must be on the same
# topic branch or fallback to `stable` or `master` whichever was the
# base of the topic branch.
RABBITMQ_REPO_BASE ?= https://github.com/rabbitmq
dep_amqp_client = git_rmq rabbitmq-erlang-client $(current_rmq_ref) $(base_rmq_ref)
dep_rabbit = git_rmq rabbitmq-server $(current_rmq_ref) $(base_rmq_ref)
dep_rabbit_common = git_rmq rabbitmq-common $(current_rmq_ref) $(base_rmq_ref)
dep_rabbitmq_codegen = git_rmq rabbitmq-codegen $(current_rmq_ref) $(base_rmq_ref)
dep_rabbitmq_java_client = git_rmq rabbitmq-java-client $(current_rmq_ref) $(base_rmq_ref)
dep_rabbitmq_shovel = git_rmq rabbitmq-shovel $(current_rmq_ref) $(base_rmq_ref)
dep_rabbitmq_test = git_rmq rabbitmq-test $(current_rmq_ref) $(base_rmq_ref)
RABBITMQ_COMPONENTS = amqp_client \
rabbit \
rabbit_common \
rabbitmq_codegen \
rabbitmq_java_client \
rabbitmq_shovel \
rabbitmq_test
ifeq ($(origin current_rmq_ref),undefined)
ifneq ($(wildcard .git),)
current_rmq_ref := $(shell \
git describe --tags --exact-match 2>/dev/null || \
git symbolic-ref -q --short HEAD)
else
current_rmq_ref := master
endif
endif
export current_rmq_ref
ifeq ($(origin base_rmq_ref),undefined)
ifneq ($(wildcard .git),)
base_rmq_ref := $(shell \
(git rev-parse --verify -q stable >/dev/null && \
git merge-base --is-ancestor $$(git merge-base master HEAD) stable && \
echo stable) || \
echo master)
else
base_rmq_ref := master
endif
endif
export base_rmq_ref
dep_rmq_repo = $(if $(dep_$(1)), \
$(RABBITMQ_REPO_BASE)/$(word 2,$(dep_$(1))).git, \
$(pkg_$(1)_repo))
dep_rmq_commits = $(if $(dep_$(1)), \
$(wordlist 3,$(words $(dep_$(1))),$(dep_$(1))), \
$(pkg_$(1)_commit))
define dep_fetch_git_rmq
git clone -q -n -- \
$(call dep_rmq_repo,$(1)) $(DEPS_DIR)/$(call dep_name,$(1)); \
cd $(DEPS_DIR)/$(call dep_name,$(1)) && ( \
$(foreach ref,$(call dep_rmq_commits,$(1)), \
git checkout -q $(ref) >/dev/null 2>&1 || \
) \
(echo "error: no valid pathspec among: $(call dep_rmq_commits,$(1))" \
1>&2 && false) )
endef
ifeq ($(PROJECT),rabbit_common)
else ifeq ($(IS_DEP),1)
else
deps:: check-rabbitmq-components.mk
fetch-deps: check-rabbitmq-components.mk
endif
# 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.
ifneq ($(wildcard ../../UMBRELLA.md),)
UNDER_UMBRELLA = 1
else ifneq ($(wildcard UMBRELLA.md),)
UNDER_UMBRELLA = 1
endif
ifeq ($(UNDER_UMBRELLA),1)
ifneq ($(PROJECT),rabbitmq_public_umbrella)
DEPS_DIR ?= $(abspath ..)
distclean:: distclean-components
@:
distclean-components:
endif
ifneq ($(filter distclean distclean-deps,$(MAKECMDGOALS)),)
SKIP_DEPS = 1
endif
endif
UPSTREAM_RMQ_COMPONENTS_MK = $(DEPS_DIR)/rabbit_common/mk/rabbitmq-components.mk
check-rabbitmq-components.mk:
$(verbose) cmp -s rabbitmq-components.mk \
$(UPSTREAM_RMQ_COMPONENTS_MK) || \
(echo "error: rabbitmq-components.mk must be updated!" 1>&2; \
false)
ifeq ($(PROJECT),rabbit_common)
rabbitmq-components-mk:
@:
else
rabbitmq-components-mk:
$(gen_verbose) cp -a $(UPSTREAM_RMQ_COMPONENTS_MK) .
ifeq ($(DO_COMMIT),yes)
$(verbose) git diff --quiet rabbitmq-components.mk \
|| git commit -m 'Update rabbitmq-components.mk' rabbitmq-components.mk
endif
endif