summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorJean-Sébastien Pédron <jean-sebastien@rabbitmq.com>2015-10-06 18:15:13 +0200
committerJean-Sébastien Pédron <jean-sebastien.pedron@dumbbell.fr>2015-10-20 11:10:48 +0200
commit76776c0bd756c8ccf04a1dca49def2cc3ee4dcb0 (patch)
treea644a588058635487f0c8c3af1ccfcd5c8e94b57 /Makefile
parent1b679a912dccf92e7190051bd4f1180cc488bcd2 (diff)
downloadrabbitmq-server-git-76776c0bd756c8ccf04a1dca49def2cc3ee4dcb0.tar.gz
Add `make install` target
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile42
1 files changed, 42 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index e7df0a73ee..09e2337a17 100644
--- a/Makefile
+++ b/Makefile
@@ -236,3 +236,45 @@ clean:: clean-source-dist
clean-source-dist:
$(gen_verbose) rm -rf -- $(SOURCE_DIST_BASE)-*
+
+# --------------------------------------------------------------------
+# Installation.
+# --------------------------------------------------------------------
+
+.PHONY: install install-erlapp install-scripts
+
+DESTDIR ?=
+PREFIX ?= /usr/local
+
+RMQ_ROOTDIR ?= $(PREFIX)/lib/erlang
+RMQ_LIBDIR ?= $(RMQ_ROOTDIR)/lib
+RMQ_ERLAPP_DIR ?= $(RMQ_LIBDIR)/rabbitmq_server-$(VERSION)
+
+UNZIP ?= unzip
+
+inst_verbose_0 = @echo " INST " $@;
+inst_verbose = $(inst_verbose_$(V))
+
+install: install-erlapp install-scripts
+
+install-dirs:
+ $(verbose) rm -rf $(DESTDIR)$(RMQ_ERLAPP_DIR)
+ $(inst_verbose) mkdir -p $(DESTDIR)$(RMQ_ERLAPP_DIR)
+ $(verbose) mkdir -p $(DESTDIR)$(RMQ_ERLAPP_DIR)/sbin
+
+install-erlapp: dist install-dirs
+ $(inst_verbose) cp -a include ebin plugins LICENSE* INSTALL \
+ $(DESTDIR)$(RMQ_ERLAPP_DIR)
+ $(verbose) echo "Put your EZs here and use rabbitmq-plugins to enable them." \
+ > $(DESTDIR)$(RMQ_ERLAPP_DIR)/plugins/README
+
+# rabbitmq-common provides headers too: copy them to
+# rabbitmq_server/include.
+ $(verbose) cp -a $(DEPS_DIR)/rabbit_common/include $(DESTDIR)$(RMQ_ERLAPP_DIR)
+
+install-scripts: install-dirs
+ $(inst_verbose) for script in rabbitmq-defaults rabbitmq-env rabbitmq-server rabbitmqctl rabbitmq-plugins; do \
+ echo cp -a "scripts/$$script" "$(DESTDIR)$(RMQ_ERLAPP_DIR)/sbin"; \
+ cp -a "scripts/$$script" "$(DESTDIR)$(RMQ_ERLAPP_DIR)/sbin"; \
+ chmod 0755 "$(DESTDIR)$(RMQ_ERLAPP_DIR)/sbin/$$script"; \
+ done