blob: a105afdd52b2e60ce357ec9bff05a649e4320e1c [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 Marion905a7f52016-07-07 20:27:49 +020016AM_CFLAGS = -Wall
17AM_LDFLAGS = -module -shared -avoid-version
Ed Warnickecb9cada2015-12-08 15:45:58 -070018
Damjan Marion905a7f52016-07-07 20:27:49 +020019vppapitestpluginsdir = ${libdir}/vpp_api_test_plugins
20vpppluginsdir = ${libdir}/vpp_plugins
21
22vppapitestplugins_LTLIBRARIES = sample_test_plugin.la
23vppplugins_LTLIBRARIES = sample_plugin.la
24
Ed Warnickecb9cada2015-12-08 15:45:58 -070025sample_plugin_la_SOURCES = sample/sample.c sample/node.c \
Damjan Marion905a7f52016-07-07 20:27:49 +020026 sample/sample_plugin.api.h
Ed Warnickecb9cada2015-12-08 15:45:58 -070027
Ole Troanf14e3bf2016-12-01 21:49:03 +010028BUILT_SOURCES = sample/sample.api.h sample/sample.api.json
Ed Warnickecb9cada2015-12-08 15:45:58 -070029
30SUFFIXES = .api.h .api
31
32%.api.h: %.api
33 mkdir -p `dirname $@` ; \
34 $(CC) $(CPPFLAGS) -E -P -C -x c $^ \
35 | vppapigen --input - --output $@ --show-name $@
36
Ole Troanf14e3bf2016-12-01 21:49:03 +010037%.api.json: %.api
38 @echo " JSON APIGEN " $@ ; \
39 mkdir -p `dirname $@` ; \
40 $(CC) $(CPPFLAGS) -E -P -C -x c $^ \
41 | vppapigen --input - --json $@
42
43apidir = $(prefix)/sample/
Damjan Mariona18c7c02017-01-17 22:38:58 +010044api_DATA = sample/sample.api.json
Ole Troanf14e3bf2016-12-01 21:49:03 +010045
Damjan Marion905a7f52016-07-07 20:27:49 +020046noinst_HEADERS = \
Ed Warnickecb9cada2015-12-08 15:45:58 -070047 sample/sample_all_api_h.h \
48 sample/sample_msg_enum.h \
49 sample/sample.api.h
50
51sample_test_plugin_la_SOURCES = sample/sample_test.c sample/sample_plugin.api.h
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)