blob: a3a9a8d6ed4ecaa6fa06f75dbb5f3154dfb8ae8f [file] [log] [blame]
Ed Warnickecb9cada2015-12-08 15:45:58 -07001# Copyright (c) 2015 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
15
Anlu Yan04f8d3f2017-02-22 09:18:11 -080016AM_CFLAGS = -Wall -I${top_srcdir} -I${top_builddir}
Damjan Marion905a7f52016-07-07 20:27:49 +020017AM_LDFLAGS = -module -shared -avoid-version
Anlu Yan04f8d3f2017-02-22 09:18:11 -080018AM_LIBTOOLFLAGS = --quiet
19SUFFIXES = .api.h .api .api.json
20API_FILES =
21BUILT_SOURCES =
22vppplugins_LTLIBRARIES =
23vppapitestplugins_LTLIBRARIES =
24noinst_HEADERS =
25nobase_apiinclude_HEADERS =
26ACLOCAL_AMFLAGS = -I m4
Ed Warnickecb9cada2015-12-08 15:45:58 -070027
Damjan Marion905a7f52016-07-07 20:27:49 +020028vppapitestpluginsdir = ${libdir}/vpp_api_test_plugins
29vpppluginsdir = ${libdir}/vpp_plugins
30
Anlu Yan04f8d3f2017-02-22 09:18:11 -080031include sample.am
Ed Warnickecb9cada2015-12-08 15:45:58 -070032
33%.api.h: %.api
34 mkdir -p `dirname $@` ; \
35 $(CC) $(CPPFLAGS) -E -P -C -x c $^ \
36 | vppapigen --input - --output $@ --show-name $@
37
Ole Troanf14e3bf2016-12-01 21:49:03 +010038%.api.json: %.api
39 @echo " JSON APIGEN " $@ ; \
40 mkdir -p `dirname $@` ; \
41 $(CC) $(CPPFLAGS) -E -P -C -x c $^ \
42 | vppapigen --input - --json $@
43
Anlu Yan04f8d3f2017-02-22 09:18:11 -080044apidir = $(prefix)/api/plugins
45apiincludedir = ${includedir}/vpp_plugins
Ole Troanf14e3bf2016-12-01 21:49:03 +010046
Anlu Yan04f8d3f2017-02-22 09:18:11 -080047api_DATA = \
48 $(patsubst %.api,%.api.json,$(API_FILES))
Ed Warnickecb9cada2015-12-08 15:45:58 -070049
Anlu Yan04f8d3f2017-02-22 09:18:11 -080050BUILT_SOURCES += \
51 $(patsubst %.api,%.api.h,$(API_FILES))
52
Ed Warnickecb9cada2015-12-08 15:45:58 -070053
Damjan Marion905a7f52016-07-07 20:27:49 +020054# Remove *.la files
Ed Warnickecb9cada2015-12-08 15:45:58 -070055install-data-hook:
Damjan Marion905a7f52016-07-07 20:27:49 +020056 @(cd $(vpppluginsdir) && $(RM) $(vppplugins_LTLIBRARIES))
57 @(cd $(vppapitestpluginsdir) && $(RM) $(vppapitestplugins_LTLIBRARIES))
Burt Silverman006eb472017-01-27 15:29:54 -050058
59CLEANFILES = $(BUILT_SOURCES)