Makefile.am revision a72e5a1c
1
2# Copyright (c) <current-year> <your-organization>
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at:
6# 
7#     http://www.apache.org/licenses/LICENSE-2.0
8# 
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15AUTOMAKE_OPTIONS = foreign subdir-objects
16
17AM_CFLAGS = -Wall -I@TOOLKIT_INCLUDE@
18
19lib_LTLIBRARIES = nsh_plugin.la nsh_test_plugin.la
20nsh_plugin_la_SOURCES = nsh/nsh.c  \
21	nsh/nsh_plugin.api.h 
22nsh_plugin_la_LDFLAGS = -module
23
24BUILT_SOURCES = nsh/nsh.api.h
25
26SUFFIXES = .api.h .api
27
28%.api.h: %.api
29	mkdir -p `dirname $@` ; \
30	$(CC) $(CPPFLAGS) -E -P -C -x c $^ \
31	| vppapigen --input - --output $@ --show-name $@
32
33nobase_include_HEADERS =			\
34  nsh/nsh_all_api_h.h			\
35  nsh/nsh_msg_enum.h			\
36  nsh/nsh.api.h
37
38nsh_test_plugin_la_SOURCES = \
39  nsh/nsh_test.c nsh/nsh_plugin.api.h
40nsh_test_plugin_la_LDFLAGS = -module
41
42install-data-hook:
43	mkdir $(prefix)/lib/vpp_plugins || true
44	mkdir $(prefix)/lib/vpp_api_test_plugins || true
45	cp $(prefix)/lib/nsh_plugin.so.*.*.* $(prefix)/lib/vpp_plugins/nsh_plugin.so
46	cp $(prefix)/lib/nsh_test_plugin.so.*.*.* \
47		$(prefix)/lib/vpp_api_test_plugins/nsh_test_plugin.so
48	rm -f $(prefix)/lib/nsh_plugin.*
49	rm -f $(prefix)/lib/nsh_test_plugin.*
50
51