blob: 59b1b9220bd3e1912cb3f9314c1b277bbf5fe1cf [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#
28lib_LTLIBRARIES += libpneum.la
Ole Troan57c3d662016-09-12 22:00:32 +020029libpneum_la_SOURCES = pneum/pneum.c
30libpneum_la_LIBADD = -lvlibmemoryclient -lvlibapi -lsvm -lvppinfra -lpthread \
31 -lm -lrt
Ole Troan6855f6c2016-04-09 03:16:30 +020032libpneum_la_LDFLAGS = -module
33libpneum_la_CPPFLAGS =
34
Ole Troan5f9dcff2016-08-01 04:59:13 +020035#
36# Core VPP API
37#
Ole Troan57c3d662016-09-12 22:00:32 +020038$(srcdir)/vpp_papi/vpe.py: $(prefix)/../vpp/vpp-api/vpe.api
Ole Troan5f9dcff2016-08-01 04:59:13 +020039 $(info Creating Python binding for $@)
40 $(CC) $(CPPFLAGS) -E -P -C -x c $< \
41 | vppapigen --input - --python - \
Ole Troan57c3d662016-09-12 22:00:32 +020042 | pyvppapigen.py --input - > $(srcdir)/vpp_papi/$(notdir $@)
Ole Troan5f9dcff2016-08-01 04:59:13 +020043
Ole Troan57c3d662016-09-12 22:00:32 +020044$(srcdir)/vpp_papi/memclnt.py: $(prefix)/../vlib-api/vlibmemory/memclnt.api
45 $(info Creating Python binding for $@)
46 $(CC) $(CPPFLAGS) -E -P -C -x c $< \
47 | vppapigen --input - --python - \
48 | pyvppapigen.py --input - > $(srcdir)/vpp_papi/$(notdir $@)
49
Ole Troan5f9dcff2016-08-01 04:59:13 +020050# TODO: Support both Python 2 and 3.
Ole Troan57c3d662016-09-12 22:00:32 +020051install-exec-local: $(srcdir)/vpp_papi/vpe.py $(srcdir)/vpp_papi/memclnt.py
52 cd $(srcdir); \
53 mkdir -p $(prefix)/lib/python2.7/site-packages; \
54 PYTHONUSERBASE=$(prefix) \
55 python setup.py build_ext -L $(prefix)/lib64 install --user
Ole Troan6855f6c2016-04-09 03:16:30 +020056
57#
58# Test client
59#
60noinst_PROGRAMS += test_pneum
61test_pneum_SOURCES = pneum/pneum.c pneum/test_pneum.c
Ole Troan57c3d662016-09-12 22:00:32 +020062test_pneum_LDADD = -lvlibmemoryclient -lvlibapi -lsvm -lvppinfra -lpthread \
63 -lm -lrt
64
65