8d37595870251ccb3918ece15dada5af936a68fa
[vpp.git] / src / vppinfra.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 lib_LTLIBRARIES += libvppinfra.la
15
16 TESTS =
17
18 if ENABLE_TESTS
19 TESTS  +=  test_bihash_template \
20            test_dlist \
21            test_elog \
22            test_elf \
23            test_fifo \
24            test_format \
25            test_hash \
26            test_heap \
27            test_longjmp \
28            test_macros \
29            test_md5 \
30            test_mheap \
31            test_pool_iterate \
32            test_ptclosure \
33            test_random \
34            test_random_isaac \
35            test_serialize \
36            test_slist \
37            test_socket \
38            test_time \
39            test_timing_wheel \
40            test_tw_timer \
41            test_vec \
42            test_zvec
43 endif
44
45 noinst_PROGRAMS = $(TESTS)
46 check_PROGRAMS  = $(TESTS)
47
48 test_bihash_template_SOURCES = vppinfra/test_bihash_template.c
49 test_dlist_SOURCES = vppinfra/test_dlist.c
50 test_elog_SOURCES = vppinfra/test_elog.c
51 test_elf_SOURCES = vppinfra/test_elf.c
52 test_fifo_SOURCES = vppinfra/test_fifo.c
53 test_format_SOURCES = vppinfra/test_format.c
54 test_hash_SOURCES = vppinfra/test_hash.c
55 test_heap_SOURCES = vppinfra/test_heap.c
56 test_longjmp_SOURCES = vppinfra/test_longjmp.c
57 test_macros_SOURCES = vppinfra/test_macros.c
58 test_md5_SOURCES = vppinfra/test_md5.c
59 test_mheap_SOURCES = vppinfra/test_mheap.c
60 test_pool_iterate_SOURCES = vppinfra/test_pool_iterate.c
61 test_ptclosure_SOURCES = vppinfra/test_ptclosure.c
62 test_random_SOURCES = vppinfra/test_random.c
63 test_random_isaac_SOURCES = vppinfra/test_random_isaac.c
64 test_serialize_SOURCES = vppinfra/test_serialize.c
65 test_slist_SOURCES = vppinfra/test_slist.c
66 test_socket_SOURCES = vppinfra/test_socket.c
67 test_time_SOURCES = vppinfra/test_time.c
68 test_timing_wheel_SOURCES = vppinfra/test_timing_wheel.c
69 test_tw_timer_SOURCES = vppinfra/test_tw_timer.c
70 test_vec_SOURCES = vppinfra/test_vec.c
71 test_zvec_SOURCES = vppinfra/test_zvec.c
72
73 # All unit tests use ASSERT for failure
74 # So we'll need -DDEBUG to enable ASSERTs
75 test_bihash_template_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
76 test_dlist_CPPFLAGS =   $(AM_CPPFLAGS) -DCLIB_DEBUG
77 test_elog_CPPFLAGS =    $(AM_CPPFLAGS) -DCLIB_DEBUG
78 test_elf_CPPFLAGS =     $(AM_CPPFLAGS) -DCLIB_DEBUG
79 test_fifo_CPPFLAGS =    $(AM_CPPFLAGS) -DCLIB_DEBUG
80 test_format_CPPFLAGS =  $(AM_CPPFLAGS) -DCLIB_DEBUG
81 test_hash_CPPFLAGS =    $(AM_CPPFLAGS) -DCLIB_DEBUG
82 test_heap_CPPFLAGS =    $(AM_CPPFLAGS) -DCLIB_DEBUG
83 test_longjmp_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
84 test_macros_CPPFLAGS =  $(AM_CPPFLAGS) -DCLIB_DEBUG
85 test_md5_CPPFLAGS =     $(AM_CPPFLAGS) -DCLIB_DEBUG
86 test_mheap_CPPFLAGS =   $(AM_CPPFLAGS) -DCLIB_DEBUG
87 test_pool_iterate_CPPFLAGS =    $(AM_CPPFLAGS) -DCLIB_DEBUG
88 test_ptclosure_CPPFLAGS =       $(AM_CPPFLAGS) -DCLIB_DEBUG
89 test_random_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
90 test_random_isaac_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
91 test_socket_CPPFLAGS =  $(AM_CPPFLAGS) -DCLIB_DEBUG
92 test_serialize_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
93 test_slist_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
94 test_time_CPPFLAGS =    $(AM_CPPFLAGS) -DCLIB_DEBUG
95 test_timing_wheel_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
96 test_tw_timer_CPPFLAGS =        $(AM_CPPFLAGS) -DCLIB_DEBUG
97 test_vec_CPPFLAGS =     $(AM_CPPFLAGS) -DCLIB_DEBUG
98 test_zvec_CPPFLAGS =    $(AM_CPPFLAGS) -DCLIB_DEBUG
99
100 test_bihash_template_LDADD =    libvppinfra.la
101 test_dlist_LDADD =      libvppinfra.la
102 test_elog_LDADD =       libvppinfra.la
103 test_elf_LDADD =        libvppinfra.la
104 test_fifo_LDADD =       libvppinfra.la
105 test_format_LDADD =     libvppinfra.la
106 test_hash_LDADD =       libvppinfra.la
107 test_heap_LDADD =       libvppinfra.la
108 test_longjmp_LDADD =    libvppinfra.la
109 test_macros_LDADD =     libvppinfra.la
110 test_md5_LDADD =        libvppinfra.la
111 test_mheap_LDADD =      libvppinfra.la
112 test_pool_iterate_LDADD =       libvppinfra.la
113 test_ptclosure_LDADD =  libvppinfra.la
114 test_random_LDADD =     libvppinfra.la
115 test_random_isaac_LDADD =       libvppinfra.la
116 test_serialize_LDADD =  libvppinfra.la
117 test_slist_LDADD =      libvppinfra.la
118 test_socket_LDADD =     libvppinfra.la
119 test_time_LDADD =       libvppinfra.la -lm
120 test_timing_wheel_LDADD =       libvppinfra.la -lm
121 test_tw_timer_LDADD =   libvppinfra.la
122 test_vec_LDADD =        libvppinfra.la
123 test_zvec_LDADD =       libvppinfra.la
124
125 test_bihash_template_LDFLAGS = -static
126 test_dlist_LDFLAGS = -static
127 test_elog_LDFLAGS = -static
128 test_elf_LDFLAGS = -static
129 test_fifo_LDFLAGS = -static
130 test_format_LDFLAGS = -static
131 test_hash_LDFLAGS = -static
132 test_heap_LDFLAGS = -static
133 test_longjmp_LDFLAGS = -static
134 test_macros_LDFLAGS = -static
135 test_md5_LDFLAGS = -static
136 test_mheap_LDFLAGS = -static
137 test_pool_iterate_LDFLAGS = -static
138 test_ptclosure_LDFLAGS = -static
139 test_random_LDFLAGS = -static
140 test_random_isaac_LDFLAGS = -static
141 test_serialize_LDFLAGS = -static
142 test_slist_LDFLAGS = -static
143 test_socket_LDFLAGS = -static
144 test_time_LDFLAGS = -static
145 test_timing_wheel_LDFLAGS = -static
146 test_tw_timer_LDFLAGS = -static
147 test_vec_LDFLAGS = -static
148 test_zvec_LDFLAGS = -static
149
150 # noinst_PROGRAMS += test_vhash
151 # test_vhash_SOURCES = vppinfra/test_vhash.c vppinfra/vhash.c
152 # test_vhash_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
153 # test_vhash_LDADD = libvppinfra.la
154 # test_vhash_LDFLAGS = -static
155
156 nobase_include_HEADERS = \
157   vppinfra/asm_mips.h \
158   vppinfra/asm_x86.h \
159   vppinfra/bihash_8_8.h \
160   vppinfra/bihash_24_8.h \
161   vppinfra/bihash_template.h \
162   vppinfra/bihash_template.c \
163   vppinfra/bitmap.h \
164   vppinfra/bitops.h \
165   vppinfra/byte_order.h \
166   vppinfra/cache.h \
167   vppinfra/clib.h \
168   vppinfra/cpu.h \
169   vppinfra/dlist.h \
170   vppinfra/elf.h \
171   vppinfra/elf_clib.h \
172   vppinfra/elog.h \
173   vppinfra/fheap.h \
174   vppinfra/error.h \
175   vppinfra/error_bootstrap.h \
176   vppinfra/fifo.h \
177   vppinfra/format.h \
178   vppinfra/graph.h \
179   vppinfra/hash.h \
180   vppinfra/heap.h \
181   vppinfra/longjmp.h \
182   vppinfra/macros.h \
183   vppinfra/math.h \
184   vppinfra/md5.h \
185   vppinfra/mem.h \
186   vppinfra/memcpy_sse3.h \
187   vppinfra/memcpy_avx.h \
188   vppinfra/mhash.h \
189   vppinfra/mheap.h \
190   vppinfra/mheap_bootstrap.h \
191   vppinfra/os.h \
192   vppinfra/pipeline.h \
193   vppinfra/pool.h \
194   vppinfra/ptclosure.h \
195   vppinfra/random.h \
196   vppinfra/random_buffer.h \
197   vppinfra/random_isaac.h \
198   vppinfra/serialize.h \
199   vppinfra/slist.h \
200   vppinfra/smp.h \
201   vppinfra/socket.h \
202   vppinfra/sparse_vec.h \
203   vppinfra/string.h \
204   vppinfra/time.h \
205   vppinfra/timing_wheel.h \
206   vppinfra/timer.h \
207   vppinfra/tw_timer_2t_1w_2048sl.h \
208   vppinfra/tw_timer_16t_2w_512sl.h \
209   vppinfra/tw_timer_template.h \
210   vppinfra/tw_timer_template.c \
211   vppinfra/types.h \
212   vppinfra/unix.h \
213   vppinfra/vec.h \
214   vppinfra/vec_bootstrap.h \
215   vppinfra/vector.h \
216   vppinfra/vector_altivec.h \
217   vppinfra/vector_funcs.h \
218   vppinfra/vector_iwmmxt.h \
219   vppinfra/vector_neon.h \
220   vppinfra/vector_sse2.h \
221   vppinfra/valgrind.h \
222   vppinfra/vm_unix.h \
223   vppinfra/xxhash.h \
224   vppinfra/xy.h \
225   vppinfra/zvec.h
226
227 CLIB_CORE = \
228   vppinfra/asm_x86.c \
229   vppinfra/backtrace.c \
230   vppinfra/bihash_8_8.h \
231   vppinfra/bihash_24_8.h \
232   vppinfra/bihash_template.h \
233   vppinfra/cpu.c \
234   vppinfra/elf.c \
235   vppinfra/elog.c \
236   vppinfra/error.c \
237   vppinfra/fifo.c \
238   vppinfra/fheap.c \
239   vppinfra/format.c \
240   vppinfra/graph.c \
241   vppinfra/hash.c \
242   vppinfra/heap.c \
243   vppinfra/longjmp.S \
244   vppinfra/macros.c \
245   vppinfra/mhash.c \
246   vppinfra/mheap.c \
247   vppinfra/md5.c \
248   vppinfra/mem_mheap.c \
249   vppinfra/ptclosure.c \
250   vppinfra/random.c \
251   vppinfra/random_buffer.c \
252   vppinfra/random_isaac.c \
253   vppinfra/serialize.c \
254   vppinfra/slist.c \
255   vppinfra/std-formats.c \
256   vppinfra/string.c \
257   vppinfra/time.c \
258   vppinfra/timing_wheel.c \
259   vppinfra/tw_timer_template.h \
260   vppinfra/tw_timer_2t_1w_2048sl.h \
261   vppinfra/tw_timer_2t_1w_2048sl.c \
262   vppinfra/tw_timer_16t_2w_512sl.h \
263   vppinfra/tw_timer_16t_2w_512sl.c \
264   vppinfra/unformat.c \
265   vppinfra/vec.c \
266   vppinfra/vector.c \
267   vppinfra/zvec.c
268
269 # Core plus Unix additions
270 libvppinfra_la_SOURCES =                        \
271   $(CLIB_CORE)                                  \
272   vppinfra/elf_clib.c                           \
273   vppinfra/socket.c                             \
274   vppinfra/timer.c                              \
275   vppinfra/unix-formats.c                       \
276   vppinfra/unix-misc.c
277
278 bin_PROGRAMS = elftool
279
280 elftool_SOURCES = tools/elftool/elftool.c
281 elftool_CPPFLAGS = $(AM_CPPFLAGS)
282 elftool_LDADD = libvppinfra.la -lpthread -lrt -lm
283
284 # vi:syntax=automake