API: Cleaning up message naming that does not follow the conventions
[vpp.git] / src / vpp.am
1 # 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
14 bin_PROGRAMS += bin/vpp
15
16 bin_vpp_SOURCES =                               \
17   vpp/vnet/main.c                               \
18   vpp/app/vpe_cli.c                             \
19   vpp/app/version.c                             \
20   vpp/oam/oam.c                                 \
21   vpp/stats/stats.c
22
23 bin_vpp_SOURCES +=                              \
24   vpp/api/api.c                                 \
25   vpp/api/custom_dump.c                         \
26   vpp/api/json_format.c
27
28 if WITH_APICLI
29   bin_vpp_SOURCES +=                            \
30   vpp/api/api_format.c                          \
31   vpp/api/api_main.c                            \
32   vpp/api/plugin.c                              \
33   vpp/api/plugin.h
34 endif
35
36 # comment out to disable stats upload to gmond
37
38 bin_vpp_CFLAGS = @APICLI@
39 bin_vpp_SOURCES +=                              \
40   vpp/api/gmon.c
41
42 nobase_include_HEADERS +=                       \
43   vpp/api/vpe_all_api_h.h                       \
44   vpp/api/vpe_msg_enum.h                        \
45   vpp/api/vpe.api.h
46
47 API_FILES += vpp/api/vpe.api
48
49 BUILT_SOURCES += .version
50
51 vpp/app/version.o:      vpp/app/version.h
52
53 .PHONY: .version
54
55 VPP_VERSION = $(shell $(srcdir)/scripts/version)
56
57 VPP_BUILD_DATE ?= $$(date)
58 VPP_BUILD_USER ?= $$(whoami)
59 VPP_BUILD_HOST ?= $$(hostname)
60
61 # update version.h only when version changes, to avoid
62 # unnecessary re-linking of vpp binary
63
64 .version:
65         @if [ "$$(cat .version 2> /dev/null)" != "$(VPP_VERSION)" ] ; then              \
66           f="vpp/app/version.h"                                                         ;\
67           echo "  VERSION  $$f ($(VPP_VERSION))"                                        ;\
68           echo $(VPP_VERSION) > .version                                                ;\
69           echo "#define VPP_BUILD_DATE \"$(VPP_BUILD_DATE)\"" > $$f                             ;\
70           echo "#define VPP_BUILD_USER \"$(VPP_BUILD_USER)\"" >> $$f                            ;\
71           echo "#define VPP_BUILD_HOST \"$(VPP_BUILD_HOST)\"" >> $$f                            ;\
72           echo -n "#define VPP_BUILD_TOPDIR " >> $$f                                    ;\
73           echo "\"$$(cd $(srcdir) && git rev-parse --show-toplevel)\"" >> $$f           ;\
74           echo "#define VPP_BUILD_VER \"$(VPP_VERSION)\"" >> $$f                        ;\
75         fi
76
77 bin_vpp_LDADD = \
78   libvlibmemory.la \
79   libvlib.la \
80   libvnet.la \
81   libsvm.la \
82   libsvmdb.la \
83   libvppinfra.la \
84   -lrt -lm -lpthread -ldl
85
86 bin_vpp_LDFLAGS = -Wl,--export-dynamic
87
88 if ENABLE_TESTS
89 noinst_PROGRAMS += bin/test_client
90
91 bin_test_client_SOURCES = \
92   vpp/api/test_client.c
93
94 bin_test_client_LDADD = \
95   libvlibmemoryclient.la \
96   libsvm.la \
97   libvppinfra.la \
98   -lpthread -lm -lrt
99
100 noinst_PROGRAMS += bin/test_client bin/test_ha
101
102 bin_test_ha_SOURCES = \
103   vpp/api/test_ha.c
104
105 bin_test_ha_LDADD = \
106   libvlibmemoryclient.la \
107   libsvm.la \
108   libvppinfra.la \
109   -lpthread -lm -lrt
110 endif
111
112 noinst_PROGRAMS += bin/summary_stats_client
113
114 bin_summary_stats_client_SOURCES = \
115   vpp/api/summary_stats_client.c
116
117 bin_summary_stats_client_LDADD = \
118   libvlibmemoryclient.la \
119   libsvm.la \
120   libvppinfra.la \
121   -lpthread -lm -lrt
122
123 bin_PROGRAMS += bin/vpp_get_metrics
124
125 bin_vpp_get_metrics_SOURCES = \
126   vpp/api/vpp_get_metrics.c
127
128 bin_vpp_get_metrics_LDADD = \
129   libsvmdb.la \
130   libsvm.la \
131   libvppinfra.la \
132   -lpthread -lm -lrt
133
134 CLEANFILES += vpp/app/version.h
135
136 # vi:syntax=automake