ce681c3845926b71b10548eb9cc0a9afe6cd7b12
[vpp.git] / src / vpp-api / vapi / Makefile.am
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:
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
15 ACLOCAL_AMFLAGS = -I m4
16 AM_LIBTOOLFLAGS = --quiet
17
18 AM_CFLAGS = -Wall -I${top_srcdir} -I${top_builddir} -I. -I$(top_srcdir)/vpp-api/vapi
19
20 AM_LDFLAGS = -shared -avoid-version -rpath /none -no-undefined
21
22 bin_PROGRAMS =
23 noinst_LTLIBRARIES =
24 CLEANDIRS =
25
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 $<
30
31 %.api.json:
32         find $(top_builddir) -name '$@' | xargs ln -s
33
34 BUILT_SOURCES = $(shell find $(top_builddir) -name '*.api.json' | xargs -n1 basename) \
35   $(patsubst %.api.json,%.api.vapi.h,$(JSON_FILES))
36
37 vapi.c: $(BUILT_SOURCES)
38
39 JSON_FILES = $(wildcard *.api.json)
40
41
42 lib_LTLIBRARIES = libvapiclient.la
43
44 libvapiclient_la_SOURCES = vapi.c
45
46 libvapiclient_la_LIBADD = -lpthread -lm -lrt \
47   $(top_builddir)/libvppinfra.la \
48   $(top_builddir)/libvlibmemoryclient.la \
49   $(top_builddir)/libsvm.la
50
51 libvapiclient_la_LDFLAGS = \
52   -Wl,-L$(top_builddir)/.libs,--whole-archive,--no-whole-archive \
53   -Wl,--version-script=$(srcdir)/libvapiclient.map,-lrt
54
55 libvapiclient_la_CPPFLAGS = -I. -I$(top_builddir)/vpp-api/vapi
56
57 nobase_include_HEADERS = ${top_srcdir}/vpp-api/client/vppapiclient.h \
58   vapi.h \
59   vapi_dbg.h \
60   vapi_internal.h \
61   $(patsubst %.api.json,%.api.vapi.h,$(JSON_FILES))
62
63 # vi:syntax=automake