| 
									
										
										
										
											2016-09-23 16:45:08 +08:00
										 |  |  | PROJECT = rabbitmq_server_release | 
					
						
							| 
									
										
										
										
											2016-12-06 02:34:50 +08:00
										 |  |  | PROJECT_DESCRIPTION = RabbitMQ Server | 
					
						
							| 
									
										
										
										
											2016-12-06 00:17:29 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-12-06 20:37:00 +08:00
										 |  |  | # Propagate PROJECT_VERSION (from the command line or environment) to
 | 
					
						
							|  |  |  | # other components. If PROJECT_VERSION is unset, then an empty variable
 | 
					
						
							|  |  |  | # is propagated and the default version will fallback to the default
 | 
					
						
							|  |  |  | # value from rabbitmq-components.mk.
 | 
					
						
							| 
									
										
										
										
											2024-06-07 19:34:57 +08:00
										 |  |  | export RABBITMQ_VERSION := $(PROJECT_VERSION) | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | # Release artifacts are put in $(PACKAGES_DIR).
 | 
					
						
							|  |  |  | PACKAGES_DIR ?= $(abspath PACKAGES) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # List of plugins to include in a RabbitMQ release.
 | 
					
						
							| 
									
										
										
										
											2016-12-07 18:20:41 +08:00
										 |  |  | include plugins.mk | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-03-12 19:00:03 +08:00
										 |  |  | # An additional list of plugins to include in a RabbitMQ release,
 | 
					
						
							| 
									
										
										
										
											2024-06-26 15:56:46 +08:00
										 |  |  | # on top of the standard plugins.
 | 
					
						
							| 
									
										
										
										
											2021-03-12 19:00:03 +08:00
										 |  |  | #
 | 
					
						
							|  |  |  | # Note: When including NIFs in a release make sure to build
 | 
					
						
							|  |  |  | # them on the appropriate platform for the target environment.
 | 
					
						
							| 
									
										
										
										
											2024-06-26 15:56:46 +08:00
										 |  |  | # For example build on Linux when targeting Docker.
 | 
					
						
							| 
									
										
										
										
											2021-03-12 19:00:03 +08:00
										 |  |  | ADDITIONAL_PLUGINS ?= | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | DEPS = rabbit_common rabbit $(PLUGINS) $(ADDITIONAL_PLUGINS) | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-01 00:35:48 +08:00
										 |  |  | DEP_PLUGINS = rabbit_common/mk/rabbitmq-dist.mk \
 | 
					
						
							| 
									
										
										
										
											2024-07-24 19:00:49 +08:00
										 |  |  | 	      rabbit_common/mk/rabbitmq-run.mk | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-11-10 17:40:02 +08:00
										 |  |  | DISABLE_DISTCLEAN = 1 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-06-07 20:14:04 +08:00
										 |  |  | ifeq ($(filter-out xref,$(MAKECMDGOALS)),) | 
					
						
							| 
									
										
										
										
											2022-05-31 19:51:12 +08:00
										 |  |  | XREF_SCOPE = app deps | 
					
						
							| 
									
										
										
										
											2022-05-31 20:19:54 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | # For Elixir protocols the right fix is to include the consolidated/
 | 
					
						
							|  |  |  | # folders in addition to ebin/. However this creates conflicts because
 | 
					
						
							|  |  |  | # some modules are duplicated. So instead we ignore warnings from
 | 
					
						
							|  |  |  | # protocols directly.
 | 
					
						
							|  |  |  | XREF_IGNORE = [ \
 | 
					
						
							|  |  |  |     {'Elixir.CSV.Encode',impl_for,1}, \
 | 
					
						
							| 
									
										
										
										
											2023-11-17 20:08:26 +08:00
										 |  |  |     {'Elixir.JSON.Decoder',impl_for,1}, \
 | 
					
						
							|  |  |  |     {'Elixir.JSON.Encoder',impl_for,1}, \
 | 
					
						
							| 
									
										
										
										
											2022-05-31 20:19:54 +08:00
										 |  |  |     {'Elixir.RabbitMQ.CLI.Core.DataCoercion',impl_for,1}] | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-05-31 19:51:12 +08:00
										 |  |  | # Include Elixir libraries in the Xref checks.
 | 
					
						
							| 
									
										
										
										
											2024-07-12 07:10:51 +08:00
										 |  |  | xref: ERL_LIBS := $(ERL_LIBS):$(CURDIR)/apps:$(CURDIR)/deps:$(dir $(shell elixir --eval ':io.format "~s~n", [:code.lib_dir :elixir ]')) | 
					
						
							| 
									
										
										
										
											2024-06-07 20:14:04 +08:00
										 |  |  | endif | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | include rabbitmq-components.mk | 
					
						
							| 
									
										
										
										
											2024-06-07 19:34:57 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | # Set PROJECT_VERSION, calculated in rabbitmq-components.mk,
 | 
					
						
							|  |  |  | # in stone now, because in this Makefile we will be using it
 | 
					
						
							|  |  |  | # multiple times (including for release file names and whatnot).
 | 
					
						
							|  |  |  | PROJECT_VERSION := $(PROJECT_VERSION) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
											  
											
												make: Additional cleanup of RabbitMQ components
Because of the monorepo most components do not need to be
listed. Only the community plugins and third party dependencies.
Community plugins can now be fetched and acted on from the top
level Makefile by adding COMMUNITY_PLUGINS=1 to the command line
or the environment. This will fetch and build community plugins:
  make COMMUNITY_PLUGINS=1
Once fetched they can be targeted directly as usual:
  make -C deps/rabbitmq_metronome
This cleanup has a net positive effect on build performance,
especially the performance of the top-level Makefile:
  make nope  0,04s user 0,02s system 106% cpu 0,061 total
  make nope  0,02s user 0,01s system 104% cpu 0,033 total
But also a minor improvement for application Makefiles:
  make -C deps/rabbit nope  0,02s user 0,00s system 98% cpu 0,022 total
  make -C deps/rabbit nope  0,01s user 0,00s system 98% cpu 0,020 total
