blob: 8fcae86f88e3fa28936a7374c399987c681023ed [file] [log] [blame]
Damjan Marion7cd468a2016-12-19 23:05:39 +01001# 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
Damjan Marion724f64c2017-01-11 11:11:00 +010014lib_LTLIBRARIES += libvppinfra.la
Damjan Marion7cd468a2016-12-19 23:05:39 +010015
Dave Barach310518e2017-10-30 09:42:54 -040016TESTS =
Damjan Marion7cd468a2016-12-19 23:05:39 +010017
18if ENABLE_TESTS
19TESTS += test_bihash_template \
Dave Barach310518e2017-10-30 09:42:54 -040020 test_bihash_vec88 \
21 test_cuckoo_bihash \
22 test_cuckoo_template\
Damjan Marion7cd468a2016-12-19 23:05:39 +010023 test_dlist \
Damjan Marion7cd468a2016-12-19 23:05:39 +010024 test_elf \
Dave Barachb7f1faa2017-08-29 11:43:37 -040025 test_elog \
Damjan Marion7cd468a2016-12-19 23:05:39 +010026 test_fifo \
27 test_format \
Dave Barachb7f1faa2017-08-29 11:43:37 -040028 test_fpool \
Damjan Marion7cd468a2016-12-19 23:05:39 +010029 test_hash \
30 test_heap \
31 test_longjmp \
32 test_macros \
Dave Barache9d91702017-11-29 16:59:01 -050033 test_maplog \
Damjan Marion7cd468a2016-12-19 23:05:39 +010034 test_md5 \
35 test_mheap \
36 test_pool_iterate \
37 test_ptclosure \
38 test_random \
39 test_random_isaac \
40 test_serialize \
41 test_slist \
42 test_socket \
43 test_time \
44 test_timing_wheel \
Dave Barach8e8f98c2017-02-03 11:58:53 -050045 test_tw_timer \
Damjan Marion7cd468a2016-12-19 23:05:39 +010046 test_vec \
Neale Ranns32e1c012016-11-22 17:07:28 +000047 test_zvec
Damjan Marion7cd468a2016-12-19 23:05:39 +010048endif
49
50noinst_PROGRAMS = $(TESTS)
51check_PROGRAMS = $(TESTS)
52
53test_bihash_template_SOURCES = vppinfra/test_bihash_template.c
Dave Barach310518e2017-10-30 09:42:54 -040054test_bihash_vec88_SOURCES = vppinfra/test_bihash_vec88.c
Klement Sekera470a0112017-03-08 05:21:24 +010055test_cuckoo_template_SOURCES = vppinfra/test_cuckoo_template.c
56test_cuckoo_bihash_SOURCES = vppinfra/test_cuckoo_bihash.c
Damjan Marion7cd468a2016-12-19 23:05:39 +010057test_dlist_SOURCES = vppinfra/test_dlist.c
Damjan Marion7cd468a2016-12-19 23:05:39 +010058test_elf_SOURCES = vppinfra/test_elf.c
Dave Barachb7f1faa2017-08-29 11:43:37 -040059test_elog_SOURCES = vppinfra/test_elog.c
Damjan Marion7cd468a2016-12-19 23:05:39 +010060test_fifo_SOURCES = vppinfra/test_fifo.c
61test_format_SOURCES = vppinfra/test_format.c
Dave Barachb7f1faa2017-08-29 11:43:37 -040062test_fpool_SOURCES = vppinfra/test_fpool.c
Damjan Marion7cd468a2016-12-19 23:05:39 +010063test_hash_SOURCES = vppinfra/test_hash.c
64test_heap_SOURCES = vppinfra/test_heap.c
65test_longjmp_SOURCES = vppinfra/test_longjmp.c
66test_macros_SOURCES = vppinfra/test_macros.c
Dave Barache9d91702017-11-29 16:59:01 -050067test_maplog_SOURCES = vppinfra/test_maplog.c
Damjan Marion7cd468a2016-12-19 23:05:39 +010068test_md5_SOURCES = vppinfra/test_md5.c
69test_mheap_SOURCES = vppinfra/test_mheap.c
70test_pool_iterate_SOURCES = vppinfra/test_pool_iterate.c
71test_ptclosure_SOURCES = vppinfra/test_ptclosure.c
Damjan Marion7cd468a2016-12-19 23:05:39 +010072test_random_isaac_SOURCES = vppinfra/test_random_isaac.c
Dave Barachb7f1faa2017-08-29 11:43:37 -040073test_random_SOURCES = vppinfra/test_random.c
Damjan Marion7cd468a2016-12-19 23:05:39 +010074test_serialize_SOURCES = vppinfra/test_serialize.c
75test_slist_SOURCES = vppinfra/test_slist.c
76test_socket_SOURCES = vppinfra/test_socket.c
77test_time_SOURCES = vppinfra/test_time.c
78test_timing_wheel_SOURCES = vppinfra/test_timing_wheel.c
Dave Barach8e8f98c2017-02-03 11:58:53 -050079test_tw_timer_SOURCES = vppinfra/test_tw_timer.c
Damjan Marion7cd468a2016-12-19 23:05:39 +010080test_vec_SOURCES = vppinfra/test_vec.c
81test_zvec_SOURCES = vppinfra/test_zvec.c
82
83# All unit tests use ASSERT for failure
84# So we'll need -DDEBUG to enable ASSERTs
85test_bihash_template_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
Dave Barach310518e2017-10-30 09:42:54 -040086test_bihash_vec88_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
Klement Sekera470a0112017-03-08 05:21:24 +010087test_cuckoo_template_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
88test_cuckoo_bihash_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
Damjan Marion7cd468a2016-12-19 23:05:39 +010089test_dlist_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
Damjan Marion7cd468a2016-12-19 23:05:39 +010090test_elf_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
Dave Barachb7f1faa2017-08-29 11:43:37 -040091test_elog_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
Damjan Marion7cd468a2016-12-19 23:05:39 +010092test_fifo_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
93test_format_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
Dave Barachb7f1faa2017-08-29 11:43:37 -040094test_fpool_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
Damjan Marion7cd468a2016-12-19 23:05:39 +010095test_hash_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
96test_heap_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
97test_longjmp_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
98test_macros_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
Dave Barache9d91702017-11-29 16:59:01 -050099test_maplog_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
Damjan Marion7cd468a2016-12-19 23:05:39 +0100100test_md5_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
101test_mheap_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
102test_pool_iterate_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
103test_ptclosure_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
104test_random_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
105test_random_isaac_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
Damjan Marion7cd468a2016-12-19 23:05:39 +0100106test_serialize_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
107test_slist_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
Dave Barachb7f1faa2017-08-29 11:43:37 -0400108test_socket_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
Damjan Marion7cd468a2016-12-19 23:05:39 +0100109test_time_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
110test_timing_wheel_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
Dave Barach8e8f98c2017-02-03 11:58:53 -0500111test_tw_timer_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
Damjan Marion7cd468a2016-12-19 23:05:39 +0100112test_vec_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
113test_zvec_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
114
115test_bihash_template_LDADD = libvppinfra.la
Dave Barach310518e2017-10-30 09:42:54 -0400116test_bihash_vec88_LDADD = libvppinfra.la
Klement Sekera470a0112017-03-08 05:21:24 +0100117test_cuckoo_template_LDADD = libvppinfra.la
118test_cuckoo_bihash_LDADD = libvppinfra.la
Damjan Marion7cd468a2016-12-19 23:05:39 +0100119test_dlist_LDADD = libvppinfra.la
Damjan Marion7cd468a2016-12-19 23:05:39 +0100120test_elf_LDADD = libvppinfra.la
Dave Barachb7f1faa2017-08-29 11:43:37 -0400121test_elog_LDADD = libvppinfra.la
Damjan Marion7cd468a2016-12-19 23:05:39 +0100122test_fifo_LDADD = libvppinfra.la
123test_format_LDADD = libvppinfra.la
Dave Barachb7f1faa2017-08-29 11:43:37 -0400124test_fpool_LDADD = libvppinfra.la
Damjan Marion7cd468a2016-12-19 23:05:39 +0100125test_hash_LDADD = libvppinfra.la
126test_heap_LDADD = libvppinfra.la
127test_longjmp_LDADD = libvppinfra.la
128test_macros_LDADD = libvppinfra.la
Dave Barache9d91702017-11-29 16:59:01 -0500129test_maplog_LDADD = libvppinfra.la
Damjan Marion7cd468a2016-12-19 23:05:39 +0100130test_md5_LDADD = libvppinfra.la
131test_mheap_LDADD = libvppinfra.la
132test_pool_iterate_LDADD = libvppinfra.la
133test_ptclosure_LDADD = libvppinfra.la
Damjan Marion7cd468a2016-12-19 23:05:39 +0100134test_random_isaac_LDADD = libvppinfra.la
Dave Barachb7f1faa2017-08-29 11:43:37 -0400135test_random_LDADD = libvppinfra.la
Damjan Marion7cd468a2016-12-19 23:05:39 +0100136test_serialize_LDADD = libvppinfra.la
137test_slist_LDADD = libvppinfra.la
138test_socket_LDADD = libvppinfra.la
139test_time_LDADD = libvppinfra.la -lm
140test_timing_wheel_LDADD = libvppinfra.la -lm
Dave Barach8e8f98c2017-02-03 11:58:53 -0500141test_tw_timer_LDADD = libvppinfra.la
Damjan Marion7cd468a2016-12-19 23:05:39 +0100142test_vec_LDADD = libvppinfra.la
143test_zvec_LDADD = libvppinfra.la
144
145test_bihash_template_LDFLAGS = -static
Dave Barach310518e2017-10-30 09:42:54 -0400146test_bihash_vec88_LDFLAGS = -static
Klement Sekera470a0112017-03-08 05:21:24 +0100147test_cuckoo_template_LDFLAGS = -static
148test_cuckoo_bihash_LDFLAGS = -static -lpthread
Damjan Marion7cd468a2016-12-19 23:05:39 +0100149test_dlist_LDFLAGS = -static
Damjan Marion7cd468a2016-12-19 23:05:39 +0100150test_elf_LDFLAGS = -static
Dave Barachb7f1faa2017-08-29 11:43:37 -0400151test_elog_LDFLAGS = -static
Damjan Marion7cd468a2016-12-19 23:05:39 +0100152test_fifo_LDFLAGS = -static
153test_format_LDFLAGS = -static
Dave Barachb7f1faa2017-08-29 11:43:37 -0400154test_fpool_LDFLAGS = -static
Damjan Marion7cd468a2016-12-19 23:05:39 +0100155test_hash_LDFLAGS = -static
156test_heap_LDFLAGS = -static
157test_longjmp_LDFLAGS = -static
158test_macros_LDFLAGS = -static
Dave Barache9d91702017-11-29 16:59:01 -0500159test_maplog_LDFLAGS = -static
Damjan Marion7cd468a2016-12-19 23:05:39 +0100160test_md5_LDFLAGS = -static
161test_mheap_LDFLAGS = -static
162test_pool_iterate_LDFLAGS = -static
163test_ptclosure_LDFLAGS = -static
Damjan Marion7cd468a2016-12-19 23:05:39 +0100164test_random_isaac_LDFLAGS = -static
Dave Barachb7f1faa2017-08-29 11:43:37 -0400165test_random_LDFLAGS = -static
Damjan Marion7cd468a2016-12-19 23:05:39 +0100166test_serialize_LDFLAGS = -static
167test_slist_LDFLAGS = -static
168test_socket_LDFLAGS = -static
169test_time_LDFLAGS = -static
170test_timing_wheel_LDFLAGS = -static
Dave Barach8e8f98c2017-02-03 11:58:53 -0500171test_tw_timer_LDFLAGS = -static
Damjan Marion7cd468a2016-12-19 23:05:39 +0100172test_vec_LDFLAGS = -static
173test_zvec_LDFLAGS = -static
174
175# noinst_PROGRAMS += test_vhash
176# test_vhash_SOURCES = vppinfra/test_vhash.c vppinfra/vhash.c
177# test_vhash_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
178# test_vhash_LDADD = libvppinfra.la
179# test_vhash_LDFLAGS = -static
180
181nobase_include_HEADERS = \
182 vppinfra/asm_mips.h \
183 vppinfra/asm_x86.h \
184 vppinfra/bihash_8_8.h \
Dave Barach310518e2017-10-30 09:42:54 -0400185 vppinfra/bihash_vec8_8.h \
Dave Barach68b0fb02017-02-28 15:15:56 -0500186 vppinfra/bihash_16_8.h \
Damjan Marion7cd468a2016-12-19 23:05:39 +0100187 vppinfra/bihash_24_8.h \
Dave Barach68b0fb02017-02-28 15:15:56 -0500188 vppinfra/bihash_48_8.h \
Damjan Marion7cd468a2016-12-19 23:05:39 +0100189 vppinfra/bihash_template.h \
190 vppinfra/bihash_template.c \
191 vppinfra/bitmap.h \
192 vppinfra/bitops.h \
193 vppinfra/byte_order.h \
194 vppinfra/cache.h \
195 vppinfra/clib.h \
Klement Sekera58eb8662017-06-09 06:06:49 +0200196 vppinfra/clib_error.h \
Damjan Marion7cd468a2016-12-19 23:05:39 +0100197 vppinfra/cpu.h \
Damjan Marion0f68c792017-04-26 13:05:05 +0200198 vppinfra/crc32.h \
Damjan Marion7cd468a2016-12-19 23:05:39 +0100199 vppinfra/dlist.h \
200 vppinfra/elf.h \
201 vppinfra/elf_clib.h \
202 vppinfra/elog.h \
203 vppinfra/fheap.h \
204 vppinfra/error.h \
205 vppinfra/error_bootstrap.h \
206 vppinfra/fifo.h \
Damjan Marion56dd5432017-09-08 19:52:02 +0200207 vppinfra/file.h \
Damjan Marion7cd468a2016-12-19 23:05:39 +0100208 vppinfra/format.h \
209 vppinfra/graph.h \
210 vppinfra/hash.h \
211 vppinfra/heap.h \
Damjan Marion01914ce2017-09-14 19:04:50 +0200212 vppinfra/linux/sysfs.h \
213 vppinfra/linux/syscall.h \
Damjan Marion1927da22017-03-27 17:08:20 +0200214 vppinfra/lock.h \
Damjan Marion7cd468a2016-12-19 23:05:39 +0100215 vppinfra/longjmp.h \
216 vppinfra/macros.h \
Dave Barache9d91702017-11-29 16:59:01 -0500217 vppinfra/maplog.h \
Damjan Marion7cd468a2016-12-19 23:05:39 +0100218 vppinfra/math.h \
219 vppinfra/md5.h \
220 vppinfra/mem.h \
221 vppinfra/memcpy_sse3.h \
222 vppinfra/memcpy_avx.h \
223 vppinfra/mhash.h \
224 vppinfra/mheap.h \
225 vppinfra/mheap_bootstrap.h \
226 vppinfra/os.h \
227 vppinfra/pipeline.h \
228 vppinfra/pool.h \
229 vppinfra/ptclosure.h \
230 vppinfra/random.h \
231 vppinfra/random_buffer.h \
232 vppinfra/random_isaac.h \
233 vppinfra/serialize.h \
234 vppinfra/slist.h \
235 vppinfra/smp.h \
236 vppinfra/socket.h \
237 vppinfra/sparse_vec.h \
238 vppinfra/string.h \
239 vppinfra/time.h \
240 vppinfra/timing_wheel.h \
241 vppinfra/timer.h \
Dave Barach8e8f98c2017-02-03 11:58:53 -0500242 vppinfra/tw_timer_2t_1w_2048sl.h \
243 vppinfra/tw_timer_16t_2w_512sl.h \
Dave Barach68b0fb02017-02-28 15:15:56 -0500244 vppinfra/tw_timer_16t_1w_2048sl.h \
Dave Barach4af9ba12017-06-07 15:18:23 -0400245 vppinfra/tw_timer_4t_3w_256sl.h \
246 vppinfra/tw_timer_1t_3w_1024sl_ov.h \
Dave Barach8e8f98c2017-02-03 11:58:53 -0500247 vppinfra/tw_timer_template.h \
Gabriel Ganne613c79f2017-02-15 11:37:53 +0100248 vppinfra/tw_timer_template.c \
Damjan Marion7cd468a2016-12-19 23:05:39 +0100249 vppinfra/types.h \
250 vppinfra/unix.h \
251 vppinfra/vec.h \
252 vppinfra/vec_bootstrap.h \
253 vppinfra/vector.h \
254 vppinfra/vector_altivec.h \
255 vppinfra/vector_funcs.h \
256 vppinfra/vector_iwmmxt.h \
257 vppinfra/vector_neon.h \
258 vppinfra/vector_sse2.h \
259 vppinfra/valgrind.h \
Damjan Marion7cd468a2016-12-19 23:05:39 +0100260 vppinfra/xxhash.h \
261 vppinfra/xy.h \
262 vppinfra/zvec.h
263
264CLIB_CORE = \
265 vppinfra/asm_x86.c \
266 vppinfra/backtrace.c \
267 vppinfra/bihash_8_8.h \
Dave Barach310518e2017-10-30 09:42:54 -0400268 vppinfra/bihash_vec8_8.h \
Damjan Marion7cd468a2016-12-19 23:05:39 +0100269 vppinfra/bihash_24_8.h \
270 vppinfra/bihash_template.h \
271 vppinfra/cpu.c \
272 vppinfra/elf.c \
273 vppinfra/elog.c \
274 vppinfra/error.c \
275 vppinfra/fifo.c \
276 vppinfra/fheap.c \
277 vppinfra/format.c \
Dave Barachb7f1faa2017-08-29 11:43:37 -0400278 vppinfra/pool.c \
Damjan Marion7cd468a2016-12-19 23:05:39 +0100279 vppinfra/graph.c \
280 vppinfra/hash.c \
281 vppinfra/heap.c \
282 vppinfra/longjmp.S \
283 vppinfra/macros.c \
284 vppinfra/mhash.c \
285 vppinfra/mheap.c \
286 vppinfra/md5.c \
287 vppinfra/mem_mheap.c \
288 vppinfra/ptclosure.c \
289 vppinfra/random.c \
290 vppinfra/random_buffer.c \
291 vppinfra/random_isaac.c \
292 vppinfra/serialize.c \
293 vppinfra/slist.c \
294 vppinfra/std-formats.c \
295 vppinfra/string.c \
296 vppinfra/time.c \
297 vppinfra/timing_wheel.c \
Dave Barach8e8f98c2017-02-03 11:58:53 -0500298 vppinfra/tw_timer_template.h \
299 vppinfra/tw_timer_2t_1w_2048sl.h \
300 vppinfra/tw_timer_2t_1w_2048sl.c \
301 vppinfra/tw_timer_16t_2w_512sl.h \
302 vppinfra/tw_timer_16t_2w_512sl.c \
Dave Barach68b0fb02017-02-28 15:15:56 -0500303 vppinfra/tw_timer_16t_1w_2048sl.h \
304 vppinfra/tw_timer_16t_1w_2048sl.c \
Dave Barach4af9ba12017-06-07 15:18:23 -0400305 vppinfra/tw_timer_4t_3w_256sl.h \
306 vppinfra/tw_timer_4t_3w_256sl.c \
307 vppinfra/tw_timer_1t_3w_1024sl_ov.h \
308 vppinfra/tw_timer_1t_3w_1024sl_ov.c \
Damjan Marion7cd468a2016-12-19 23:05:39 +0100309 vppinfra/unformat.c \
310 vppinfra/vec.c \
311 vppinfra/vector.c \
312 vppinfra/zvec.c
313
314# Core plus Unix additions
315libvppinfra_la_SOURCES = \
316 $(CLIB_CORE) \
317 vppinfra/elf_clib.c \
Damjan Marion01914ce2017-09-14 19:04:50 +0200318 vppinfra/linux/mem.c \
319 vppinfra/linux/sysfs.c \
Dave Barache9d91702017-11-29 16:59:01 -0500320 vppinfra/maplog.c \
Damjan Marion7cd468a2016-12-19 23:05:39 +0100321 vppinfra/socket.c \
322 vppinfra/timer.c \
323 vppinfra/unix-formats.c \
324 vppinfra/unix-misc.c
325
326bin_PROGRAMS = elftool
327
328elftool_SOURCES = tools/elftool/elftool.c
329elftool_CPPFLAGS = $(AM_CPPFLAGS)
330elftool_LDADD = libvppinfra.la -lpthread -lrt -lm
331
332# vi:syntax=automake