Ole Troan | 6855f6c | 2016-04-09 03:16:30 +0200 | [diff] [blame] | 1 | # 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 | |
| 14 | AUTOMAKE_OPTIONS = foreign subdir-objects |
| 15 | ACLOCAL_AMFLAGS = -I m4 |
Ole Troan | 5f9dcff | 2016-08-01 04:59:13 +0200 | [diff] [blame^] | 16 | AM_CFLAGS = -Wall |
Ole Troan | 6855f6c | 2016-04-09 03:16:30 +0200 | [diff] [blame] | 17 | |
| 18 | BUILT_SOURCES = |
Ole Troan | 5f9dcff | 2016-08-01 04:59:13 +0200 | [diff] [blame^] | 19 | bin_PROGRAMS = |
| 20 | CLEANFILES = |
| 21 | lib_LTLIBRARIES = |
Ole Troan | 6855f6c | 2016-04-09 03:16:30 +0200 | [diff] [blame] | 22 | noinst_PROGRAMS = test_pneum |
| 23 | nobase_include_HEADERS = pneum/pneum.h |
| 24 | |
| 25 | # |
Ole Troan | 5f9dcff | 2016-08-01 04:59:13 +0200 | [diff] [blame^] | 26 | # Python / C extension |
Ole Troan | 6855f6c | 2016-04-09 03:16:30 +0200 | [diff] [blame] | 27 | # |
Ole Troan | 5f9dcff | 2016-08-01 04:59:13 +0200 | [diff] [blame^] | 28 | lib_LTLIBRARIES += vpp_api.la |
| 29 | vpp_api_la_SOURCES = pneum/pneum.c vpp_papi/pneum_wrap.c |
| 30 | vpp_api_la_LIBADD = -lvlibmemoryclient -lvlibapi -lsvm -lvppinfra -lpthread -lm -lrt |
| 31 | vpp_api_la_LDFLAGS = -module $(shell python-config --ldflags) |
| 32 | vpp_api_la_CPPFLAGS = $(shell python-config --includes) |
| 33 | |
| 34 | # Kept around for setuptools based install. |
Ole Troan | 6855f6c | 2016-04-09 03:16:30 +0200 | [diff] [blame] | 35 | lib_LTLIBRARIES += libpneum.la |
Ole Troan | 5f9dcff | 2016-08-01 04:59:13 +0200 | [diff] [blame^] | 36 | libpneum_la_SOURCES = pneum/pneum.c setup.py |
Ole Troan | 6855f6c | 2016-04-09 03:16:30 +0200 | [diff] [blame] | 37 | libpneum_la_LIBADD = -lvlibmemoryclient -lvlibapi -lsvm -lvppinfra -lpthread -lm -lrt |
| 38 | libpneum_la_LDFLAGS = -module |
| 39 | libpneum_la_CPPFLAGS = |
| 40 | |
Ole Troan | 5f9dcff | 2016-08-01 04:59:13 +0200 | [diff] [blame^] | 41 | # |
| 42 | # Core VPP API |
| 43 | # |
| 44 | BUILT_SOURCES += \ |
| 45 | $(prefix)/../vpp/vpp-api/vpe.py \ |
| 46 | $(prefix)/../vlib-api/vlibmemory/memclnt.py |
Ole Troan | 6855f6c | 2016-04-09 03:16:30 +0200 | [diff] [blame] | 47 | |
Ole Troan | 5f9dcff | 2016-08-01 04:59:13 +0200 | [diff] [blame^] | 48 | %.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. |
| 56 | install-exec-local: |
| 57 | cd $(srcdir); \ |
| 58 | mkdir -p $(prefix)/lib/python2.7/site-packages; \ |
| 59 | PYTHONUSERBASE=$(prefix) python setup.py install --user |
Ole Troan | 6855f6c | 2016-04-09 03:16:30 +0200 | [diff] [blame] | 60 | |
| 61 | # |
| 62 | # Test client |
| 63 | # |
| 64 | noinst_PROGRAMS += test_pneum |
| 65 | test_pneum_SOURCES = pneum/pneum.c pneum/test_pneum.c |
| 66 | test_pneum_LDADD = -lvlibmemoryclient -lvlibapi -lsvm -lvppinfra -lpthread -lm -lrt |