diff options
author | Ole Troan <ot@cisco.com> | 2016-09-12 22:00:32 +0200 |
---|---|---|
committer | Damjan Marion <dmarion.lists@gmail.com> | 2016-09-23 13:18:46 +0000 |
commit | 57c3d66c55580f2ced6993ada22274941237fcd5 (patch) | |
tree | 55a856b3ddcc4f9e5284c7bc42b0126616825366 /vpp-api/python/Makefile.am | |
parent | 5fef9e523df67a96f3b9aedcec373e65f590b001 (diff) |
Python API: Preparation for RPM/DEB packaging.
Recheck.
Repackage the Python API binding to include all
necessary modules in a single Python package.
Change-Id: I5e35141d413bfb1aad650217e1ca07d85646c349
Signed-off-by: Ole Troan <ot@cisco.com>
Diffstat (limited to 'vpp-api/python/Makefile.am')
-rw-r--r-- | vpp-api/python/Makefile.am | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/vpp-api/python/Makefile.am b/vpp-api/python/Makefile.am index eb589335b05..59b1b9220bd 100644 --- a/vpp-api/python/Makefile.am +++ b/vpp-api/python/Makefile.am @@ -25,42 +25,41 @@ nobase_include_HEADERS = pneum/pneum.h # # Python / C extension # -lib_LTLIBRARIES += vpp_api.la -vpp_api_la_SOURCES = pneum/pneum.c vpp_papi/pneum_wrap.c -vpp_api_la_LIBADD = -lvlibmemoryclient -lvlibapi -lsvm -lvppinfra -lpthread -lm -lrt -vpp_api_la_LDFLAGS = -module $(shell python-config --ldflags) -vpp_api_la_CPPFLAGS = $(shell python-config --includes) - -# Kept around for setuptools based install. lib_LTLIBRARIES += libpneum.la -libpneum_la_SOURCES = pneum/pneum.c setup.py -libpneum_la_LIBADD = -lvlibmemoryclient -lvlibapi -lsvm -lvppinfra -lpthread -lm -lrt +libpneum_la_SOURCES = pneum/pneum.c +libpneum_la_LIBADD = -lvlibmemoryclient -lvlibapi -lsvm -lvppinfra -lpthread \ + -lm -lrt libpneum_la_LDFLAGS = -module libpneum_la_CPPFLAGS = # # Core VPP API # -BUILT_SOURCES += \ - $(prefix)/../vpp/vpp-api/vpe.py \ - $(prefix)/../vlib-api/vlibmemory/memclnt.py +$(srcdir)/vpp_papi/vpe.py: $(prefix)/../vpp/vpp-api/vpe.api + $(info Creating Python binding for $@) + $(CC) $(CPPFLAGS) -E -P -C -x c $< \ + | vppapigen --input - --python - \ + | pyvppapigen.py --input - > $(srcdir)/vpp_papi/$(notdir $@) -%.py: %.api +$(srcdir)/vpp_papi/memclnt.py: $(prefix)/../vlib-api/vlibmemory/memclnt.api $(info Creating Python binding for $@) $(CC) $(CPPFLAGS) -E -P -C -x c $< \ | vppapigen --input - --python - \ - | pyvppapigen.py --input - > $@ + | pyvppapigen.py --input - > $(srcdir)/vpp_papi/$(notdir $@) -# # TODO: Support both Python 2 and 3. -install-exec-local: - cd $(srcdir); \ - mkdir -p $(prefix)/lib/python2.7/site-packages; \ - PYTHONUSERBASE=$(prefix) python setup.py install --user +install-exec-local: $(srcdir)/vpp_papi/vpe.py $(srcdir)/vpp_papi/memclnt.py + cd $(srcdir); \ + mkdir -p $(prefix)/lib/python2.7/site-packages; \ + PYTHONUSERBASE=$(prefix) \ + python setup.py build_ext -L $(prefix)/lib64 install --user # # Test client # noinst_PROGRAMS += test_pneum test_pneum_SOURCES = pneum/pneum.c pneum/test_pneum.c -test_pneum_LDADD = -lvlibmemoryclient -lvlibapi -lsvm -lvppinfra -lpthread -lm -lrt +test_pneum_LDADD = -lvlibmemoryclient -lvlibapi -lsvm -lvppinfra -lpthread \ + -lm -lrt + + |