blob: 1825a8f111fe6c97527ffcb04b2a68ced283f21a [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
Damjan Marion5f21e1b2018-08-01 14:38:36 +020016AM_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
Dave Barach5a72e422018-03-13 12:54:43 -040034 @echo " APIGEN " $@ ; \
35 mkdir -p `dirname $@` ; \
Ole Troan9d420872017-10-12 13:06:35 +020036 vppapigen --input $^ --output $@
Ed Warnickecb9cada2015-12-08 15:45:58 -070037
Ole Troanf14e3bf2016-12-01 21:49:03 +010038%.api.json: %.api
Dave Barach5a72e422018-03-13 12:54:43 -040039 @echo " JSON APIGEN " $@ ; \
40 mkdir -p `dirname $@` ; \
Ole Troan9d420872017-10-12 13:06:35 +020041 vppapigen --input $^ JSON --output $@
Ole Troanf14e3bf2016-12-01 21:49:03 +010042
Anlu Yan04f8d3f2017-02-22 09:18:11 -080043apidir = $(prefix)/api/plugins
44apiincludedir = ${includedir}/vpp_plugins
Ole Troanf14e3bf2016-12-01 21:49:03 +010045
Anlu Yan04f8d3f2017-02-22 09:18:11 -080046api_DATA = \
47 $(patsubst %.api,%.api.json,$(API_FILES))
Ed Warnickecb9cada2015-12-08 15:45:58 -070048
Anlu Yan04f8d3f2017-02-22 09:18:11 -080049BUILT_SOURCES += \
50 $(patsubst %.api,%.api.h,$(API_FILES))
51
Ed Warnickecb9cada2015-12-08 15:45:58 -070052
Damjan Marion905a7f52016-07-07 20:27:49 +020053# Remove *.la files
Ed Warnickecb9cada2015-12-08 15:45:58 -070054install-data-hook:
Damjan Marion905a7f52016-07-07 20:27:49 +020055 @(cd $(vpppluginsdir) && $(RM) $(vppplugins_LTLIBRARIES))
56 @(cd $(vppapitestpluginsdir) && $(RM) $(vppapitestplugins_LTLIBRARIES))
Burt Silverman006eb472017-01-27 15:29:54 -050057
58CLEANFILES = $(BUILT_SOURCES)