File: Makefile

package info (click to toggle)
rabbitmq-server 2.8.4-1
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 8,928 kB
  • sloc: erlang: 52,968; python: 2,846; xml: 1,987; sh: 816; makefile: 683; perl: 86; ruby: 63
file content (172 lines) | stat: -rw-r--r-- 4,396 bytes parent folder | download
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
.PHONY: default
default:
	@echo No default target && false

PACKAGE_REPOS:=\
    eldap-wrapper \
    erlando \
    erlang-rfc4627-wrapper \
    hstcp \
    mochiweb-wrapper \
    rabbitmq-auth-backend-ldap \
    rabbitmq-auth-mechanism-ssl \
    rabbitmq-consistent-hash-exchange \
    rabbitmq-erlang-client \
    rabbitmq-external-exchange \
    rabbitmq-federation \
    rabbitmq-federation-management \
    rabbitmq-ha-test \
    rabbitmq-jsonrpc \
    rabbitmq-jsonrpc-channel \
    rabbitmq-jsonrpc-channel-examples \
    rabbitmq-management \
    rabbitmq-management-agent \
    rabbitmq-management-visualiser \
    rabbitmq-metronome \
    rabbitmq-mochiweb \
    rabbitmq-shovel \
    rabbitmq-shovel-management \
    rabbitmq-stomp \
    rabbitmq-toke \
    rabbitmq-tracing \
    toke \
    webmachine-wrapper

REPOS:=rabbitmq-server rabbitmq-codegen $(PACKAGE_REPOS)

BRANCH:=default

HG_CORE_REPOBASE:=$(shell dirname `hg paths default 2>/dev/null` 2>/dev/null)
ifndef HG_CORE_REPOBASE
HG_CORE_REPOBASE:=http://hg.rabbitmq.com/
endif

VERSION:=0.0.0

#----------------------------------

all:
	$(MAKE) -f all-packages.mk all-packages VERSION=$(VERSION)

test:
	$(MAKE) -f all-packages.mk test-all-packages VERSION=$(VERSION)

release:
	$(MAKE) -f all-packages.mk all-releasable VERSION=$(VERSION)

clean:
	$(MAKE) -f all-packages.mk clean-all-packages

check-xref:
	$(MAKE) -f all-packages.mk check-xref-packages

plugins-dist: release
	rm -rf $(PLUGINS_DIST_DIR)
	mkdir -p $(PLUGINS_DIST_DIR)
	$(MAKE) -f all-packages.mk copy-releasable VERSION=$(VERSION) PLUGINS_DIST_DIR=$(PLUGINS_DIST_DIR)

plugins-srcdist:
	rm -rf $(PLUGINS_SRC_DIST_DIR)
	mkdir -p $(PLUGINS_SRC_DIST_DIR)/licensing

	rsync -a --exclude '.hg*' rabbitmq-erlang-client $(PLUGINS_SRC_DIST_DIR)/
	touch $(PLUGINS_SRC_DIST_DIR)/rabbitmq-erlang-client/.srcdist_done

	rsync -a --exclude '.hg*' rabbitmq-server $(PLUGINS_SRC_DIST_DIR)/
	touch $(PLUGINS_SRC_DIST_DIR)/rabbitmq-server/.srcdist_done

	$(MAKE) -f all-packages.mk copy-srcdist VERSION=$(VERSION) PLUGINS_SRC_DIST_DIR=$(PLUGINS_SRC_DIST_DIR)
	cp Makefile *.mk generate* $(PLUGINS_SRC_DIST_DIR)/
	echo "This is the released version of rabbitmq-public-umbrella. \
You can clone the full version with: hg clone http://hg.rabbitmq.com/rabbitmq-public-umbrella" > $(PLUGINS_SRC_DIST_DIR)/README

	PRESERVE_CLONE_DIR=1 make -C $(PLUGINS_SRC_DIST_DIR) clean
	rm -rf $(PLUGINS_SRC_DIST_DIR)/rabbitmq-server

#----------------------------------
# Convenience aliases

.PHONY: co
co: checkout

.PHONY: ci
ci: checkin

.PHONY: up
up: update

.PHONY: st
st: status

.PHONY: up_c
up_c: named_update

#----------------------------------

$(REPOS):
	hg clone $(HG_CORE_REPOBASE)/$@

.PHONY: checkout
checkout: $(REPOS)

#----------------------------------
# Subrepository management


# $(1) is the target
# $(2) is the target dependency. Can use % to get current REPO
# $(3) is the target body. Can use % to get current REPO
define repo_target

.PHONY: $(1)
$(1): $(2)
	$(3)

endef

# $(1) is the list of repos
# $(2) is the suffix
# $(3) is the target dependency. Can use % to get current REPO
# $(4) is the target body. Can use % to get current REPO
define repo_targets
$(foreach REPO,$(1),$(call repo_target,$(REPO)+$(2),\
	$(patsubst %,$(3),$(REPO)),$(patsubst %,$(4),$(REPO))))
endef

# Do not allow status to fork with -j otherwise output will be garbled
.PHONY: status
status: checkout
	$(foreach DIR,. $(REPOS), \
		(cd $(DIR); OUT=$$(hg st -mad); \
		if \[ ! -z "$$OUT" \]; then echo "\n$(DIR):\n$$OUT"; fi) &&) true

.PHONY: pull
pull: $(foreach DIR,. $(REPOS),$(DIR)+pull)

$(eval $(call repo_targets,. $(REPOS),pull,| %,(cd % && hg pull)))

.PHONY: update
update: $(foreach DIR,. $(REPOS),$(DIR)+update)

$(eval $(call repo_targets,. $(REPOS),update,%+pull,(cd % && hg up)))

.PHONY: named_update
named_update: $(foreach DIR,. $(REPOS),$(DIR)+named_update)

$(eval $(call repo_targets,. $(REPOS),named_update,%+pull,\
	(cd % && hg up -C $(BRANCH))))

.PHONY: tag
tag: $(foreach DIR,. $(PACKAGE_REPOS),$(DIR)+tag)

$(eval $(call repo_targets,. $(PACKAGE_REPOS),tag,| %,(cd % && hg tag $(TAG))))

.PHONY: push
push: $(foreach DIR,. $(REPOS),$(DIR)+push)

$(eval $(call repo_targets,. $(REPOS),push,| %,(cd % && hg push -f)))

.PHONY: checkin
checkin: $(foreach DIR,. $(REPOS),$(DIR)+checkin)

$(eval $(call repo_targets,. $(REPOS),checkin,| %,(cd % && hg ci)))