blob: 5c279c44b11e1f7e2f22d30a6207299fcc819ae5 [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 $@` ; \
Ole Troan9d420872017-10-12 13:06:35 +020035 vppapigen --input $^ --output $@
Ed Warnickecb9cada2015-12-08 15:45:58 -070036
Ole Troanf14e3bf2016-12-01 21:49:03 +010037%.api.json: %.api
38 @echo " JSON APIGEN " $@ ; \
39 mkdir -p `dirname $@` ; \
Ole Troan9d420872017-10-12 13:06:35 +020040 vppapigen --input $^ JSON --output $@
Ole Troanf14e3bf2016-12-01 21:49:03 +010041
Anlu Yan04f8d3f2017-02-22 09:18:11 -080042apidir = $(prefix)/api/plugins
43apiincludedir = ${includedir}/vpp_plugins
Ole Troanf14e3bf2016-12-01 21:49:03 +010044
Anlu Yan04f8d3f2017-02-22 09:18:11 -080045api_DATA = \
46 $(patsubst %.api,%.api.json,$(API_FILES))
Ed Warnickecb9cada2015-12-08 15:45:58 -070047
Anlu Yan04f8d3f2017-02-22 09:18:11 -080048BUILT_SOURCES += \
49 $(patsubst %.api,%.api.h,$(API_FILES))
50
Ed Warnickecb9cada2015-12-08 15:45:58 -070051
Damjan Marion905a7f52016-07-07 20:27:49 +020052# Remove *.la files
Ed Warnickecb9cada2015-12-08 15:45:58 -070053install-data-hook:
Damjan Marion905a7f52016-07-07 20:27:49 +020054 @(cd $(vpppluginsdir) && $(RM) $(vppplugins_LTLIBRARIES))
55 @(cd $(vppapitestpluginsdir) && $(RM) $(vppapitestplugins_LTLIBRARIES))
Burt Silverman006eb472017-01-27 15:29:54 -050056
57CLEANFILES = $(BUILT_SOURCES)