1 # Copyright (c) 2017 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:
6 # http://www.apache.org/licenses/LICENSE-2.0
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.
14 AUTOMAKE_OPTIONS = foreign
15 ACLOCAL_AMFLAGS = -I m4
16 AM_LIBTOOLFLAGS = --quiet
18 AM_CFLAGS = -Wall -I${top_srcdir} -I${top_builddir} -I. -I$(top_srcdir)/vpp-api/vapi
20 AM_LDFLAGS = -shared -avoid-version -rpath /none -no-undefined
26 %.api.vapi.h: %.api.json vapi_c_gen.py
27 @echo " VAPI C GEN $< " $@ ; \
28 mkdir -p `dirname $@` ; \
29 $(top_srcdir)/vpp-api/vapi/vapi_c_gen.py $<
32 find $(top_builddir) -name '$@' | xargs ln -s
34 BUILT_SOURCES = $(shell find $(top_builddir) -name '*.api.json' | xargs -n1 basename) \
35 $(patsubst %.api.json,%.api.vapi.h,$(JSON_FILES))
37 vapi.c: $(BUILT_SOURCES)
39 JSON_FILES = $(wildcard *.api.json)
42 lib_LTLIBRARIES = libvapiclient.la
44 libvapiclient_la_SOURCES = vapi.c
46 libvapiclient_la_LIBADD = -lpthread -lm -lrt \
47 $(top_builddir)/libvppinfra.la \
48 $(top_builddir)/libvlibmemoryclient.la \
49 $(top_builddir)/libsvm.la
51 libvapiclient_la_LDFLAGS = \
52 -Wl,-L$(top_builddir)/.libs,--whole-archive,--no-whole-archive \
53 -Wl,--version-script=$(srcdir)/libvapiclient.map,-lrt
55 libvapiclient_la_CPPFLAGS = -I. -I$(top_builddir)/vpp-api/vapi
57 nobase_include_HEADERS = ${top_srcdir}/vpp-api/client/vppapiclient.h \
61 $(patsubst %.api.json,%.api.vapi.h,$(JSON_FILES))