Makefile.am revision 24bb3c19
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
16SUBDIRS=java
17AM_CFLAGS = -Wall -I@TOOLKIT_INCLUDE@
18
19nsh_plugin_la_CPPFLAGS = -DDEBUG -g
20nsh_test_plugin_la_CPPFLAGS = -DDEBUG -g
21
22CPPFLAGS += -DDEBUG -g
23
24lib_LTLIBRARIES = nsh_plugin.la nsh_test_plugin.la
25nsh_plugin_la_SOURCES = nsh/nsh.c  \
26	nsh/nsh_plugin.api.h 
27nsh_plugin_la_LDFLAGS = -module
28
29BUILT_SOURCES = vpp-api/nsh.api.h
30
31SUFFIXES = .api.h .api
32
33vpp-api/%.api.h: nsh/%.api
34	mkdir -p `dirname $@` ; \
35	$(CC) $(CPPFLAGS) -E -P -C -x c $^ \
36	| vppapigen --input - --output $@ --show-name $@
37
38nobase_include_HEADERS =			\
39  vpp-api/nsh_all_api_h.h			\
40  vpp-api/nsh_msg_enum.h			\
41  vpp-api/nsh.api.h
42
43nsh_test_plugin_la_SOURCES = \
44  nsh/nsh_test.c nsh/nsh_plugin.api.h
45nsh_test_plugin_la_LDFLAGS = -module
46
47install-data-hook:
48	mkdir $(prefix)/lib/vpp_plugins || true
49	mkdir $(prefix)/lib/vpp_api_test_plugins || true
50	cp $(prefix)/lib/nsh_plugin.so.*.*.* $(prefix)/lib/vpp_plugins/nsh_plugin.so
51	cp $(prefix)/lib/nsh_test_plugin.so.*.*.* \
52		$(prefix)/lib/vpp_api_test_plugins/nsh_test_plugin.so
53	rm -f $(prefix)/lib/nsh_plugin.*
54	rm -f $(prefix)/lib/nsh_test_plugin.*
55
56pkg-rpm: all install
57	cd $(srcdir)/packaging/rpm; \
58	rpmbuild -bb --define "_topdir $$PWD" \
59		--define "_plugin_prefix ${prefix}" vpp-nsh-plugin.spec
60