blob: 96766e8a757bbb396b6363f057300475a8e3a399 [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
Klement Sekera470a0112017-03-08 05:21:24 +010016TESTS = test_cuckoo_template \
17 test_bihash_template \
18 test_cuckoo_bihash
Damjan Marion7cd468a2016-12-19 23:05:39 +010019
20if ENABLE_TESTS
21TESTS += test_bihash_template \
22 test_dlist \
Damjan Marion7cd468a2016-12-19 23:05:39 +010023 test_elf \
Dave Barachb7f1faa2017-08-29 11:43:37 -040024 test_elog \
Damjan Marion7cd468a2016-12-19 23:05:39 +010025 test_fifo \
26 test_format \
Dave Barachb7f1faa2017-08-29 11:43:37 -040027 test_fpool \
Damjan Marion7cd468a2016-12-19 23:05:39 +010028 test_hash \
29 test_heap \
30 test_longjmp \
31 test_macros \
32 test_md5 \
33 test_mheap \
34 test_pool_iterate \
35 test_ptclosure \
36 test_random \
37 test_random_isaac \
38 test_serialize \
39 test_slist \
40 test_socket \
41 test_time \
42 test_timing_wheel \
Dave Barach8e8f98c2017-02-03 11:58:53 -050043 test_tw_timer \
Damjan Marion7cd468a2016-12-19 23:05:39 +010044 test_vec \
Neale Ranns32e1c012016-11-22 17:07:28 +000045 test_zvec
Damjan Marion7cd468a2016-12-19 23:05:39 +010046endif
47
48noinst_PROGRAMS = $(TESTS)
49check_PROGRAMS = $(TESTS)
50
51test_bihash_template_SOURCES = vppinfra/test_bihash_template.c
Klement Sekera470a0112017-03-08 05:21:24 +010052test_cuckoo_template_SOURCES = vppinfra/test_cuckoo_template.c
53test_cuckoo_bihash_SOURCES = vppinfra/test_cuckoo_bihash.c
Damjan Marion7cd468a2016-12-19 23:05:39 +010054test_dlist_SOURCES = vppinfra/test_dlist.c
Damjan Marion7cd468a2016-12-19 23:05:39 +010055test_elf_SOURCES = vppinfra/test_elf.c
Dave Barachb7f1faa2017-08-29 11:43:37 -040056test_elog_SOURCES = vppinfra/test_elog.c
Damjan Marion7cd468a2016-12-19 23:05:39 +010057test_fifo_SOURCES = vppinfra/test_fifo.c
58test_format_SOURCES = vppinfra/test_format.c
Dave Barachb7f1faa2017-08-29 11:43:37 -040059test_fpool_SOURCES = vppinfra/test_fpool.c
Damjan Marion7cd468a2016-12-19 23:05:39 +010060test_hash_SOURCES = vppinfra/test_hash.c
61test_heap_SOURCES = vppinfra/test_heap.c
62test_longjmp_SOURCES = vppinfra/test_longjmp.c
63test_macros_SOURCES = vppinfra/test_macros.c
64test_md5_SOURCES = vppinfra/test_md5.c
65test_mheap_SOURCES = vppinfra/test_mheap.c
66test_pool_iterate_SOURCES = vppinfra/test_pool_iterate.c
67test_ptclosure_SOURCES = vppinfra/test_ptclosure.c
Damjan Marion7cd468a2016-12-19 23:05:39 +010068test_random_isaac_SOURCES = vppinfra/test_random_isaac.c
Dave Barachb7f1faa2017-08-29 11:43:37 -040069test_random_SOURCES = vppinfra/test_random.c
Damjan Marion7cd468a2016-12-19 23:05:39 +010070test_serialize_SOURCES = vppinfra/test_serialize.c
71test_slist_SOURCES = vppinfra/test_slist.c
72test_socket_SOURCES = vppinfra/test_socket.c
73test_time_SOURCES = vppinfra/test_time.c
74test_timing_wheel_SOURCES = vppinfra/test_timing_wheel.c
Dave Barach8e8f98c2017-02-03 11:58:53 -050075test_tw_timer_SOURCES = vppinfra/test_tw_timer.c
Damjan Marion7cd468a2016-12-19 23:05:39 +010076test_vec_SOURCES = vppinfra/test_vec.c
77test_zvec_SOURCES = vppinfra/test_zvec.c
78
79# All unit tests use ASSERT for failure
80# So we'll need -DDEBUG to enable ASSERTs
81test_bihash_template_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
Klement Sekera470a0112017-03-08 05:21:24 +010082test_cuckoo_template_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
83test_cuckoo_bihash_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
Damjan Marion7cd468a2016-12-19 23:05:39 +010084test_dlist_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
Damjan Marion7cd468a2016-12-19 23:05:39 +010085test_elf_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
Dave Barachb7f1faa2017-08-29 11:43:37 -040086test_elog_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
Damjan Marion7cd468a2016-12-19 23:05:39 +010087test_fifo_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
88test_format_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
Dave Barachb7f1faa2017-08-29 11:43:37 -040089test_fpool_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
Damjan Marion7cd468a2016-12-19 23:05:39 +010090test_hash_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
91test_heap_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
92test_longjmp_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
93test_macros_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
94test_md5_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
95test_mheap_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
96test_pool_iterate_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
97test_ptclosure_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
98test_random_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
99test_random_isaac_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
Damjan Marion7cd468a2016-12-19 23:05:39 +0100100test_serialize_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
101test_slist_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
Dave Barachb7f1faa2017-08-29 11:43:37 -0400102test_socket_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
Damjan Marion7cd468a2016-12-19 23:05:39 +0100103test_time_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
104test_timing_wheel_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
Dave Barach8e8f98c2017-02-03 11:58:53 -0500105test_tw_timer_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
Damjan Marion7cd468a2016-12-19 23:05:39 +0100106test_vec_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
107test_zvec_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
108
109test_bihash_template_LDADD = libvppinfra.la
Klement Sekera470a0112017-03-08 05:21:24 +0100110test_cuckoo_template_LDADD = libvppinfra.la
111test_cuckoo_bihash_LDADD = libvppinfra.la
Damjan Marion7cd468a2016-12-19 23:05:39 +0100112test_dlist_LDADD = libvppinfra.la
Damjan Marion7cd468a2016-12-19 23:05:39 +0100113test_elf_LDADD = libvppinfra.la
Dave Barachb7f1faa2017-08-29 11:43:37 -0400114test_elog_LDADD = libvppinfra.la
Damjan Marion7cd468a2016-12-19 23:05:39 +0100115test_fifo_LDADD = libvppinfra.la
116test_format_LDADD = libvppinfra.la
Dave Barachb7f1faa2017-08-29 11:43:37 -0400117test_fpool_LDADD = libvppinfra.la
Damjan Marion7cd468a2016-12-19 23:05:39 +0100118test_hash_LDADD = libvppinfra.la
119test_heap_LDADD = libvppinfra.la
120test_longjmp_LDADD = libvppinfra.la
121test_macros_LDADD = libvppinfra.la
122test_md5_LDADD = libvppinfra.la
123test_mheap_LDADD = libvppinfra.la
124test_pool_iterate_LDADD = libvppinfra.la
125test_ptclosure_LDADD = libvppinfra.la
Damjan Marion7cd468a2016-12-19 23:05:39 +0100126test_random_isaac_LDADD = libvppinfra.la
Dave Barachb7f1faa2017-08-29 11:43:37 -0400127test_random_LDADD = libvppinfra.la
Damjan Marion7cd468a2016-12-19 23:05:39 +0100128test_serialize_LDADD = libvppinfra.la
129test_slist_LDADD = libvppinfra.la
130test_socket_LDADD = libvppinfra.la
131test_time_LDADD = libvppinfra.la -lm
132test_timing_wheel_LDADD = libvppinfra.la -lm
Dave Barach8e8f98c2017-02-03 11:58:53 -0500133test_tw_timer_LDADD = libvppinfra.la
Damjan Marion7cd468a2016-12-19 23:05:39 +0100134test_vec_LDADD = libvppinfra.la
135test_zvec_LDADD = libvppinfra.la
136
137test_bihash_template_LDFLAGS = -static
Klement Sekera470a0112017-03-08 05:21:24 +0100138test_cuckoo_template_LDFLAGS = -static
139test_cuckoo_bihash_LDFLAGS = -static -lpthread
Damjan Marion7cd468a2016-12-19 23:05:39 +0100140test_dlist_LDFLAGS = -static
Damjan Marion7cd468a2016-12-19 23:05:39 +0100141test_elf_LDFLAGS = -static
Dave Barachb7f1faa2017-08-29 11:43:37 -0400142test_elog_LDFLAGS = -static
Damjan Marion7cd468a2016-12-19 23:05:39 +0100143test_fifo_LDFLAGS = -static
144test_format_LDFLAGS = -static
Dave Barachb7f1faa2017-08-29 11:43:37 -0400145test_fpool_LDFLAGS = -static
Damjan Marion7cd468a2016-12-19 23:05:39 +0100146test_hash_LDFLAGS = -static
147test_heap_LDFLAGS = -static
148test_longjmp_LDFLAGS = -static
149test_macros_LDFLAGS = -static
150test_md5_LDFLAGS = -static
151test_mheap_LDFLAGS = -static
152test_pool_iterate_LDFLAGS = -static
153test_ptclosure_LDFLAGS = -static
Damjan Marion7cd468a2016-12-19 23:05:39 +0100154test_random_isaac_LDFLAGS = -static
Dave Barachb7f1faa2017-08-29 11:43:37 -0400155test_random_LDFLAGS = -static
Damjan Marion7cd468a2016-12-19 23:05:39 +0100156test_serialize_LDFLAGS = -static
157test_slist_LDFLAGS = -static
158test_socket_LDFLAGS = -static
159test_time_LDFLAGS = -static
160test_timing_wheel_LDFLAGS = -static
Dave Barach8e8f98c2017-02-03 11:58:53 -0500161test_tw_timer_LDFLAGS = -static
Damjan Marion7cd468a2016-12-19 23:05:39 +0100162test_vec_LDFLAGS = -static
163test_zvec_LDFLAGS = -static
164
165# noinst_PROGRAMS += test_vhash
166# test_vhash_SOURCES = vppinfra/test_vhash.c vppinfra/vhash.c
167# test_vhash_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
168# test_vhash_LDADD = libvppinfra.la
169# test_vhash_LDFLAGS = -static
170
171nobase_include_HEADERS = \
172 vppinfra/asm_mips.h \
173 vppinfra/asm_x86.h \
174 vppinfra/bihash_8_8.h \
Dave Barach68b0fb02017-02-28 15:15:56 -0500175 vppinfra/bihash_16_8.h \
Damjan Marion7cd468a2016-12-19 23:05:39 +0100176 vppinfra/bihash_24_8.h \
Dave Barach68b0fb02017-02-28 15:15:56 -0500177 vppinfra/bihash_48_8.h \
Damjan Marion7cd468a2016-12-19 23:05:39 +0100178 vppinfra/bihash_template.h \
179 vppinfra/bihash_template.c \
180 vppinfra/bitmap.h \
181 vppinfra/bitops.h \
182 vppinfra/byte_order.h \
183 vppinfra/cache.h \
184 vppinfra/clib.h \
Klement Sekera58eb8662017-06-09 06:06:49 +0200185 vppinfra/clib_error.h \
Damjan Marion7cd468a2016-12-19 23:05:39 +0100186 vppinfra/cpu.h \
Damjan Marion0f68c792017-04-26 13:05:05 +0200187 vppinfra/crc32.h \
Damjan Marion7cd468a2016-12-19 23:05:39 +0100188 vppinfra/dlist.h \
189 vppinfra/elf.h \
190 vppinfra/elf_clib.h \
191 vppinfra/elog.h \
192 vppinfra/fheap.h \
193 vppinfra/error.h \
194 vppinfra/error_bootstrap.h \
195 vppinfra/fifo.h \
Damjan Marion56dd5432017-09-08 19:52:02 +0200196 vppinfra/file.h \
Damjan Marion7cd468a2016-12-19 23:05:39 +0100197 vppinfra/format.h \
198 vppinfra/graph.h \
199 vppinfra/hash.h \
200 vppinfra/heap.h \
Damjan Marion01914ce2017-09-14 19:04:50 +0200201 vppinfra/linux/sysfs.h \
202 vppinfra/linux/syscall.h \
Damjan Marion1927da22017-03-27 17:08:20 +0200203 vppinfra/lock.h \
Damjan Marion7cd468a2016-12-19 23:05:39 +0100204 vppinfra/longjmp.h \
205 vppinfra/macros.h \
206 vppinfra/math.h \
207 vppinfra/md5.h \
208 vppinfra/mem.h \
209 vppinfra/memcpy_sse3.h \
210 vppinfra/memcpy_avx.h \
211 vppinfra/mhash.h \
212 vppinfra/mheap.h \
213 vppinfra/mheap_bootstrap.h \
214 vppinfra/os.h \
215 vppinfra/pipeline.h \
216 vppinfra/pool.h \
217 vppinfra/ptclosure.h \
218 vppinfra/random.h \
219 vppinfra/random_buffer.h \
220 vppinfra/random_isaac.h \
221 vppinfra/serialize.h \
222 vppinfra/slist.h \
223 vppinfra/smp.h \
224 vppinfra/socket.h \
225 vppinfra/sparse_vec.h \
226 vppinfra/string.h \
227 vppinfra/time.h \
228 vppinfra/timing_wheel.h \
229 vppinfra/timer.h \
Dave Barach8e8f98c2017-02-03 11:58:53 -0500230 vppinfra/tw_timer_2t_1w_2048sl.h \
231 vppinfra/tw_timer_16t_2w_512sl.h \
Dave Barach68b0fb02017-02-28 15:15:56 -0500232 vppinfra/tw_timer_16t_1w_2048sl.h \
Dave Barach4af9ba12017-06-07 15:18:23 -0400233 vppinfra/tw_timer_4t_3w_256sl.h \
234 vppinfra/tw_timer_1t_3w_1024sl_ov.h \
Dave Barach8e8f98c2017-02-03 11:58:53 -0500235 vppinfra/tw_timer_template.h \
Gabriel Ganne613c79f2017-02-15 11:37:53 +0100236 vppinfra/tw_timer_template.c \
Damjan Marion7cd468a2016-12-19 23:05:39 +0100237 vppinfra/types.h \
238 vppinfra/unix.h \
239 vppinfra/vec.h \
240 vppinfra/vec_bootstrap.h \
241 vppinfra/vector.h \
242 vppinfra/vector_altivec.h \
243 vppinfra/vector_funcs.h \
244 vppinfra/vector_iwmmxt.h \
245 vppinfra/vector_neon.h \
246 vppinfra/vector_sse2.h \
247 vppinfra/valgrind.h \
Damjan Marion7cd468a2016-12-19 23:05:39 +0100248 vppinfra/xxhash.h \
249 vppinfra/xy.h \
250 vppinfra/zvec.h
251
252CLIB_CORE = \
253 vppinfra/asm_x86.c \
254 vppinfra/backtrace.c \
255 vppinfra/bihash_8_8.h \
256 vppinfra/bihash_24_8.h \
257 vppinfra/bihash_template.h \
258 vppinfra/cpu.c \
259 vppinfra/elf.c \
260 vppinfra/elog.c \
261 vppinfra/error.c \
262 vppinfra/fifo.c \
263 vppinfra/fheap.c \
264 vppinfra/format.c \
Dave Barachb7f1faa2017-08-29 11:43:37 -0400265 vppinfra/pool.c \
Damjan Marion7cd468a2016-12-19 23:05:39 +0100266 vppinfra/graph.c \
267 vppinfra/hash.c \
268 vppinfra/heap.c \
269 vppinfra/longjmp.S \
270 vppinfra/macros.c \
271 vppinfra/mhash.c \
272 vppinfra/mheap.c \
273 vppinfra/md5.c \
274 vppinfra/mem_mheap.c \
275 vppinfra/ptclosure.c \
276 vppinfra/random.c \
277 vppinfra/random_buffer.c \
278 vppinfra/random_isaac.c \
279 vppinfra/serialize.c \
280 vppinfra/slist.c \
281 vppinfra/std-formats.c \
282 vppinfra/string.c \
283 vppinfra/time.c \
284 vppinfra/timing_wheel.c \
Dave Barach8e8f98c2017-02-03 11:58:53 -0500285 vppinfra/tw_timer_template.h \
286 vppinfra/tw_timer_2t_1w_2048sl.h \
287 vppinfra/tw_timer_2t_1w_2048sl.c \
288 vppinfra/tw_timer_16t_2w_512sl.h \
289 vppinfra/tw_timer_16t_2w_512sl.c \
Dave Barach68b0fb02017-02-28 15:15:56 -0500290 vppinfra/tw_timer_16t_1w_2048sl.h \
291 vppinfra/tw_timer_16t_1w_2048sl.c \
Dave Barach4af9ba12017-06-07 15:18:23 -0400292 vppinfra/tw_timer_4t_3w_256sl.h \
293 vppinfra/tw_timer_4t_3w_256sl.c \
294 vppinfra/tw_timer_1t_3w_1024sl_ov.h \
295 vppinfra/tw_timer_1t_3w_1024sl_ov.c \
Damjan Marion7cd468a2016-12-19 23:05:39 +0100296 vppinfra/unformat.c \
297 vppinfra/vec.c \
298 vppinfra/vector.c \
299 vppinfra/zvec.c
300
301# Core plus Unix additions
302libvppinfra_la_SOURCES = \
303 $(CLIB_CORE) \
304 vppinfra/elf_clib.c \
Damjan Marion01914ce2017-09-14 19:04:50 +0200305 vppinfra/linux/mem.c \
306 vppinfra/linux/sysfs.c \
Damjan Marion7cd468a2016-12-19 23:05:39 +0100307 vppinfra/socket.c \
308 vppinfra/timer.c \
309 vppinfra/unix-formats.c \
310 vppinfra/unix-misc.c
311
312bin_PROGRAMS = elftool
313
314elftool_SOURCES = tools/elftool/elftool.c
315elftool_CPPFLAGS = $(AM_CPPFLAGS)
316elftool_LDADD = libvppinfra.la -lpthread -lrt -lm
317
318# vi:syntax=automake