| 
									
										
										
										
											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.
 | 
					
						
							| 
									
										
										
										
											2016-12-09 02:02:49 +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,
 | 
					
						
							|  |  |  | # on top of the standard plugins. For example, looking_glass.
 | 
					
						
							|  |  |  | #
 | 
					
						
							|  |  |  | # Note: When including NIFs in a release make sure to build
 | 
					
						
							|  |  |  | # them on the appropriate platform for the target environment.
 | 
					
						
							|  |  |  | # For example build looking_glass on Linux when targeting Docker.
 | 
					
						
							|  |  |  | 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 \
 | 
					
						
							|  |  |  | 	      rabbit_common/mk/rabbitmq-run.mk \
 | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | 	      rabbit_common/mk/rabbitmq-tools.mk | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-11-10 17:40:02 +08:00
										 |  |  | DISABLE_DISTCLEAN = 1 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-05-31 19:51:12 +08:00
										 |  |  | XREF_SCOPE = app deps | 
					
						
							| 
									
										
										
										
											2022-05-31 20:19:54 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | # We add all the applications that are in non-standard paths
 | 
					
						
							|  |  |  | # so they are included in the analyses as well.
 | 
					
						
							| 
									
										
										
										
											2024-04-16 20:26:38 +08:00
										 |  |  | XREF_EXTRA_APP_DIRS = $(filter-out deps/rabbitmq_cli/_build/dev/lib/rabbit_common/,$(wildcard deps/rabbitmq_cli/_build/dev/lib/*/)) deps/rabbitmq_prelaunch/ | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											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.
 | 
					
						
							|  |  |  | xref: ERL_LIBS := $(ERL_LIBS):$(CURDIR)/apps:$(CURDIR)/deps:$(dir $(shell elixir --eval ":io.format '~s~n', [:code.lib_dir :elixir ]")) | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-12-20 23:52:22 +08:00
										 |  |  | ifneq ($(wildcard deps/.hex/cache.erl),) | 
					
						
							| 
									
										
										
										
											2018-12-20 19:43:15 +08:00
										 |  |  | deps:: restore-hex-cache-ets-file | 
					
						
							| 
									
										
										
										
											2018-12-20 23:52:22 +08:00
										 |  |  | endif | 
					
						
							| 
									
										
										
										
											2018-12-20 19:43:15 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | include rabbitmq-components.mk | 
					
						
							|  |  |  | include erlang.mk | 
					
						
							| 
									
										
										
										
											2020-09-07 20:14:10 +08:00
										 |  |  | include mk/github-actions.mk | 
					
						
							| 
									
										
										
										
											2021-07-20 17:53:39 +08:00
										 |  |  | include mk/bazel.mk | 
					
						
							| 
									
										
										
										
											2020-09-08 20:06:30 +08:00
										 |  |  | include mk/topic-branches.mk | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-12-20 19:43:15 +08:00
										 |  |  | # --------------------------------------------------------------------
 | 
					
						
							|  |  |  | # Mix Hex cache management.
 | 
					
						
							|  |  |  | # --------------------------------------------------------------------
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # We restore the initial Hex cache.ets file from an Erlang term created
 | 
					
						
							|  |  |  | # at the time the source archive was prepared.
 | 
					
						
							|  |  |  | #
 | 
					
						
							|  |  |  | # See the `$(SOURCE_DIST)` recipe for the reason behind this step.
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | restore-hex-cache-ets-file: deps/.hex/cache.ets | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | deps/.hex/cache.ets: deps/.hex/cache.erl | 
					
						
							|  |  |  | 	$(gen_verbose) $(call erlang,$(call restore_hex_cache_from_erl_term,$<,$@)) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | define restore_hex_cache_from_erl_term | 
					
						
							|  |  |  |   In = "$(1)", | 
					
						
							|  |  |  |   Out = "$(2)", | 
					
						
							|  |  |  |   {ok, [Props, Entries]} = file:consult(In), | 
					
						
							|  |  |  |   Name = proplists:get_value(name, Props), | 
					
						
							|  |  |  |   Type = proplists:get_value(type, Props), | 
					
						
							|  |  |  |   Access = proplists:get_value(protection, Props), | 
					
						
							|  |  |  |   NamedTable = proplists:get_bool(named_table, Props), | 
					
						
							|  |  |  |   Keypos = proplists:get_value(keypos, Props), | 
					
						
							|  |  |  |   Heir = proplists:get_value(heir, Props), | 
					
						
							|  |  |  |   ReadConc = proplists:get_bool(read_concurrency, Props), | 
					
						
							|  |  |  |   WriteConc = proplists:get_bool(write_concurrency, Props), | 
					
						
							|  |  |  |   Compressed = proplists:get_bool(compressed, Props), | 
					
						
							|  |  |  |   Options0 = [ | 
					
						
							|  |  |  |     Type, | 
					
						
							|  |  |  |     Access, | 
					
						
							|  |  |  |     {keypos, Keypos}, | 
					
						
							|  |  |  |     {heir, Heir}, | 
					
						
							|  |  |  |     {read_concurrency, ReadConc}, | 
					
						
							|  |  |  |     {write_concurrency, WriteConc}], | 
					
						
							|  |  |  |   Options1 = case NamedTable of | 
					
						
							|  |  |  |     true  -> [named_table | Options0]; | 
					
						
							|  |  |  |     false -> Options0 | 
					
						
							|  |  |  |   end, | 
					
						
							|  |  |  |   Options2 = case Compressed of | 
					
						
							|  |  |  |     true  -> [compressed | Options0]; | 
					
						
							|  |  |  |     false -> Options0 | 
					
						
							|  |  |  |   end, | 
					
						
							|  |  |  |   Tab = ets:new(Name, Options2), | 
					
						
							|  |  |  |   [true = ets:insert(Tab, Entry) || Entry <- Entries], | 
					
						
							|  |  |  |   ok = ets:tab2file(Tab, Out), | 
					
						
							|  |  |  |   init:stop(). | 
					
						
							|  |  |  | endef | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | # --------------------------------------------------------------------
 | 
					
						
							|  |  |  | # Distribution.
 | 
					
						
							|  |  |  | # --------------------------------------------------------------------
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | .PHONY: source-dist clean-source-dist | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | SOURCE_DIST_BASE ?= rabbitmq-server | 
					
						
							| 
									
										
										
										
											2018-10-01 22:26:18 +08:00
										 |  |  | SOURCE_DIST_SUFFIXES ?= tar.xz | 
					
						
							| 
									
										
										
										
											2016-12-06 00:17:29 +08:00
										 |  |  | SOURCE_DIST ?= $(PACKAGES_DIR)/$(SOURCE_DIST_BASE)-$(PROJECT_VERSION) | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | # The first source distribution file is used by packages: if the archive
 | 
					
						
							|  |  |  | # type changes, you must update all packages' Makefile.
 | 
					
						
							|  |  |  | SOURCE_DIST_FILES = $(addprefix $(SOURCE_DIST).,$(SOURCE_DIST_SUFFIXES)) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | .PHONY: $(SOURCE_DIST_FILES) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | source-dist: $(SOURCE_DIST_FILES) | 
					
						
							|  |  |  | 	@: | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | RSYNC ?= rsync | 
					
						
							|  |  |  | RSYNC_V_0 = | 
					
						
							|  |  |  | RSYNC_V_1 = -v | 
					
						
							|  |  |  | RSYNC_V_2 = -v | 
					
						
							|  |  |  | RSYNC_V = $(RSYNC_V_$(V)) | 
					
						
							|  |  |  | RSYNC_FLAGS += -a $(RSYNC_V)		\
 | 
					
						
							|  |  |  | 	       --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*'				\
 | 
					
						
							| 
									
										
										
										
											2020-11-16 19:56:53 +08:00
										 |  |  | 	       --exclude '.travis.yml*'			\
 | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | 	       --exclude '.*.plt'			\
 | 
					
						
							| 
									
										
										
										
											2023-02-24 19:55:03 +08:00
										 |  |  | 	       --exclude '*.bzl'			\
 | 
					
						
							|  |  |  | 	       --exclude '*.bazel'			\
 | 
					
						
							|  |  |  | 	       --exclude '*.bazelrc'			\
 | 
					
						
							|  |  |  | 	       --exclude 'moduleindex.yaml'		\
 | 
					
						
							|  |  |  | 	       --exclude 'BUILD.*'			\
 | 
					
						
							| 
									
										
										
										
											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 'bazel*/'			\
 | 
					
						
							|  |  |  | 	       --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/'			\
 | 
					
						
							| 
									
										
										
										
											2016-12-06 02:35:24 +08:00
										 |  |  | 	       --exclude 'packaging'			\
 | 
					
						
							| 
									
										
										
										
											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))/'	\
 | 
					
						
							| 
									
										
										
										
											2016-09-22 23:34:18 +08:00
										 |  |  | 	       --exclude 'test'				\
 | 
					
						
							|  |  |  | 	       --exclude 'xrefr'			\
 | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | 	       --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/'		\
 | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | 	       --exclude '/rabbitmq_amqp1_0/test/swiftmq/build/'\
 | 
					
						
							|  |  |  | 	       --exclude '/rabbitmq_amqp1_0/test/swiftmq/swiftmq*'\
 | 
					
						
							| 
									
										
										
										
											2017-03-07 01:05:29 +08:00
										 |  |  | 	       --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/'		\
 | 
					
						
							| 
									
										
										
										
											2020-11-16 19:56:53 +08:00
										 |  |  | 	       --exclude '/workflow_sources/'		\
 | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | 	       --delete					\
 | 
					
						
							|  |  |  | 	       --delete-excluded | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 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)) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-09-21 15:35:55 +08:00
										 |  |  | .PHONY: $(SOURCE_DIST) | 
					
						
							| 
									
										
										
										
											2017-01-18 17:55:18 +08:00
										 |  |  | .PHONY: clean-source-dist distclean-packages clean-unpacked-source-dist | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | $(SOURCE_DIST): $(ERLANG_MK_RECURSIVE_DEPS_LIST) | 
					
						
							|  |  |  | 	$(verbose) mkdir -p $(dir $@) | 
					
						
							| 
									
										
										
										
											2016-09-21 18:22:00 +08:00
										 |  |  | 	$(gen_verbose) $(RSYNC) $(RSYNC_FLAGS) ./ $@/ | 
					
						
							| 
									
										
										
										
											2018-12-20 19:43:15 +08:00
										 |  |  | 	$(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" | 
					
						
							| 
									
										
										
										
											2018-12-20 21:20:07 +08:00
										 |  |  | 	$(verbose) echo "$$(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
										 |  |  | 	$(verbose) cat packaging/common/LICENSE.head > $@/LICENSE | 
					
						
							|  |  |  | 	$(verbose) mkdir -p $@/deps/licensing | 
					
						
							| 
									
										
										
										
											2017-12-07 19:23:24 +08:00
										 |  |  | 	$(verbose) set -e; for dep in $$(cat $(ERLANG_MK_RECURSIVE_DEPS_LIST) | LC_COLLATE=C sort); do \
 | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | 		$(RSYNC) $(RSYNC_FLAGS) \
 | 
					
						
							|  |  |  | 		 $$dep \
 | 
					
						
							|  |  |  | 		 $@/deps; \
 | 
					
						
							| 
									
										
										
										
											2017-12-07 19:23:24 +08:00
										 |  |  | 		rm -f \
 | 
					
						
							|  |  |  | 		 $@/deps/rabbit_common/rebar.config \
 | 
					
						
							|  |  |  | 		 $@/deps/rabbit_common/rebar.lock; \
 | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | 		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; \
 | 
					
						
							|  |  |  | 		fi; \
 | 
					
						
							|  |  |  | 		sed -E -i.bak "s|^[[:blank:]]*include[[:blank:]]+\.\./.*erlang.mk$$|include ../../erlang.mk|" \
 | 
					
						
							|  |  |  | 		 $@/deps/$$(basename $$dep)/Makefile && \
 | 
					
						
							|  |  |  | 		rm $@/deps/$$(basename $$dep)/Makefile.bak; \
 | 
					
						
							| 
									
										
										
										
											2017-12-07 19:23:24 +08:00
										 |  |  | 		mix_exs=$@/deps/$$(basename $$dep)/mix.exs; \
 | 
					
						
							|  |  |  | 		if test -f $$mix_exs; then \
 | 
					
						
							|  |  |  | 			(cd $$(dirname "$$mix_exs") && \
 | 
					
						
							| 
									
										
										
										
											2021-04-08 16:50:39 +08:00
										 |  |  | 			 (test -d $@/deps/.hex || env DEPS_DIR=$@/deps MIX_HOME=$@/deps/.mix HEX_HOME=$@/deps/.hex MIX_ENV=prod FILL_HEX_CACHE=yes mix local.hex --force) && \
 | 
					
						
							|  |  |  | 			 env DEPS_DIR=$@/deps MIX_HOME=$@/deps/.mix HEX_HOME=$@/deps/.hex MIX_ENV=prod FILL_HEX_CACHE=yes mix deps.get --only prod && \
 | 
					
						
							| 
									
										
										
										
											2019-06-27 00:34:20 +08:00
										 |  |  | 			 cp $(CURDIR)/mk/rabbitmq-mix.mk . && \
 | 
					
						
							| 
									
										
										
										
											2017-12-07 19:23:24 +08:00
										 |  |  | 			 rm -rf _build deps); \
 | 
					
						
							|  |  |  | 		fi; \
 | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | 		if test -f "$$dep/license_info"; then \
 | 
					
						
							|  |  |  | 			cp "$$dep/license_info" "$@/deps/licensing/license_info_$$(basename "$$dep")"; \
 | 
					
						
							|  |  |  | 			cat "$$dep/license_info" >> $@/LICENSE; \
 | 
					
						
							|  |  |  | 		fi; \
 | 
					
						
							|  |  |  | 		find "$$dep" -maxdepth 1 -name 'LICENSE-*' -exec cp '{}' $@/deps/licensing \; ; \
 | 
					
						
							| 
									
										
										
										
											2017-12-07 19:23:24 +08:00
										 |  |  | 		(cd $$dep; \
 | 
					
						
							|  |  |  | 		 echo "$$(basename "$$dep") $$(git rev-parse HEAD) $$(git describe --tags --exact-match 2>/dev/null || git symbolic-ref -q --short HEAD)") \
 | 
					
						
							| 
									
										
										
										
											2018-12-20 19:43:15 +08:00
										 |  |  | 		 >> "$@/git-revisions.txt"; \
 | 
					
						
							| 
									
										
										
										
											2018-12-20 21:21:20 +08:00
										 |  |  | 		! test -d $$dep/.git || (cd $$dep; \
 | 
					
						
							| 
									
										
										
										
											2018-12-20 19:43:15 +08:00
										 |  |  | 		 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 | 
					
						
							|  |  |  | 	$(verbose) cat packaging/common/LICENSE.tail >> $@/LICENSE | 
					
						
							|  |  |  | 	$(verbose) find $@/deps/licensing -name 'LICENSE-*' -exec cp '{}' $@ \; | 
					
						
							| 
									
										
										
										
											2020-11-16 19:56:53 +08:00
										 |  |  | 	$(verbose) rm -rf $@/deps/licensing | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | 	$(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)"]}/' \
 | 
					
						
							| 
									
										
										
										
											2016-09-23 20:13:06 +08:00
										 |  |  | 		  $$file; \
 | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | 		rm $$file.bak; \
 | 
					
						
							|  |  |  | 	done | 
					
						
							| 
									
										
										
										
											2016-12-07 19:18:37 +08:00
										 |  |  | 	$(verbose) echo "PLUGINS := $(PLUGINS)" > $@/plugins.mk | 
					
						
							| 
									
										
										
										
											2018-12-20 19:43:15 +08:00
										 |  |  | # Remember the latest Git timestamp.
 | 
					
						
							|  |  |  | 	$(verbose) sort -r < "$@.git-times.txt" | head -n 1 > "$@.git-time.txt" | 
					
						
							|  |  |  | # Mix Hex component requires a cache file, otherwise it refuses to build
 | 
					
						
							|  |  |  | # offline... That cache is an ETS table with all the applications we
 | 
					
						
							|  |  |  | # depend on, plus some versioning informations and checksums. There
 | 
					
						
							|  |  |  | # are two problems with that: the table contains a date (`last_update`
 | 
					
						
							|  |  |  | # field) and `ets:tab2file()` produces a different file each time it's
 | 
					
						
							|  |  |  | # called.
 | 
					
						
							|  |  |  | #
 | 
					
						
							|  |  |  | # To make our source archive reproducible, we fix the time of the
 | 
					
						
							|  |  |  | # `last_update` field to the last Git commit and dump the content of the
 | 
					
						
							|  |  |  | # table as an Erlang term to a text file.
 | 
					
						
							|  |  |  | #
 | 
					
						
							|  |  |  | # The ETS file must be recreated before compiling RabbitMQ. See the
 | 
					
						
							|  |  |  | # `restore-hex-cache-ets-file` Make target.
 | 
					
						
							| 
									
										
										
										
											2021-04-08 16:58:51 +08:00
										 |  |  | 	$(verbose) $(call erlang,$(call dump_hex_cache_to_erl_term,$(call core_native_path,$@),$(call core_native_path,$@.git-time.txt))) | 
					
						
							| 
									
										
										
										
											2018-12-20 19:43:15 +08:00
										 |  |  | # Fix file timestamps to have reproducible source archives.
 | 
					
						
							|  |  |  | 	$(verbose) find $@ -print0 | xargs -0 touch -t "$$(cat "$@.git-time.txt")" | 
					
						
							| 
									
										
										
										
											2018-12-20 21:21:47 +08:00
										 |  |  | 	$(verbose) rm "$@.git-times.txt" "$@.git-time.txt" | 
					
						
							| 
									
										
										
										
											2018-12-20 19:43:15 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | define dump_hex_cache_to_erl_term | 
					
						
							|  |  |  |   In = "$(1)/deps/.hex/cache.ets", | 
					
						
							|  |  |  |   Out = "$(1)/deps/.hex/cache.erl", | 
					
						
							|  |  |  |   {ok, DateStr} = file:read_file("$(2)"), | 
					
						
							|  |  |  |   {match, Date} = re:run(DateStr, | 
					
						
							|  |  |  |     "^([0-9]{4})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})\.([0-9]{2})", | 
					
						
							|  |  |  |     [{capture, all_but_first, list}]), | 
					
						
							|  |  |  |   [Year, Month, Day, Hour, Min, Sec] = [erlang:list_to_integer(V) || V <- Date], | 
					
						
							|  |  |  |   {ok, Tab} = ets:file2tab(In), | 
					
						
							|  |  |  |   true = ets:insert(Tab, {last_update, {{Year, Month, Day}, {Hour, Min, Sec}}}), | 
					
						
							|  |  |  |   Props = [ | 
					
						
							|  |  |  |     Prop | 
					
						
							|  |  |  |     || {Key, _} = Prop <- ets:info(Tab), | 
					
						
							|  |  |  |     Key =:= name orelse | 
					
						
							|  |  |  |     Key =:= type orelse | 
					
						
							|  |  |  |     Key =:= protection orelse | 
					
						
							|  |  |  |     Key =:= named_table orelse | 
					
						
							|  |  |  |     Key =:= keypos orelse | 
					
						
							|  |  |  |     Key =:= heir orelse | 
					
						
							|  |  |  |     Key =:= read_concurrency orelse | 
					
						
							|  |  |  |     Key =:= write_concurrency orelse | 
					
						
							|  |  |  |     Key =:= compressed], | 
					
						
							|  |  |  |   Entries = ets:tab2list(Tab), | 
					
						
							| 
									
										
										
										
											2020-02-08 02:27:38 +08:00
										 |  |  |   ok = file:write_file(Out, io_lib:format("~w.~n~w.~n", [Props, Entries])), | 
					
						
							| 
									
										
										
										
											2018-12-20 19:43:15 +08:00
										 |  |  |   ok = file:delete(In), | 
					
						
							|  |  |  |   init:stop(). | 
					
						
							|  |  |  | endef | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-01-18 00:34:39 +08:00
										 |  |  | $(SOURCE_DIST).manifest: $(SOURCE_DIST) | 
					
						
							|  |  |  | 	$(gen_verbose) cd $(dir $(SOURCE_DIST)) && \
 | 
					
						
							|  |  |  | 		find $(notdir $(SOURCE_DIST)) | LC_COLLATE=C sort > $@ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-12-20 21:22:21 +08:00
										 |  |  | ifeq ($(shell tar --version | grep -c "GNU tar"),0) | 
					
						
							| 
									
										
										
										
											2020-02-08 03:10:36 +08:00
										 |  |  | # Skip all flags if this is Darwin (a.k.a. macOS, a.k.a. OS X)
 | 
					
						
							|  |  |  | ifeq ($(shell uname | grep -c "Darwin"),0) | 
					
						
							| 
									
										
										
										
											2018-12-20 19:43:15 +08:00
										 |  |  | TAR_FLAGS_FOR_REPRODUCIBLE_BUILDS = --uid 0 \
 | 
					
						
							|  |  |  | 				    --gid 0 \
 | 
					
						
							|  |  |  | 				    --numeric-owner \
 | 
					
						
							|  |  |  | 				    --no-acls \
 | 
					
						
							|  |  |  | 				    --no-fflags \
 | 
					
						
							|  |  |  | 				    --no-xattrs | 
					
						
							| 
									
										
										
										
											2020-02-08 03:10:36 +08:00
										 |  |  | endif | 
					
						
							| 
									
										
										
										
											2018-12-20 21:22:21 +08:00
										 |  |  | else | 
					
						
							|  |  |  | TAR_FLAGS_FOR_REPRODUCIBLE_BUILDS = --owner 0 \
 | 
					
						
							|  |  |  | 				    --group 0 \
 | 
					
						
							|  |  |  | 				    --numeric-owner | 
					
						
							|  |  |  | endif | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-01-18 00:34:39 +08:00
										 |  |  | $(SOURCE_DIST).tar.gz: $(SOURCE_DIST).manifest | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | 	$(gen_verbose) cd $(dir $(SOURCE_DIST)) && \
 | 
					
						
							| 
									
										
										
										
											2018-12-20 19:43:15 +08:00
										 |  |  | 		$(TAR) $(TAR_V) $(TAR_FLAGS_FOR_REPRODUCIBLE_BUILDS) --no-recursion -T $(SOURCE_DIST).manifest -cf - | \
 | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | 		$(GZIP) --best > $@ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-01-18 00:34:39 +08:00
										 |  |  | $(SOURCE_DIST).tar.bz2: $(SOURCE_DIST).manifest | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | 	$(gen_verbose) cd $(dir $(SOURCE_DIST)) && \
 | 
					
						
							| 
									
										
										
										
											2018-12-20 19:43:15 +08:00
										 |  |  | 		$(TAR) $(TAR_V) $(TAR_FLAGS_FOR_REPRODUCIBLE_BUILDS) --no-recursion -T $(SOURCE_DIST).manifest -cf - | \
 | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | 		$(BZIP2) > $@ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-01-18 00:34:39 +08:00
										 |  |  | $(SOURCE_DIST).tar.xz: $(SOURCE_DIST).manifest | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | 	$(gen_verbose) cd $(dir $(SOURCE_DIST)) && \
 | 
					
						
							| 
									
										
										
										
											2018-12-20 19:43:15 +08:00
										 |  |  | 		$(TAR) $(TAR_V) $(TAR_FLAGS_FOR_REPRODUCIBLE_BUILDS) --no-recursion -T $(SOURCE_DIST).manifest -cf - | \
 | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | 		$(XZ) > $@ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-01-18 00:34:39 +08:00
										 |  |  | $(SOURCE_DIST).zip: $(SOURCE_DIST).manifest | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | 	$(verbose) rm -f $@ | 
					
						
							|  |  |  | 	$(gen_verbose) cd $(dir $(SOURCE_DIST)) && \
 | 
					
						
							| 
									
										
										
										
											2017-01-18 00:34:39 +08:00
										 |  |  | 		$(ZIP) $(ZIP_V) --names-stdin $@ < $(SOURCE_DIST).manifest | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-01-18 17:55:18 +08:00
										 |  |  | clean:: clean-source-dist | 
					
						
							| 
									
										
										
										
											2016-09-21 00:19:24 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | clean-source-dist: | 
					
						
							|  |  |  | 	$(gen_verbose) rm -rf -- $(SOURCE_DIST_BASE)-* | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											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 \
 | 
					
						
							| 
									
										
										
										
											2017-09-01 21:46:27 +08:00
										 |  |  | package-rpm-redhat package-rpm-fedora package-rpm-rhel6 package-rpm-rhel7 \ | 
					
						
							| 
									
										
										
										
											2019-10-22 22:50:27 +08:00
										 |  |  | package-rpm-rhel8 package-rpm-suse package-rpm-opensuse package-rpm-sles11 \ | 
					
						
							| 
									
										
										
										
											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 \
 | 
					
						
							|  |  |  | 	   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 \
 | 
					
						
							|  |  |  | 	   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:/'> $@ |