summaryrefslogtreecommitdiff
path: root/Makefile.am
diff options
context:
space:
mode:
authorAlan Antonuk <aega@med.umich.edu>2012-10-04 15:13:30 -0400
committerAlan Antonuk <alan.antonuk@gmail.com>2012-10-05 00:10:02 -0400
commitbda6f61ff7e5aabb8a1e907e19b856e8bf85a7d1 (patch)
tree5e5d1284e2bb471653052ebc7b78c384ab900dd8 /Makefile.am
parent20289c2ecc871c7016db8b3d7301f5ea94485e48 (diff)
downloadrabbitmq-c-github-ask-bda6f61ff7e5aabb8a1e907e19b856e8bf85a7d1.tar.gz
Adding autotools support for Python3 codegen
Diffstat (limited to 'Makefile.am')
-rw-r--r--Makefile.am27
1 files changed, 23 insertions, 4 deletions
diff --git a/Makefile.am b/Makefile.am
index 204f0c7..eee1961 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -40,14 +40,33 @@ BUILT_SOURCES = \
librabbitmq/amqp_framing.h \
librabbitmq/amqp_framing.c
+if PYTHON3
+codegen_py = $(top_builddir)/librabbitmq/python3/codegen3.py
+codegenlib_py = $(top_builddir)/librabbitmq/python3/amqp_codegen.py
+codegenlib_path = $(top_builddir)/librabbitmq/python3
+
+$(codegenlib_path):
+ $(AM_V_at)$(MKDIR_P) $@
+
+$(codegen_py): $(top_srcdir)/librabbitmq/codegen.py $(codegenlib_path)
+ $(AM_V_GEN)$(PYTHON2TO3) $(top_srcdir)/librabbitmq/codegen.py | patch -p0 -o $(codegen_py)
+
+$(codegenlib_py): $(top_srcdir)/codegen/amqp_codegen.py $(codegenlib_path)
+ $(AM_V_GEN)$(PYTHON2TO3) $(top_srcdir)/codegen/amqp_codegen.py | patch -p0 -o $(codegenlib_py)
+else
codegen_py = $(top_srcdir)/librabbitmq/codegen.py
+codegenlib_py = $(top_srcdir)/codegen/amqp_codegen.py
+codegenlib_path = $(top_srcdir)/codegen
+endif
+
+
amqp_codegen_json = $(top_srcdir)/codegen/amqp-rabbitmq-0.9.1.json
-librabbitmq/amqp_framing.h: $(amqp_codegen_json) $(codegen_py)
- $(AM_V_GEN)PYTHONPATH=$(top_srcdir)/codegen $(PYTHON) $(codegen_py) header $< $@
+librabbitmq/amqp_framing.h: $(amqp_codegen_json) $(codegen_py) $(codegenlib_py)
+ $(AM_V_GEN)PYTHONPATH=$(codegenlib_path) $(PYTHON) $(codegen_py) header $< $@
-librabbitmq/amqp_framing.c: $(amqp_codegen_json) $(codegen_py)
- $(AM_V_GEN)PYTHONPATH=$(top_srcdir)/codegen $(PYTHON) $(codegen_py) body $< $@
+librabbitmq/amqp_framing.c: $(amqp_codegen_json) $(codegen_py) $(codegenlib_py)
+ $(AM_V_GEN)PYTHONPATH=$(codegenlib_path) $(PYTHON) $(codegen_py) body $< $@
AM_CFLAGS = -I$(top_srcdir)/librabbitmq