forked from brc859844/rabbithub
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
40 lines (32 loc) · 894 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
VSN=3.6.6
PACKAGE=rabbithub-$(VSN)
DIST_DIR=dist
EBIN_DIR=ebin
INCLUDE_DIRS=
DEPS_DIR=deps
DEPS ?=
DEPS_EZ=$(foreach DEP, $(DEPS), $(DEPS_DIR)/$(DEP).ez)
RABBITMQ_HOME ?= .
all: compile package
clean:
rm -rf $(DIST_DIR)
rm -rf $(EBIN_DIR)
rm -rf $(DEPS_DIR)
distclean: clean
rm -rf $(DEPS_DIR)
package: compile $(DEPS_EZ)
rm -f $(DIST_DIR)/$(PACKAGE).ez
mkdir -p $(DIST_DIR)/$(PACKAGE)
cp -r $(EBIN_DIR) $(DIST_DIR)/$(PACKAGE)
$(foreach EXTRA_DIR, $(INCLUDE_DIRS), cp -r $(EXTRA_DIR) $(DIST_DIR)/$(PACKAGE);)
(cd $(DIST_DIR); zip -r $(PACKAGE).ez $(PACKAGE))
install: package
$(foreach DEP, $(DEPS_EZ), cp $(DEP) $(RABBITMQ_HOME)/plugins;)
cp $(DIST_DIR)/$(PACKAGE).ez $(RABBITMQ_HOME)/plugins
$(DEPS_DIR):
./rebar get-deps
cd ./deps/rabbit-common; make
$(DEPS_EZ):
cd $(DEPS_DIR); $(foreach DEP, $(DEPS), zip -r $(DEP).ez $(DEP);)
compile: $(DEPS_DIR)
./rebar compile