blob: e1bd813df139a0f238cdc4f25b90b1493c766551 [file] [log] [blame]
Klement Sekera8f2a4ea2017-05-04 06:15:18 +02001# 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
14AUTOMAKE_OPTIONS = foreign
15ACLOCAL_AMFLAGS = -I m4
16AM_LIBTOOLFLAGS = --quiet
17
Dave Barach6a5adc32018-07-04 10:56:23 -040018AM_CFLAGS = @CPU_FLAGS@ @DLMALLOC@ -Wall -I${top_srcdir} -I${top_builddir} -I. -I$(top_srcdir)/vpp-api/
Klement Sekera8f2a4ea2017-05-04 06:15:18 +020019
20AM_LDFLAGS = -shared -avoid-version -rpath /none -no-undefined
21
22bin_PROGRAMS =
23noinst_LTLIBRARIES =
24CLEANDIRS =
25
Klement Sekeradc15be22017-06-12 06:49:33 +020026vapi/%.api.vapi.h: %.api.json vapi_c_gen.py vapi_json_parser.py
Klement Sekera8f2a4ea2017-05-04 06:15:18 +020027 @echo " VAPI C GEN $< " $@ ; \
28 mkdir -p `dirname $@` ; \
Klement Sekeradc15be22017-06-12 06:49:33 +020029 $(top_srcdir)/vpp-api/vapi/vapi_c_gen.py --prefix=vapi $<
30
31vapi/%.api.vapi.hpp: %.api.json vapi_cpp_gen.py vapi_c_gen.py vapi_json_parser.py
32 @echo " VAPI CPP GEN $< " $@ ; \
33 mkdir -p `dirname $@` ; \
34 $(top_srcdir)/vpp-api/vapi/vapi_cpp_gen.py --prefix=vapi --gen-h-prefix=vapi $<
Klement Sekera8f2a4ea2017-05-04 06:15:18 +020035
36%.api.json:
37 find $(top_builddir) -name '$@' | xargs ln -s
38
39BUILT_SOURCES = $(shell find $(top_builddir) -name '*.api.json' | xargs -n1 basename) \
Klement Sekeradc15be22017-06-12 06:49:33 +020040 $(patsubst %.api.json,vapi/%.api.vapi.h,$(JSON_FILES)) \
41 $(patsubst %.api.json,vapi/%.api.vapi.hpp,$(JSON_FILES))
Klement Sekera8f2a4ea2017-05-04 06:15:18 +020042
43vapi.c: $(BUILT_SOURCES)
44
45JSON_FILES = $(wildcard *.api.json)
46
Klement Sekera8f2a4ea2017-05-04 06:15:18 +020047lib_LTLIBRARIES = libvapiclient.la
48
49libvapiclient_la_SOURCES = vapi.c
50
Klement Sekeradc15be22017-06-12 06:49:33 +020051libvapiclient_la_DEPENDENCIES = libvapiclient.map
52
Klement Sekera8f2a4ea2017-05-04 06:15:18 +020053libvapiclient_la_LIBADD = -lpthread -lm -lrt \
54 $(top_builddir)/libvppinfra.la \
55 $(top_builddir)/libvlibmemoryclient.la \
56 $(top_builddir)/libsvm.la
57
58libvapiclient_la_LDFLAGS = \
59 -Wl,-L$(top_builddir)/.libs,--whole-archive,--no-whole-archive \
60 -Wl,--version-script=$(srcdir)/libvapiclient.map,-lrt
61
62libvapiclient_la_CPPFLAGS = -I. -I$(top_builddir)/vpp-api/vapi
63
Klement Sekeradc15be22017-06-12 06:49:33 +020064vapiincludedir = $(includedir)/vapi
65
66vapiinclude_HEADERS = vapi.h \
67 vapi.hpp \
Klement Sekera8f2a4ea2017-05-04 06:15:18 +020068 vapi_dbg.h \
Klement Sekeradc15be22017-06-12 06:49:33 +020069 vapi_common.h \
Klement Sekera8f2a4ea2017-05-04 06:15:18 +020070 vapi_internal.h \
Klement Sekeradc15be22017-06-12 06:49:33 +020071 $(patsubst %.api.json,vapi/%.api.vapi.h,$(JSON_FILES)) \
72 $(patsubst %.api.json,vapi/%.api.vapi.hpp,$(JSON_FILES))
Klement Sekera8f2a4ea2017-05-04 06:15:18 +020073
74# vi:syntax=automake