new version handling
[vpp.git] / vpp / Makefile.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 AUTOMAKE_OPTIONS = foreign subdir-objects
15
16 AM_CFLAGS = -Wall @Q_PLATFORM_DEFINE@ @Q_PLATFORM_PLUGPATH@ @DPDK@
17
18 noinst_PROGRAMS = 
19 BUILT_SOURCES =
20 bin_PROGRAMS = 
21 CLEANFILES = 
22 lib_LTLIBRARIES =
23
24 bin_PROGRAMS += vpe
25
26 vpe_SOURCES =                                   \
27   vnet/main.c                                   \
28   app/vpe_cli.c                                 \
29   app/version.c                                 \
30   oam/oam.c                                     \
31   stats/stats.c
32
33 vpe_SOURCES +=                                  \
34   api/api.c                                     \
35   api/custom_dump.c
36
37 # comment out to disable stats upload to gmond 
38
39 vpe_SOURCES +=                                  \
40   api/gmon.c    
41
42 nobase_include_HEADERS =                        \
43   api/vpe_all_api_h.h                           \
44   api/vpe_msg_enum.h                            \
45   api/vpe.api.h
46
47 # install the API definition, so we can produce java bindings, etc.
48
49 apidir = $(prefix)/api
50 api_DATA = api/vpe.api
51
52 BUILT_SOURCES += api/vpe.api.h app/version.h
53
54 .PHONY: app/version.h
55
56 app/version.h: ../build-root/scripts/version
57         @echo "#define VPP_BUILD_DATE \"$$(date)\""                              > $@
58         @echo "#define VPP_BUILD_USER \"$$(whoami)\""                           >> $@
59         @echo "#define VPP_BUILD_HOST \"$$(hostname)\""                         >> $@
60         @echo "#define VPP_BUILD_TOPDIR \"$$(git rev-parse --show-toplevel)\""  >> $@
61         @echo "#define VPP_BUILD_VER \"$$(../../scripts/version)\""             >> $@
62
63 vpe_LDADD = -lvlibapi -lvlibmemory  -lvlib_unix -lvlib 
64
65 vpe_LDADD += -l:libvnet.a
66
67 vpe_LDADD += -lsvm -lsvmdb -lrt
68
69 vpe_LDADD += -lvnetplugin
70
71 if WITH_DPDK
72 vpe_LDADD += -l:libdpdk.a
73 endif
74
75 # These go last
76
77 vpe_LDADD += -lvppinfra -lm -lpthread -lcrypto -ldl
78
79 SUFFIXES = .api.h .api
80
81 %.api.h: %.api
82         @echo "  APIGEN  " $@ ;                                 \
83         @mkdir -p `dirname $@` ;                                \
84         $(CC) $(CPPFLAGS) -E -P -C -x c $^                      \
85         | vppapigen --input - --output $@ --show-name $@
86
87
88 noinst_PROGRAMS += test_client test_ha
89
90 test_client_SOURCES = api/test_client.c
91 test_client_LDADD = -lvlibmemoryclient -lvlibapi -lsvm -lvppinfra \
92         -lpthread -lm -lrt
93
94 test_ha_SOURCES = api/test_ha.c
95 test_ha_LDADD = -lvlibmemoryclient -lvlibapi -lsvmdb -lsvm -lvppinfra \
96                 -lpthread -lm -lrt
97
98 noinst_PROGRAMS += summary_stats_client
99
100 summary_stats_client_SOURCES = api/summary_stats_client.c
101 summary_stats_client_LDADD = -lvlibmemoryclient -lvlibapi -lsvm -lvppinfra \
102         -lpthread -lm -lrt