And that improvement adds up when going through dependencies:
  make -C deps/rabbitmq_management  0,59s user 0,23s system 100% cpu 0,808 total
  make -C deps/rabbitmq_management  0,60s user 0,19s system 101% cpu 0,780 total
											
										 
											2024-07-24 21:56:29 +08:00
										 |  |  | # Fetch/build community plugins.
 | 
					
						
							|  |  |  | #
 | 
					
						
							|  |  |  | # To include community plugins in commands, use
 | 
					
						
							|  |  |  | # `make COMMUNITY_PLUGINS=1` or export the variable.
 | 
					
						
							|  |  |  | # They are not included otherwise. Note that only
 | 
					
						
							|  |  |  | # the top-level Makefile can do this.
 | 
					
						
							|  |  |  | #
 | 
					
						
							|  |  |  | # Note that the community plugins will be fetched using
 | 
					
						
							|  |  |  | # SSH and therefore may be subject to GH authentication.
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ifdef COMMUNITY_PLUGINS | 
					
						
							|  |  |  | DEPS += $(RABBITMQ_COMMUNITY) | 
					
						
							|  |  |  | endif | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | include erlang.mk | 
					
						
							| 
									
										
										
										
											2020-09-07 20:14:10 +08:00
										 |  |  | include mk/github-actions.mk | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-06-27 02:27:34 +08:00
										 |  |  | # If PLUGINS was set when we use run-broker we want to
 | 
					
						
							|  |  |  | # fill in the enabled plugins list. PLUGINS is a more
 | 
					
						
							|  |  |  | # natural space-separated list.
 | 
					
						
							|  |  |  | ifdef PLUGINS | 
					
						
							|  |  |  | RABBITMQ_ENABLED_PLUGINS ?= $(call comma_list,$(PLUGINS)) | 
					
						
							|  |  |  | endif | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | # --------------------------------------------------------------------
 | 
					
						
							| 
									
										
										
										
											2025-03-08 06:25:36 +08:00
										 |  |  | # Distribution - common variables and generic functions.
 | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | # --------------------------------------------------------------------
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | RSYNC ?= rsync | 
					
						
							|  |  |  | RSYNC_V_0 = | 
					
						
							|  |  |  | RSYNC_V_1 = -v | 
					
						
							|  |  |  | RSYNC_V_2 = -v | 
					
						
							|  |  |  | RSYNC_V = $(RSYNC_V_$(V)) | 
					
						
							| 
									
										
										
										
											2025-03-08 02:38:57 +08:00
										 |  |  | BASE_RSYNC_FLAGS += -a $(RSYNC_V) \
 | 
					
						
							|  |  |  | 	       --delete					\
 | 
					
						
							|  |  |  | 	       --delete-excluded			\
 | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | 	       --exclude '.sw?' --exclude '.*.sw?'	\
 | 
					
						
							|  |  |  | 	       --exclude '*.beam'			\
 | 
					
						
							| 
									
										
										
										
											2016-09-22 23:34:18 +08:00
										 |  |  | 	       --exclude '*.d'				\
 | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | 	       --exclude '*.pyc'			\
 | 
					
						
							|  |  |  | 	       --exclude '.git*'			\
 | 
					
						
							|  |  |  | 	       --exclude '.hg*'				\
 | 
					
						
							|  |  |  | 	       --exclude '.*.plt'			\
 | 
					
						
							| 
									
										
										
										
											2023-03-03 19:02:02 +08:00
										 |  |  | 	       --exclude 'erlang_ls.config'		\
 | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | 	       --exclude '$(notdir $(ERLANG_MK_TMP))'	\
 | 
					
						
							| 
									
										
										
										
											2017-01-18 00:34:08 +08:00
										 |  |  | 	       --exclude '_build/'			\
 | 
					
						
							| 
									
										
										
										
											2020-11-16 19:56:53 +08:00
										 |  |  | 	       --exclude '__pycache__/'			\
 | 
					
						
							| 
									
										
										
										
											2023-02-24 19:55:03 +08:00
										 |  |  | 	       --exclude 'tools/'			\
 | 
					
						
							| 
									
										
										
										
											2020-11-16 19:56:53 +08:00
										 |  |  | 	       --exclude 'ci/'				\
 | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | 	       --exclude 'cover/'			\
 | 
					
						
							|  |  |  | 	       --exclude 'deps/'			\
 | 
					
						
							| 
									
										
										
										
											2018-12-20 19:43:15 +08:00
										 |  |  | 	       --exclude 'doc/'				\
 | 
					
						
							| 
									
										
										
										
											2020-02-17 22:02:54 +08:00
										 |  |  | 	       --exclude 'docker/'			\
 | 
					
						
							| 
									
										
										
										
											2016-09-21 15:35:55 +08:00
										 |  |  | 	       --exclude 'ebin/'			\
 | 
					
						
							| 
									
										
										
										
											2016-12-06 02:35:24 +08:00
										 |  |  | 	       --exclude 'erl_crash.dump'		\
 | 
					
						
							| 
									
										
										
										
											2017-02-09 20:20:36 +08:00
										 |  |  | 	       --exclude 'escript/'			\
 | 
					
						
							| 
									
										
										
										
											2016-12-06 02:35:24 +08:00
										 |  |  | 	       --exclude 'MnesiaCore.*'			\
 | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | 	       --exclude '$(notdir $(DEPS_DIR))/'	\
 | 
					
						
							| 
									
										
										
										
											2016-12-06 02:35:24 +08:00
										 |  |  | 	       --exclude 'hexer*'			\
 | 
					
						
							| 
									
										
										
										
											2016-09-21 15:35:55 +08:00
										 |  |  | 	       --exclude 'logs/'			\
 | 
					
						
							| 
									
										
										
										
											2020-11-16 19:56:53 +08:00
										 |  |  | 	       --exclude 'PKG_*.md'			\
 | 
					
						
							| 
									
										
										
										
											2016-10-29 00:59:59 +08:00
										 |  |  | 	       --exclude '/plugins/'			\
 | 
					
						
							|  |  |  | 	       --include 'cli/plugins'			\
 | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | 	       --exclude '$(notdir $(DIST_DIR))/'	\
 | 
					
						
							|  |  |  | 	       --exclude '/$(notdir $(PACKAGES_DIR))/'	\
 | 
					
						
							|  |  |  | 	       --exclude '/PACKAGES/'			\
 | 
					
						
							| 
									
										
										
										
											2017-01-18 00:34:08 +08:00
										 |  |  | 	       --exclude '/amqp_client/doc/'		\
 | 
					
						
							|  |  |  | 	       --exclude '/amqp_client/rebar.config'	\
 | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | 	       --exclude '/cowboy/doc/'			\
 | 
					
						
							|  |  |  | 	       --exclude '/cowboy/examples/'		\
 | 
					
						
							| 
									
										
										
										
											2017-03-07 01:05:29 +08:00
										 |  |  | 	       --exclude '/rabbit/escript/'		\
 | 
					
						
							|  |  |  | 	       --exclude '/rabbitmq_cli/escript/'	\
 | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | 	       --exclude '/rabbitmq_mqtt/test/build/'	\
 | 
					
						
							|  |  |  | 	       --exclude '/rabbitmq_mqtt/test/test_client/'\
 | 
					
						
							| 
									
										
										
										
											2020-11-16 19:56:53 +08:00
										 |  |  | 	       --exclude '/rabbitmq_trust_store/examples/'\
 | 
					
						
							| 
									
										
										
										
											2017-01-18 00:34:08 +08:00
										 |  |  | 	       --exclude '/ranch/doc/'			\
 | 
					
						
							|  |  |  | 	       --exclude '/ranch/examples/'		\
 | 
					
						
							|  |  |  | 	       --exclude '/sockjs/examples/'		\
 | 
					
						
							| 
									
										
										
										
											2025-03-08 02:38:57 +08:00
										 |  |  | 	       --exclude '/workflow_sources/' | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | SOURCE_DIST_RSYNC_FLAGS += $(BASE_RSYNC_FLAGS)          \
 | 
					
						
							|  |  |  | 	       --exclude 'packaging'			\
 | 
					
						
							|  |  |  | 	       --exclude 'test' | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # For source-bundle, explicitly include folders that are needed
 | 
					
						
							|  |  |  | # for tests to execute. These are added before excludes from
 | 
					
						
							|  |  |  | # the base flags so rsync honors the first match.
 | 
					
						
							|  |  |  | SOURCE_BUNDLE_RSYNC_FLAGS += \
 | 
					
						
							|  |  |  | 	       --include 'rabbit_shovel_test/ebin'      \
 | 
					
						
							|  |  |  | 	       --include 'rabbit_shovel_test/ebin/*'    \
 | 
					
						
							|  |  |  | 	       --include 'rabbitmq_ct_helpers/tools'    \
 | 
					
						
							|  |  |  | 	       --include 'rabbitmq_ct_helpers/tools/*'  \
 | 
					
						
							|  |  |  |                $(BASE_RSYNC_FLAGS) | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | TAR ?= tar | 
					
						
							|  |  |  | TAR_V_0 = | 
					
						
							|  |  |  | TAR_V_1 = -v | 
					
						
							|  |  |  | TAR_V_2 = -v | 
					
						
							|  |  |  | TAR_V = $(TAR_V_$(V)) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | GZIP ?= gzip | 
					
						
							|  |  |  | BZIP2 ?= bzip2 | 
					
						
							|  |  |  | XZ ?= xz | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ZIP ?= zip | 
					
						
							|  |  |  | ZIP_V_0 = -q | 
					
						
							|  |  |  | ZIP_V_1 = | 
					
						
							|  |  |  | ZIP_V_2 = | 
					
						
							|  |  |  | ZIP_V = $(ZIP_V_$(V)) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-03-08 06:25:36 +08:00
										 |  |  | ifeq ($(shell tar --version | grep -c "GNU tar"),0) | 
					
						
							|  |  |  | # Skip all flags if this is Darwin (a.k.a. macOS, a.k.a. OS X)
 | 
					
						
							|  |  |  | ifeq ($(shell uname | grep -c "Darwin"),0) | 
					
						
							|  |  |  | TAR_FLAGS_FOR_REPRODUCIBLE_BUILDS = --uid 0 \
 | 
					
						
							|  |  |  | 				    --gid 0 \
 | 
					
						
							|  |  |  | 				    --numeric-owner \
 | 
					
						
							|  |  |  | 				    --no-acls \
 | 
					
						
							|  |  |  | 				    --no-fflags \
 | 
					
						
							|  |  |  | 				    --no-xattrs | 
					
						
							|  |  |  | endif | 
					
						
							|  |  |  | else | 
					
						
							|  |  |  | TAR_FLAGS_FOR_REPRODUCIBLE_BUILDS = --owner 0 \
 | 
					
						
							|  |  |  | 				    --group 0 \
 | 
					
						
							|  |  |  | 				    --numeric-owner | 
					
						
							|  |  |  | endif | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | DIST_SUFFIXES ?= tar.xz | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # Function to create distribution targets
 | 
					
						
							|  |  |  | # Args: $(1) - Full distribution path
 | 
					
						
							|  |  |  | #       $(2) - RSYNC flags to use
 | 
					
						
							|  |  |  | define create_dist_target | 
					
						
							|  |  |  | $(1): $(ERLANG_MK_RECURSIVE_DEPS_LIST) | 
					
						
							|  |  |  | 	$${verbose} mkdir -p $$(dir $$@) | 
					
						
							|  |  |  | 	$${gen_verbose} $${RSYNC} $(2) ./ $$@/ | 
					
						
							|  |  |  | 	$${verbose} echo "$(PROJECT_DESCRIPTION) $(PROJECT_VERSION)" > $$@/git-revisions.txt | 
					
						
							|  |  |  | 	$${verbose} echo "$(PROJECT) $$$$(git rev-parse HEAD) $$$$(git describe --tags --exact-match 2>/dev/null || git symbolic-ref -q --short HEAD)" >> $$@/git-revisions.txt | 
					
						
							|  |  |  | 	$${verbose} echo "$$$$(TZ= git --no-pager log -n 1 --format='%cd' --date='format-local:%Y%m%d%H%M.%S')" > $$@.git-times.txt | 
					
						
							|  |  |  | 	$${verbose} cat packaging/common/LICENSE.head > $$@/LICENSE | 
					
						
							|  |  |  | 	$${verbose} mkdir -p $$@/deps/licensing | 
					
						
							|  |  |  | 	$${verbose} set -e; for dep in $$$$(cat $(ERLANG_MK_RECURSIVE_DEPS_LIST) | LC_COLLATE=C sort); do \
 | 
					
						
							|  |  |  | 		$${RSYNC} $(2) \
 | 
					
						
							|  |  |  | 		 $$$$dep \
 | 
					
						
							|  |  |  | 		 $$@/deps; \
 | 
					
						
							| 
									
										
										
										
											2017-12-07 19:23:24 +08:00
										 |  |  | 		rm -f \
 | 
					
						
							| 
									
										
										
										
											2025-03-08 06:25:36 +08:00
										 |  |  | 		 $$@/deps/rabbit_common/rebar.config \
 | 
					
						
							|  |  |  | 		 $$@/deps/rabbit_common/rebar.lock; \
 | 
					
						
							|  |  |  | 		if test -f $$@/deps/$$$$(basename $$$$dep)/erlang.mk && \
 | 
					
						
							|  |  |  | 		   test "$$$$(wc -l $$@/deps/$$$$(basename $$$$dep)/erlang.mk | awk '{print $$$$1;}')" = "1" && \
 | 
					
						
							|  |  |  | 		   grep -qs -E "^[[:blank:]]*include[[:blank:]]+(erlang\.mk|.*/erlang\.mk)$$$$" $$@/deps/$$$$(basename $$$$dep)/erlang.mk; then \
 | 
					
						
							|  |  |  | 			echo "include ../../erlang.mk" > $$@/deps/$$$$(basename $$$$dep)/erlang.mk; \
 | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | 		fi; \
 | 
					
						
							| 
									
										
										
										
											2025-03-08 06:25:36 +08:00
										 |  |  | 		sed -E -i.bak "s|^[[:blank:]]*include[[:blank:]]+\.\./.*erlang.mk$$$$|include ../../erlang.mk|" \
 | 
					
						
							|  |  |  | 		 $$@/deps/$$$$(basename $$$$dep)/Makefile && \
 | 
					
						
							|  |  |  | 		rm $$@/deps/$$$$(basename $$$$dep)/Makefile.bak; \
 | 
					
						
							|  |  |  | 		if test -f "$$$$dep/license_info"; then \
 | 
					
						
							|  |  |  | 			cp "$$$$dep/license_info" "$$@/deps/licensing/license_info_$$$$(basename $$$$dep)"; \
 | 
					
						
							|  |  |  | 			cat "$$$$dep/license_info" >> $$@/LICENSE; \
 | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | 		fi; \
 | 
					
						
							| 
									
										
										
										
											2025-03-08 06:25:36 +08:00
										 |  |  | 		find "$$$$dep" -maxdepth 1 -name 'LICENSE-*' -exec cp '{}' $$@/deps/licensing \; ; \
 | 
					
						
							|  |  |  | 		(cd $$$$dep; \
 | 
					
						
							|  |  |  | 		 echo "$$$$(basename "$$$$dep") $$$$(git rev-parse HEAD) $$$$(git describe --tags --exact-match 2>/dev/null || git symbolic-ref -q --short HEAD)") \
 | 
					
						
							|  |  |  | 		 >> "$$@/git-revisions.txt"; \
 | 
					
						
							|  |  |  | 		! test -d $$$$dep/.git || (cd $$$$dep; \
 | 
					
						
							|  |  |  | 		 echo "$$$$(env TZ= git --no-pager log -n 1 --format='%cd' --date='format-local:%Y%m%d%H%M.%S')") \
 | 
					
						
							|  |  |  | 		 >> "$$@.git-times.txt"; \
 | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | 	done | 
					
						
							| 
									
										
										
										
											2025-03-08 06:25:36 +08:00
										 |  |  | 	$${verbose} cat packaging/common/LICENSE.tail >> $$@/LICENSE | 
					
						
							|  |  |  | 	$${verbose} find $$@/deps/licensing -name 'LICENSE-*' -exec cp '{}' $$@ \; | 
					
						
							|  |  |  | 	$${verbose} rm -rf $$@/deps/licensing | 
					
						
							|  |  |  | 	$${verbose} for file in $$$$(find $$@ -name '*.app.src'); do \
 | 
					
						
							| 
									
										
										
										
											2016-09-23 20:13:06 +08:00
										 |  |  | 		sed -E -i.bak \
 | 
					
						
							| 
									
										
										
										
											2016-12-06 00:17:29 +08:00
										 |  |  | 		  -e 's/[{]vsn[[:blank:]]*,[[:blank:]]*(""|"0.0.0")[[:blank:]]*}/{vsn, "$(PROJECT_VERSION)"}/' \
 | 
					
						
							| 
									
										
										
										
											2016-12-06 01:14:25 +08:00
										 |  |  | 		  -e 's/[{]broker_version_requirements[[:blank:]]*,[[:blank:]]*\[\][[:blank:]]*}/{broker_version_requirements, ["$(PROJECT_VERSION)"]}/' \
 | 
					
						
							| 
									
										
										
										
											2025-03-08 06:25:36 +08:00
										 |  |  | 		  $$$$file; \
 | 
					
						
							|  |  |  | 		rm $$$$file.bak; \
 | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | 	done | 
					
						
							| 
									
										
										
										
											2025-03-08 06:25:36 +08:00
										 |  |  | 	$${verbose} echo "PLUGINS := $(PLUGINS)" > $$@/plugins.mk | 
					
						
							|  |  |  | 	$${verbose} sort -r < "$$@.git-times.txt" | head -n 1 > "$$@.git-time.txt" | 
					
						
							|  |  |  | 	$${verbose} find $$@ -print0 | xargs -0 touch -t "$$$$(cat $$@.git-time.txt)" | 
					
						
							|  |  |  | 	$${verbose} rm "$$@.git-times.txt" "$$@.git-time.txt" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | $(1).manifest: $(1) | 
					
						
							|  |  |  | 	$${gen_verbose} cd $$(dir $$@) && \
 | 
					
						
							|  |  |  | 		find $$(notdir $$<) | LC_COLLATE=C sort > $$@ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | $(1).tar.xz: $(1).manifest | 
					
						
							|  |  |  | 	$${gen_verbose} cd $$(dir $$@) && \
 | 
					
						
							|  |  |  | 		$${TAR} $${TAR_V} $${TAR_FLAGS_FOR_REPRODUCIBLE_BUILDS} --no-recursion -T $$(notdir $$<) -cf - | \
 | 
					
						
							|  |  |  | 		$${XZ} > $$@ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | $(1).tar.gz: $(1).manifest | 
					
						
							|  |  |  | 	$${gen_verbose} cd $$(dir $$@) && \
 | 
					
						
							|  |  |  | 		$${TAR} $${TAR_V} $${TAR_FLAGS_FOR_REPRODUCIBLE_BUILDS} --no-recursion -T $$(notdir $$<) -cf - | \
 | 
					
						
							|  |  |  | 		$${GZIP} --best > $$@ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | $(1).tar.bz2: $(1).manifest | 
					
						
							|  |  |  | 	$${gen_verbose} cd $$(dir $$@) && \
 | 
					
						
							|  |  |  | 		$${TAR} $${TAR_V} $${TAR_FLAGS_FOR_REPRODUCIBLE_BUILDS} --no-recursion -T $$(notdir $$<) -cf - | \
 | 
					
						
							|  |  |  | 		$${BZIP2} > $$@ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | $(1).zip: $(1).manifest | 
					
						
							|  |  |  | 	$${verbose} rm -f $$@ | 
					
						
							|  |  |  | 	$${gen_verbose} cd $$(dir $$@) && \
 | 
					
						
							|  |  |  | 		$${ZIP} $${ZIP_V} --names-stdin $$@ < $$(notdir $$<) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | endef | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # Function to create clean targets
 | 
					
						
							|  |  |  | # Args: $(1) - Base name (e.g. SOURCE_DIST_BASE or BUNDLE_DIST_BASE)
 | 
					
						
							|  |  |  | define create_clean_targets | 
					
						
							|  |  |  | .PHONY: clean-$(1) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | clean-$(1): | 
					
						
							|  |  |  | 	$${gen_verbose} rm -rf -- $(1)-* | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # Add each clean target to the clean:: rule
 | 
					
						
							|  |  |  | clean:: clean-$(1) | 
					
						
							|  |  |  | endef | 
					
						
							| 
									
										
										
										
											2025-03-08 02:38:57 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-03-08 06:25:36 +08:00
										 |  |  | # --------------------------------------------------------------------
 | 
					
						
							|  |  |  | # Distribution - public targets
 | 
					
						
							|  |  |  | # --------------------------------------------------------------------
 | 
					
						
							| 
									
										
										
										
											2025-03-08 02:38:57 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-03-08 06:25:36 +08:00
										 |  |  | SOURCE_DIST_BASE ?= rabbitmq-server | 
					
						
							|  |  |  | SOURCE_DIST ?= $(PACKAGES_DIR)/$(SOURCE_DIST_BASE)-$(PROJECT_VERSION) | 
					
						
							|  |  |  | SOURCE_DIST_FILES = $(addprefix $(SOURCE_DIST).,$(DIST_SUFFIXES)) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | .PHONY: source-dist | 
					
						
							|  |  |  | source-dist: $(SOURCE_DIST_FILES) | 
					
						
							|  |  |  | 	@: | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | $(eval $(call create_dist_target,$(SOURCE_DIST),$(SOURCE_DIST_RSYNC_FLAGS))) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | SOURCE_BUNDLE_BASE ?= rabbitmq-server-bundle | 
					
						
							|  |  |  | SOURCE_BUNDLE_DIST ?= $(PACKAGES_DIR)/$(SOURCE_BUNDLE_BASE)-$(PROJECT_VERSION) | 
					
						
							|  |  |  | SOURCE_BUNDLE_FILES = $(addprefix $(SOURCE_BUNDLE_DIST).,$(DIST_SUFFIXES)) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | .PHONY: source-bundle | 
					
						
							|  |  |  | source-bundle: $(SOURCE_BUNDLE_FILES) | 
					
						
							|  |  |  | 	@: | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | $(eval $(call create_dist_target,$(SOURCE_BUNDLE_DIST),$(SOURCE_BUNDLE_RSYNC_FLAGS))) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # Create the clean targets for both distributions
 | 
					
						
							|  |  |  | $(eval $(call create_clean_targets,$(SOURCE_DIST_BASE))) | 
					
						
							|  |  |  | $(eval $(call create_clean_targets,$(SOURCE_BUNDLE_BASE))) | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-03-08 06:25:36 +08:00
										 |  |  | .PHONY: distclean-packages clean-unpacked-source-dist | 
					
						
							| 
									
										
										
										
											2025-03-08 02:38:57 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-01-18 17:55:18 +08:00
										 |  |  | distclean:: distclean-packages | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | distclean-packages: | 
					
						
							|  |  |  | 	$(gen_verbose) rm -rf -- $(PACKAGES_DIR) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-10-29 00:59:59 +08:00
										 |  |  | ## If a dependency doesn't have a clean target - do not call it
 | 
					
						
							| 
									
										
										
										
											2016-10-19 22:41:53 +08:00
										 |  |  | clean-unpacked-source-dist: | 
					
						
							|  |  |  | 	for d in deps/*; do \
 | 
					
						
							|  |  |  | 		if test -f $$d/Makefile; then \
 | 
					
						
							| 
									
										
										
										
											2016-10-29 00:59:59 +08:00
										 |  |  | 			(! make -n clean) || (make -C $$d clean || exit $$?); \
 | 
					
						
							| 
									
										
										
										
											2016-10-19 22:41:53 +08:00
										 |  |  | 		fi; \
 | 
					
						
							|  |  |  | 	done | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-06-22 18:26:27 +08:00
										 |  |  | clean-deps: | 
					
						
							|  |  |  | 	git clean -xfffd deps | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | # --------------------------------------------------------------------
 | 
					
						
							|  |  |  | # Packaging.
 | 
					
						
							|  |  |  | # --------------------------------------------------------------------
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | .PHONY: packages package-deb \ | 
					
						
							|  |  |  | 	package-rpm package-rpm-fedora package-rpm-suse \
 | 
					
						
							| 
									
										
										
										
											2019-08-13 01:07:45 +08:00
										 |  |  | 	package-windows \
 | 
					
						
							| 
									
										
										
										
											2020-11-16 19:18:39 +08:00
										 |  |  | 	package-generic-unix \
 | 
					
						
							|  |  |  | 	docker-image | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | # This variable is exported so sub-make instances know where to find the
 | 
					
						
							|  |  |  | # archive.
 | 
					
						
							|  |  |  | PACKAGES_SOURCE_DIST_FILE ?= $(firstword $(SOURCE_DIST_FILES)) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-02-26 17:47:14 +08:00
										 |  |  | RABBITMQ_PACKAGING_TARGETS = package-deb package-rpm \
 | 
					
						
							| 
									
										
										
										
											2025-02-18 05:08:00 +08:00
										 |  |  | package-rpm-redhat package-rpm-fedora package-rpm-rhel8 \ | 
					
						
							|  |  |  | package-rpm-suse package-rpm-opensuse \ | 
					
						
							| 
									
										
										
										
											2021-02-26 17:47:14 +08:00
										 |  |  | package-windows | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ifneq ($(filter $(RABBITMQ_PACKAGING_TARGETS),$(MAKECMDGOALS)),) | 
					
						
							|  |  |  | ifeq ($(RABBITMQ_PACKAGING_REPO),) | 
					
						
							|  |  |  | $(error Cannot find rabbitmq-packaging repository dir; please clone from rabbitmq/rabbitmq-packaging and specify RABBITMQ_PACKAGING_REPO) | 
					
						
							|  |  |  | endif | 
					
						
							|  |  |  | endif | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | $(RABBITMQ_PACKAGING_TARGETS): $(PACKAGES_SOURCE_DIST_FILE) | 
					
						
							|  |  |  | 	$(verbose) $(MAKE) -C $(RABBITMQ_PACKAGING_REPO) $@ \
 | 
					
						
							|  |  |  | 		SOURCE_DIST_FILE=$(abspath $(PACKAGES_SOURCE_DIST_FILE)) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-11-16 19:18:39 +08:00
										 |  |  | package-generic-unix \ | 
					
						
							|  |  |  | docker-image: $(PACKAGES_SOURCE_DIST_FILE) | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | 	$(verbose) $(MAKE) -C packaging $@ \
 | 
					
						
							|  |  |  | 		SOURCE_DIST_FILE=$(abspath $(PACKAGES_SOURCE_DIST_FILE)) | 
					
						
							| 
									
										
										
										
											2016-09-21 18:23:01 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-02-26 17:47:14 +08:00
										 |  |  | packages: package-deb package-rpm package-windows package-generic-unix | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-09-21 18:23:01 +08:00
										 |  |  | # --------------------------------------------------------------------
 | 
					
						
							| 
									
										
										
										
											2016-09-22 23:35:31 +08:00
										 |  |  | # Installation.
 | 
					
						
							| 
									
										
										
										
											2016-09-21 18:23:01 +08:00
										 |  |  | # --------------------------------------------------------------------
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-09-22 23:35:31 +08:00
										 |  |  | .PHONY: manpages web-manpages distclean-manpages | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | manpages web-manpages distclean-manpages: | 
					
						
							|  |  |  | 	$(MAKE) -C $(DEPS_DIR)/rabbit $@ DEPS_DIR=$(DEPS_DIR) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | .PHONY: install install-erlapp install-scripts install-bin install-man \ | 
					
						
							|  |  |  | 	install-windows install-windows-erlapp install-windows-scripts \
 | 
					
						
							|  |  |  | 	install-windows-docs | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | DESTDIR ?= | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | PREFIX ?= /usr/local | 
					
						
							| 
									
										
										
										
											2016-12-06 00:17:29 +08:00
										 |  |  | WINDOWS_PREFIX ?= rabbitmq-server-windows-$(PROJECT_VERSION) | 
					
						
							| 
									
										
										
										
											2016-09-22 23:35:31 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | MANDIR ?= $(PREFIX)/share/man | 
					
						
							|  |  |  | RMQ_ROOTDIR ?= $(PREFIX)/lib/erlang | 
					
						
							|  |  |  | RMQ_BINDIR ?= $(RMQ_ROOTDIR)/bin | 
					
						
							|  |  |  | RMQ_LIBDIR ?= $(RMQ_ROOTDIR)/lib | 
					
						
							| 
									
										
										
										
											2016-12-06 00:17:29 +08:00
										 |  |  | RMQ_ERLAPP_DIR ?= $(RMQ_LIBDIR)/rabbitmq_server-$(PROJECT_VERSION) | 
					
						
							| 
									
										
										
										
											2017-01-25 01:00:13 +08:00
										 |  |  | RMQ_AUTOCOMPLETE_DIR ?= $(RMQ_ROOTDIR)/autocomplete | 
					
						
							| 
									
										
										
										
											2016-09-22 23:35:31 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | SCRIPTS = rabbitmq-defaults \
 | 
					
						
							|  |  |  | 	  rabbitmq-env \
 | 
					
						
							|  |  |  | 	  rabbitmq-server \
 | 
					
						
							|  |  |  | 	  rabbitmqctl \
 | 
					
						
							| 
									
										
										
										
											2016-09-23 20:13:06 +08:00
										 |  |  | 	  rabbitmq-plugins \
 | 
					
						
							| 
									
										
										
										
											2016-10-31 19:36:56 +08:00
										 |  |  | 	  rabbitmq-diagnostics \
 | 
					
						
							| 
									
										
										
										
											2019-02-26 18:46:52 +08:00
										 |  |  | 	  rabbitmq-queues \
 | 
					
						
							| 
									
										
										
										
											2021-03-22 21:18:08 +08:00
										 |  |  | 	  rabbitmq-upgrade \
 | 
					
						
							| 
									
										
										
										
											2021-11-30 22:43:42 +08:00
										 |  |  | 	  rabbitmq-streams \
 | 
					
						
							| 
									
										
										
										
											2023-02-16 20:39:20 +08:00
										 |  |  | 	  vmware-rabbitmq | 
					
						
							| 
									
										
										
										
											2016-09-22 23:35:31 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-01-25 01:00:13 +08:00
										 |  |  | AUTOCOMPLETE_SCRIPTS = bash_autocomplete.sh zsh_autocomplete.sh | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-09-22 23:35:31 +08:00
										 |  |  | WINDOWS_SCRIPTS = rabbitmq-defaults.bat \
 | 
					
						
							|  |  |  | 		  rabbitmq-echopid.bat \
 | 
					
						
							|  |  |  | 		  rabbitmq-env.bat \
 | 
					
						
							|  |  |  | 		  rabbitmq-plugins.bat \
 | 
					
						
							| 
									
										
										
										
											2016-10-31 19:36:56 +08:00
										 |  |  | 		  rabbitmq-diagnostics.bat \
 | 
					
						
							| 
									
										
										
										
											2019-02-26 18:46:52 +08:00
										 |  |  | 		  rabbitmq-queues.bat \
 | 
					
						
							| 
									
										
										
										
											2016-09-22 23:35:31 +08:00
										 |  |  | 		  rabbitmq-server.bat \
 | 
					
						
							|  |  |  | 		  rabbitmq-service.bat \
 | 
					
						
							| 
									
										
										
										
											2019-09-23 21:39:34 +08:00
										 |  |  | 		  rabbitmq-upgrade.bat \
 | 
					
						
							| 
									
										
										
										
											2021-03-22 21:18:08 +08:00
										 |  |  | 		  rabbitmq-streams.bat \
 | 
					
						
							| 
									
										
										
										
											2023-02-16 20:39:20 +08:00
										 |  |  | 		  vmware-rabbitmq.bat \
 | 
					
						
							| 
									
										
										
										
											2019-07-24 16:48:47 +08:00
										 |  |  | 		  rabbitmqctl.bat | 
					
						
							| 
									
										
										
										
											2016-09-22 23:35:31 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | UNIX_TO_DOS ?= todos | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | inst_verbose_0 = @echo " INST  " $@; | 
					
						
							|  |  |  | inst_verbose = $(inst_verbose_$(V)) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | install: install-erlapp install-scripts | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | install-erlapp: dist | 
					
						
							|  |  |  | 	$(verbose) mkdir -p $(DESTDIR)$(RMQ_ERLAPP_DIR) | 
					
						
							|  |  |  | 	$(inst_verbose) cp -r \
 | 
					
						
							|  |  |  | 		LICENSE* \
 | 
					
						
							|  |  |  | 		$(DEPS_DIR)/rabbit/INSTALL \
 | 
					
						
							|  |  |  | 		$(DIST_DIR) \
 | 
					
						
							|  |  |  | 		$(DESTDIR)$(RMQ_ERLAPP_DIR) | 
					
						
							|  |  |  | 	$(verbose) echo "Put your EZs here and use rabbitmq-plugins to enable them." \
 | 
					
						
							|  |  |  | 		> $(DESTDIR)$(RMQ_ERLAPP_DIR)/$(notdir $(DIST_DIR))/README | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-09 20:20:25 +08:00
										 |  |  | CLI_ESCRIPTS_DIR = escript | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-10-27 22:49:52 +08:00
										 |  |  | install-escripts: | 
					
						
							| 
									
										
										
										
											2017-02-09 20:20:25 +08:00
										 |  |  | 	$(verbose) $(MAKE) -C $(DEPS_DIR)/rabbitmq_cli install \
 | 
					
						
							|  |  |  | 		PREFIX="$(RMQ_ERLAPP_DIR)/$(CLI_ESCRIPTS_DIR)" | 
					
						
							| 
									
										
										
										
											2016-10-27 22:49:52 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | install-scripts: install-escripts | 
					
						
							| 
									
										
										
										
											2016-09-22 23:35:31 +08:00
										 |  |  | 	$(verbose) mkdir -p $(DESTDIR)$(RMQ_ERLAPP_DIR)/sbin | 
					
						
							|  |  |  | 	$(inst_verbose) for script in $(SCRIPTS); do \
 | 
					
						
							|  |  |  | 		cp "$(DEPS_DIR)/rabbit/scripts/$$script" \
 | 
					
						
							|  |  |  | 			"$(DESTDIR)$(RMQ_ERLAPP_DIR)/sbin"; \
 | 
					
						
							|  |  |  | 		chmod 0755 "$(DESTDIR)$(RMQ_ERLAPP_DIR)/sbin/$$script"; \
 | 
					
						
							|  |  |  | 	done | 
					
						
							| 
									
										
										
										
											2017-01-17 01:57:42 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-09-22 23:35:31 +08:00
										 |  |  | # FIXME: We do symlinks to scripts in $(RMQ_ERLAPP_DIR))/sbin but this
 | 
					
						
							|  |  |  | # code assumes a certain hierarchy to make relative symlinks.
 | 
					
						
							| 
									
										
										
										
											2017-01-25 01:00:13 +08:00
										 |  |  | install-bin: install-scripts install-autocomplete-scripts | 
					
						
							| 
									
										
										
										
											2016-09-22 23:35:31 +08:00
										 |  |  | 	$(verbose) mkdir -p $(DESTDIR)$(RMQ_BINDIR) | 
					
						
							|  |  |  | 	$(inst_verbose) for script in $(SCRIPTS); do \
 | 
					
						
							|  |  |  | 		test -e $(DESTDIR)$(RMQ_BINDIR)/$$script || \
 | 
					
						
							|  |  |  | 			ln -sf ../lib/$(notdir $(RMQ_ERLAPP_DIR))/sbin/$$script \
 | 
					
						
							|  |  |  | 			 $(DESTDIR)$(RMQ_BINDIR)/$$script; \
 | 
					
						
							|  |  |  | 	done | 
					
						
							| 
									
										
										
										
											2016-09-21 18:23:01 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-01-25 01:00:13 +08:00
										 |  |  | install-autocomplete-scripts: | 
					
						
							|  |  |  | 	$(verbose) mkdir -p $(DESTDIR)$(RMQ_AUTOCOMPLETE_DIR) | 
					
						
							|  |  |  | 	$(inst_verbose) for script in $(AUTOCOMPLETE_SCRIPTS); do \
 | 
					
						
							| 
									
										
										
										
											2017-01-25 02:02:52 +08:00
										 |  |  | 		cp "scripts/$$script" \
 | 
					
						
							|  |  |  | 			"$(DESTDIR)$(RMQ_AUTOCOMPLETE_DIR)" && \
 | 
					
						
							|  |  |  | 		chmod 0755 "$(DESTDIR)$(RMQ_AUTOCOMPLETE_DIR)/$$script"; \
 | 
					
						
							| 
									
										
										
										
											2017-01-25 01:00:13 +08:00
										 |  |  | 	done | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-09-22 23:35:31 +08:00
										 |  |  | install-man: manpages | 
					
						
							|  |  |  | 	$(inst_verbose) sections=$$(ls -1 $(DEPS_DIR)/rabbit/docs/*.[1-9] \
 | 
					
						
							|  |  |  | 		| sed -E 's/.*\.([1-9])$$/\1/' | uniq | sort); \
 | 
					
						
							|  |  |  | 	for section in $$sections; do \
 | 
					
						
							|  |  |  | 		mkdir -p $(DESTDIR)$(MANDIR)/man$$section; \
 | 
					
						
							|  |  |  | 		for manpage in $(DEPS_DIR)/rabbit/docs/*.$$section; do \
 | 
					
						
							|  |  |  | 			gzip < $$manpage \
 | 
					
						
							|  |  |  | 			 > $(DESTDIR)$(MANDIR)/man$$section/$$(basename $$manpage).gz; \
 | 
					
						
							|  |  |  | 		done; \
 | 
					
						
							|  |  |  | 	done | 
					
						
							| 
									
										
										
										
											2016-09-21 18:23:01 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-09-22 23:35:31 +08:00
										 |  |  | install-windows: install-windows-erlapp install-windows-scripts install-windows-docs | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | install-windows-erlapp: dist | 
					
						
							|  |  |  | 	$(verbose) mkdir -p $(DESTDIR)$(WINDOWS_PREFIX) | 
					
						
							|  |  |  | 	$(inst_verbose) cp -r \
 | 
					
						
							|  |  |  | 		LICENSE* \
 | 
					
						
							|  |  |  | 		$(DEPS_DIR)/rabbit/INSTALL \
 | 
					
						
							|  |  |  | 		$(DIST_DIR) \
 | 
					
						
							|  |  |  | 		$(DESTDIR)$(WINDOWS_PREFIX) | 
					
						
							|  |  |  | 	$(verbose) echo "Put your EZs here and use rabbitmq-plugins.bat to enable them." \
 | 
					
						
							|  |  |  | 		> $(DESTDIR)$(WINDOWS_PREFIX)/$(notdir $(DIST_DIR))/README.txt | 
					
						
							|  |  |  | 	$(verbose) $(UNIX_TO_DOS) $(DESTDIR)$(WINDOWS_PREFIX)/plugins/README.txt | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-11-03 19:47:02 +08:00
										 |  |  | install-windows-escripts: | 
					
						
							| 
									
										
										
										
											2017-02-09 20:20:25 +08:00
										 |  |  | 	$(verbose) $(MAKE) -C $(DEPS_DIR)/rabbitmq_cli install \
 | 
					
						
							|  |  |  | 		PREFIX="$(WINDOWS_PREFIX)/$(CLI_ESCRIPTS_DIR)" | 
					
						
							| 
									
										
										
										
											2016-11-03 19:47:02 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | install-windows-scripts: install-windows-escripts | 
					
						
							| 
									
										
										
										
											2016-09-22 23:35:31 +08:00
										 |  |  | 	$(verbose) mkdir -p $(DESTDIR)$(WINDOWS_PREFIX)/sbin | 
					
						
							|  |  |  | 	$(inst_verbose) for script in $(WINDOWS_SCRIPTS); do \
 | 
					
						
							|  |  |  | 		cp "$(DEPS_DIR)/rabbit/scripts/$$script" \
 | 
					
						
							|  |  |  | 			"$(DESTDIR)$(WINDOWS_PREFIX)/sbin"; \
 | 
					
						
							|  |  |  | 		chmod 0755 "$(DESTDIR)$(WINDOWS_PREFIX)/sbin/$$script"; \
 | 
					
						
							|  |  |  | 	done | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | install-windows-docs: install-windows-erlapp | 
					
						
							|  |  |  | 	$(verbose) mkdir -p $(DESTDIR)$(WINDOWS_PREFIX)/etc | 
					
						
							| 
									
										
										
										
											2018-11-08 06:52:20 +08:00
										 |  |  | 	$(inst_verbose) man $(DEPS_DIR)/rabbit/docs/rabbitmq-service.8 > tmp-readme-service.txt | 
					
						
							|  |  |  | 	$(verbose) col -bx < ./tmp-readme-service.txt > $(DESTDIR)$(WINDOWS_PREFIX)/readme-service.txt | 
					
						
							|  |  |  | 	$(verbose) rm -f ./tmp-readme-service.txt | 
					
						
							| 
									
										
										
										
											2016-09-22 23:35:31 +08:00
										 |  |  | 	$(verbose) for file in \
 | 
					
						
							|  |  |  | 	 $(DESTDIR)$(WINDOWS_PREFIX)/readme-service.txt \
 | 
					
						
							|  |  |  | 	 $(DESTDIR)$(WINDOWS_PREFIX)/LICENSE* \
 | 
					
						
							| 
									
										
										
										
											2019-09-24 16:04:56 +08:00
										 |  |  | 	 $(DESTDIR)$(WINDOWS_PREFIX)/INSTALL; do \
 | 
					
						
							| 
									
										
										
										
											2016-09-22 23:35:31 +08:00
										 |  |  | 		$(UNIX_TO_DOS) "$$file"; \
 | 
					
						
							|  |  |  | 		case "$$file" in \
 | 
					
						
							|  |  |  | 		*.txt) ;; \
 | 
					
						
							|  |  |  | 		*.example) ;; \
 | 
					
						
							|  |  |  | 		*) mv "$$file" "$$file.txt" ;; \
 | 
					
						
							|  |  |  | 		esac; \
 | 
					
						
							|  |  |  | 	done | 
					
						
							| 
									
										
										
										
											2024-06-06 17:37:10 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | INTERNAL_DEPS := \
 | 
					
						
							|  |  |  | 	   amqp10_client \
 | 
					
						
							|  |  |  | 	   amqp10_common \
 | 
					
						
							|  |  |  | 	   amqp_client \
 | 
					
						
							|  |  |  | 	   oauth2_client \
 | 
					
						
							|  |  |  | 	   rabbit_common \
 | 
					
						
							|  |  |  | 	   rabbitmq_ct_client_helpers \
 | 
					
						
							|  |  |  | 	   rabbitmq_ct_helpers \
 | 
					
						
							|  |  |  | 	   rabbitmq_stream_common \
 | 
					
						
							|  |  |  | 	   trust_store_http | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | TIER1_PLUGINS := \
 | 
					
						
							|  |  |  | 	   rabbitmq_amqp_client \
 | 
					
						
							|  |  |  | 	   rabbitmq_amqp1_0 \
 | 
					
						
							|  |  |  | 	   rabbitmq_auth_backend_cache \
 | 
					
						
							|  |  |  | 	   rabbitmq_auth_backend_http \
 | 
					
						
							|  |  |  | 	   rabbitmq_auth_backend_ldap \
 | 
					
						
							|  |  |  | 	   rabbitmq_auth_backend_oauth2 \
 | 
					
						
							|  |  |  | 	   rabbitmq_auth_mechanism_ssl \
 | 
					
						
							|  |  |  | 	   rabbitmq_aws \
 | 
					
						
							|  |  |  | 	   rabbitmq_consistent_hash_exchange \
 | 
					
						
							|  |  |  | 	   rabbitmq_event_exchange \
 | 
					
						
							|  |  |  | 	   rabbitmq_federation \
 | 
					
						
							|  |  |  | 	   rabbitmq_federation_management \
 | 
					
						
							| 
									
										
										
										
											2024-08-07 10:20:12 +08:00
										 |  |  | 	   rabbitmq_federation_prometheus \
 | 
					
						
							| 
									
										
										
										
											2024-06-06 17:37:10 +08:00
										 |  |  | 	   rabbitmq_jms_topic_exchange \
 | 
					
						
							|  |  |  | 	   rabbitmq_management \
 | 
					
						
							|  |  |  | 	   rabbitmq_management_agent \
 | 
					
						
							|  |  |  | 	   rabbitmq_mqtt \
 | 
					
						
							|  |  |  | 	   rabbitmq_peer_discovery_aws \
 | 
					
						
							|  |  |  | 	   rabbitmq_peer_discovery_common \
 | 
					
						
							|  |  |  | 	   rabbitmq_peer_discovery_consul \
 | 
					
						
							|  |  |  | 	   rabbitmq_peer_discovery_etcd \
 | 
					
						
							|  |  |  | 	   rabbitmq_peer_discovery_k8s \
 | 
					
						
							|  |  |  | 	   rabbitmq_prelaunch \
 | 
					
						
							|  |  |  | 	   rabbitmq_prometheus \
 | 
					
						
							|  |  |  | 	   rabbitmq_random_exchange \
 | 
					
						
							|  |  |  | 	   rabbitmq_recent_history_exchange \
 | 
					
						
							|  |  |  | 	   rabbitmq_sharding \
 | 
					
						
							|  |  |  | 	   rabbitmq_shovel \
 | 
					
						
							|  |  |  | 	   rabbitmq_shovel_management \
 | 
					
						
							| 
									
										
										
										
											2024-08-07 10:20:12 +08:00
										 |  |  | 	   rabbitmq_shovel_prometheus \
 | 
					
						
							| 
									
										
										
										
											2024-06-06 17:37:10 +08:00
										 |  |  | 	   rabbitmq_stomp \
 | 
					
						
							|  |  |  | 	   rabbitmq_stream \
 | 
					
						
							|  |  |  | 	   rabbitmq_stream_management \
 | 
					
						
							|  |  |  | 	   rabbitmq_top \
 | 
					
						
							|  |  |  | 	   rabbitmq_tracing \
 | 
					
						
							|  |  |  | 	   rabbitmq_trust_store \
 | 
					
						
							|  |  |  | 	   rabbitmq_web_dispatch \
 | 
					
						
							|  |  |  | 	   rabbitmq_web_mqtt \
 | 
					
						
							|  |  |  | 	   rabbitmq_web_mqtt_examples \
 | 
					
						
							|  |  |  | 	   rabbitmq_web_stomp \
 | 
					
						
							|  |  |  | 	   rabbitmq_web_stomp_examples | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | YTT ?= ytt | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | actions-workflows: .github/workflows/test.yaml .github/workflows/test-mixed-versions.yaml | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | .PHONY: .github/workflows/test.yaml .github/workflows/test-mixed-versions.yaml | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | .github/workflows/test.yaml: .github/workflows/templates/test.template.yaml | 
					
						
							|  |  |  | 	$(gen_verbose) $(YTT) \
 | 
					
						
							|  |  |  | 		--file $< \
 | 
					
						
							|  |  |  | 		--data-value-yaml internal_deps=[$(subst $(space),$(comma),$(foreach s,$(INTERNAL_DEPS),"$s"))] \
 | 
					
						
							|  |  |  | 		--data-value-yaml tier1_plugins=[$(subst $(space),$(comma),$(foreach s,$(TIER1_PLUGINS),"$s"))] \
 | 
					
						
							|  |  |  | 		| sed 's/^true:/on:/' \
 | 
					
						
							|  |  |  | 		| sed 's/pull_request: null/pull_request:/'> $@ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | .github/workflows/test-mixed-versions.yaml: .github/workflows/templates/test-mixed-versions.template.yaml | 
					
						
							|  |  |  | 	$(gen_verbose) $(YTT) \
 | 
					
						
							|  |  |  | 		--file $< \
 | 
					
						
							|  |  |  | 		--data-value-yaml internal_deps=[$(subst $(space),$(comma),$(foreach s,$(INTERNAL_DEPS),"$s"))] \
 | 
					
						
							|  |  |  | 		--data-value-yaml tier1_plugins=[$(subst $(space),$(comma),$(foreach s,$(TIER1_PLUGINS),"$s"))] \
 | 
					
						
							|  |  |  | 		| sed 's/^true:/on:/' \
 | 
					
						
							|  |  |  | 		| sed 's/pull_request: null/pull_request:/'> $@ |