forked from rabbitmq/rabbitmq-common
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
69 lines (52 loc) · 2.22 KB
/
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
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
PROJECT = rabbit_common
BUILD_DEPS = rabbitmq_codegen
DEPS = lager
TEST_DEPS = mochiweb
.DEFAULT_GOAL = all
EXTRA_SOURCES += include/rabbit_framing.hrl \
src/rabbit_framing_amqp_0_8.erl \
src/rabbit_framing_amqp_0_9_1.erl
.DEFAULT_GOAL = all
$(PROJECT).d:: $(EXTRA_SOURCES)
# FIXME: Use erlang.mk patched for RabbitMQ, while waiting for PRs to be
# reviewed and merged.
ERLANG_MK_REPO = https://github.com/rabbitmq/erlang.mk.git
ERLANG_MK_COMMIT = rabbitmq-tmp
include mk/rabbitmq-components.mk
include erlang.mk
include mk/rabbitmq-build.mk
include mk/rabbitmq-dist.mk
# --------------------------------------------------------------------
# Compilation.
# --------------------------------------------------------------------
ERTS_VER := $(shell erl -version 2>&1 | sed -E 's/.* version //')
tls_atom_version_MAX_ERTS_VER = 6.0
ifeq ($(call compare_version,$(ERTS_VER),$(tls_atom_version_MAX_ERTS_VER),<),true)
RMQ_ERLC_OPTS += -Ddefine_tls_atom_version
endif
# --------------------------------------------------------------------
# Framing sources generation.
# --------------------------------------------------------------------
PYTHON ?= python
CODEGEN = $(CURDIR)/codegen.py
CODEGEN_DIR ?= $(DEPS_DIR)/rabbitmq_codegen
CODEGEN_AMQP = $(CODEGEN_DIR)/amqp_codegen.py
AMQP_SPEC_JSON_FILES_0_8 = $(CODEGEN_DIR)/amqp-rabbitmq-0.8.json
AMQP_SPEC_JSON_FILES_0_9_1 = $(CODEGEN_DIR)/amqp-rabbitmq-0.9.1.json \
$(CODEGEN_DIR)/credit_extension.json
include/rabbit_framing.hrl:: $(CODEGEN) $(CODEGEN_AMQP) \
$(AMQP_SPEC_JSON_FILES_0_9_1) $(AMQP_SPEC_JSON_FILES_0_8)
$(gen_verbose) env PYTHONPATH=$(CODEGEN_DIR) \
$(PYTHON) $(CODEGEN) --ignore-conflicts header \
$(AMQP_SPEC_JSON_FILES_0_9_1) $(AMQP_SPEC_JSON_FILES_0_8) $@
src/rabbit_framing_amqp_0_9_1.erl:: $(CODEGEN) $(CODEGEN_AMQP) \
$(AMQP_SPEC_JSON_FILES_0_9_1)
$(gen_verbose) env PYTHONPATH=$(CODEGEN_DIR) \
$(PYTHON) $(CODEGEN) body $(AMQP_SPEC_JSON_FILES_0_9_1) $@
src/rabbit_framing_amqp_0_8.erl:: $(CODEGEN) $(CODEGEN_AMQP) \
$(AMQP_SPEC_JSON_FILES_0_8)
$(gen_verbose) env PYTHONPATH=$(CODEGEN_DIR) \
$(PYTHON) $(CODEGEN) body $(AMQP_SPEC_JSON_FILES_0_8) $@
clean:: clean-extra-sources
clean-extra-sources:
$(gen_verbose) rm -f $(EXTRA_SOURCES)