blob: eb589335b051ba4c25ab8a5d39a3a082326679ca [file] [log] [blame]
Ole Troan6855f6c2016-04-09 03:16:30 +02001# Copyright (c) 2016 Cisco and/or its affiliates.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at:
5#
6# http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13
14AUTOMAKE_OPTIONS = foreign subdir-objects
15ACLOCAL_AMFLAGS = -I m4
Ole Troan5f9dcff2016-08-01 04:59:13 +020016AM_CFLAGS = -Wall
Ole Troan6855f6c2016-04-09 03:16:30 +020017
18BUILT_SOURCES =
Ole Troan5f9dcff2016-08-01 04:59:13 +020019bin_PROGRAMS =
20CLEANFILES =
21lib_LTLIBRARIES =
Ole Troan6855f6c2016-04-09 03:16:30 +020022noinst_PROGRAMS = test_pneum
23nobase_include_HEADERS = pneum/pneum.h
24
25#
Ole Troan5f9dcff2016-08-01 04:59:13 +020026# Python / C extension
Ole Troan6855f6c2016-04-09 03:16:30 +020027#
Ole Troan5f9dcff2016-08-01 04:59:13 +020028lib_LTLIBRARIES += vpp_api.la
29vpp_api_la_SOURCES = pneum/pneum.c vpp_papi/pneum_wrap.c
30vpp_api_la_LIBADD = -lvlibmemoryclient -lvlibapi -lsvm -lvppinfra -lpthread -lm -lrt
31vpp_api_la_LDFLAGS = -module $(shell python-config --ldflags)
32vpp_api_la_CPPFLAGS = $(shell python-config --includes)
33
34# Kept around for setuptools based install.
Ole Troan6855f6c2016-04-09 03:16:30 +020035lib_LTLIBRARIES += libpneum.la
Ole Troan5f9dcff2016-08-01 04:59:13 +020036libpneum_la_SOURCES = pneum/pneum.c setup.py
Ole Troan6855f6c2016-04-09 03:16:30 +020037libpneum_la_LIBADD = -lvlibmemoryclient -lvlibapi -lsvm -lvppinfra -lpthread -lm -lrt
38libpneum_la_LDFLAGS = -module
39libpneum_la_CPPFLAGS =
40
Ole Troan5f9dcff2016-08-01 04:59:13 +020041#
42# Core VPP API
43#
44BUILT_SOURCES += \
45 $(prefix)/../vpp/vpp-api/vpe.py \
46 $(prefix)/../vlib-api/vlibmemory/memclnt.py
Ole Troan6855f6c2016-04-09 03:16:30 +020047
Ole Troan5f9dcff2016-08-01 04:59:13 +020048%.py: %.api
49 $(info Creating Python binding for $@)
50 $(CC) $(CPPFLAGS) -E -P -C -x c $< \
51 | vppapigen --input - --python - \
52 | pyvppapigen.py --input - > $@
53
54#
55# TODO: Support both Python 2 and 3.
56install-exec-local:
57 cd $(srcdir); \
58 mkdir -p $(prefix)/lib/python2.7/site-packages; \
59 PYTHONUSERBASE=$(prefix) python setup.py install --user
Ole Troan6855f6c2016-04-09 03:16:30 +020060
61#
62# Test client
63#
64noinst_PROGRAMS += test_pneum
65test_pneum_SOURCES = pneum/pneum.c pneum/test_pneum.c
66test_pneum_LDADD = -lvlibmemoryclient -lvlibapi -lsvm -lvppinfra -lpthread -lm -lrt