blob: 8f01114c12a585172f101b7485f5a633bdfeadb5 [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
16TESTS =
17
18if ENABLE_TESTS
19TESTS += test_bihash_template \
20 test_dlist \
Damjan Marion7cd468a2016-12-19 23:05:39 +010021 test_elf \
Dave Barachb7f1faa2017-08-29 11:43:37 -040022 test_elog \
Damjan Marion7cd468a2016-12-19 23:05:39 +010023 test_fifo \
24 test_format \
Dave Barachb7f1faa2017-08-29 11:43:37 -040025 test_fpool \
Damjan Marion7cd468a2016-12-19 23:05:39 +010026 test_hash \
27 test_heap \
28 test_longjmp \
29 test_macros \
30 test_md5 \
31 test_mheap \
32 test_pool_iterate \
33 test_ptclosure \
34 test_random \
35 test_random_isaac \
36 test_serialize \
37 test_slist \
38 test_socket \
39 test_time \
40 test_timing_wheel \
Dave Barach8e8f98c2017-02-03 11:58:53 -050041 test_tw_timer \
Damjan Marion7cd468a2016-12-19 23:05:39 +010042 test_vec \
Neale Ranns32e1c012016-11-22 17:07:28 +000043 test_zvec
Damjan Marion7cd468a2016-12-19 23:05:39 +010044endif
45
46noinst_PROGRAMS = $(TESTS)
47check_PROGRAMS = $(TESTS)
48
49test_bihash_template_SOURCES = vppinfra/test_bihash_template.c
50test_dlist_SOURCES = vppinfra/test_dlist.c
Damjan Marion7cd468a2016-12-19 23:05:39 +010051test_elf_SOURCES = vppinfra/test_elf.c
Dave Barachb7f1faa2017-08-29 11:43:37 -040052test_elog_SOURCES = vppinfra/test_elog.c
Damjan Marion7cd468a2016-12-19 23:05:39 +010053test_fifo_SOURCES = vppinfra/test_fifo.c
54test_format_SOURCES = vppinfra/test_format.c
Dave Barachb7f1faa2017-08-29 11:43:37 -040055test_fpool_SOURCES = vppinfra/test_fpool.c
Damjan Marion7cd468a2016-12-19 23:05:39 +010056test_hash_SOURCES = vppinfra/test_hash.c
57test_heap_SOURCES = vppinfra/test_heap.c
58test_longjmp_SOURCES = vppinfra/test_longjmp.c
59test_macros_SOURCES = vppinfra/test_macros.c
60test_md5_SOURCES = vppinfra/test_md5.c
61test_mheap_SOURCES = vppinfra/test_mheap.c
62test_pool_iterate_SOURCES = vppinfra/test_pool_iterate.c
63test_ptclosure_SOURCES = vppinfra/test_ptclosure.c
Damjan Marion7cd468a2016-12-19 23:05:39 +010064test_random_isaac_SOURCES = vppinfra/test_random_isaac.c
Dave Barachb7f1faa2017-08-29 11:43:37 -040065test_random_SOURCES = vppinfra/test_random.c
Damjan Marion7cd468a2016-12-19 23:05:39 +010066test_serialize_SOURCES = vppinfra/test_serialize.c
67test_slist_SOURCES = vppinfra/test_slist.c
68test_socket_SOURCES = vppinfra/test_socket.c
69test_time_SOURCES = vppinfra/test_time.c
70test_timing_wheel_SOURCES = vppinfra/test_timing_wheel.c
Dave Barach8e8f98c2017-02-03 11:58:53 -050071test_tw_timer_SOURCES = vppinfra/test_tw_timer.c
Damjan Marion7cd468a2016-12-19 23:05:39 +010072test_vec_SOURCES = vppinfra/test_vec.c
73test_zvec_SOURCES = vppinfra/test_zvec.c
74
75# All unit tests use ASSERT for failure
76# So we'll need -DDEBUG to enable ASSERTs
77test_bihash_template_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
78test_dlist_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
Damjan Marion7cd468a2016-12-19 23:05:39 +010079test_elf_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
Dave Barachb7f1faa2017-08-29 11:43:37 -040080test_elog_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
Damjan Marion7cd468a2016-12-19 23:05:39 +010081test_fifo_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
82test_format_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
Dave Barachb7f1faa2017-08-29 11:43:37 -040083test_fpool_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
Damjan Marion7cd468a2016-12-19 23:05:39 +010084test_hash_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
85test_heap_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
86test_longjmp_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
87test_macros_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
88test_md5_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
89test_mheap_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
90test_pool_iterate_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
91test_ptclosure_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
92test_random_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
93test_random_isaac_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
Damjan Marion7cd468a2016-12-19 23:05:39 +010094test_serialize_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
95test_slist_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
Dave Barachb7f1faa2017-08-29 11:43:37 -040096test_socket_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
Damjan Marion7cd468a2016-12-19 23:05:39 +010097test_time_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
98test_timing_wheel_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
Dave Barach8e8f98c2017-02-03 11:58:53 -050099test_tw_timer_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
Damjan Marion7cd468a2016-12-19 23:05:39 +0100100test_vec_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
101test_zvec_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
102
103test_bihash_template_LDADD = libvppinfra.la
104test_dlist_LDADD = libvppinfra.la
Damjan Marion7cd468a2016-12-19 23:05:39 +0100105test_elf_LDADD = libvppinfra.la
Dave Barachb7f1faa2017-08-29 11:43:37 -0400106test_elog_LDADD = libvppinfra.la
Damjan Marion7cd468a2016-12-19 23:05:39 +0100107test_fifo_LDADD = libvppinfra.la
108test_format_LDADD = libvppinfra.la
Dave Barachb7f1faa2017-08-29 11:43:37 -0400109test_fpool_LDADD = libvppinfra.la
Damjan Marion7cd468a2016-12-19 23:05:39 +0100110test_hash_LDADD = libvppinfra.la
111test_heap_LDADD = libvppinfra.la
112test_longjmp_LDADD = libvppinfra.la
113test_macros_LDADD = libvppinfra.la
114test_md5_LDADD = libvppinfra.la
115test_mheap_LDADD = libvppinfra.la
116test_pool_iterate_LDADD = libvppinfra.la
117test_ptclosure_LDADD = libvppinfra.la
Damjan Marion7cd468a2016-12-19 23:05:39 +0100118test_random_isaac_LDADD = libvppinfra.la
Dave Barachb7f1faa2017-08-29 11:43:37 -0400119test_random_LDADD = libvppinfra.la
Damjan Marion7cd468a2016-12-19 23:05:39 +0100120test_serialize_LDADD = libvppinfra.la
121test_slist_LDADD = libvppinfra.la
122test_socket_LDADD = libvppinfra.la
123test_time_LDADD = libvppinfra.la -lm
124test_timing_wheel_LDADD = libvppinfra.la -lm
Dave Barach8e8f98c2017-02-03 11:58:53 -0500125test_tw_timer_LDADD = libvppinfra.la
Damjan Marion7cd468a2016-12-19 23:05:39 +0100126test_vec_LDADD = libvppinfra.la
127test_zvec_LDADD = libvppinfra.la
128
129test_bihash_template_LDFLAGS = -static
130test_dlist_LDFLAGS = -static
Damjan Marion7cd468a2016-12-19 23:05:39 +0100131test_elf_LDFLAGS = -static
Dave Barachb7f1faa2017-08-29 11:43:37 -0400132test_elog_LDFLAGS = -static
Damjan Marion7cd468a2016-12-19 23:05:39 +0100133test_fifo_LDFLAGS = -static
134test_format_LDFLAGS = -static
Dave Barachb7f1faa2017-08-29 11:43:37 -0400135test_fpool_LDFLAGS = -static
Damjan Marion7cd468a2016-12-19 23:05:39 +0100136test_hash_LDFLAGS = -static
137test_heap_LDFLAGS = -static
138test_longjmp_LDFLAGS = -static
139test_macros_LDFLAGS = -static
140test_md5_LDFLAGS = -static
141test_mheap_LDFLAGS = -static
142test_pool_iterate_LDFLAGS = -static
143test_ptclosure_LDFLAGS = -static
Damjan Marion7cd468a2016-12-19 23:05:39 +0100144test_random_isaac_LDFLAGS = -static
Dave Barachb7f1faa2017-08-29 11:43:37 -0400145test_random_LDFLAGS = -static
Damjan Marion7cd468a2016-12-19 23:05:39 +0100146test_serialize_LDFLAGS = -static
147test_slist_LDFLAGS = -static
148test_socket_LDFLAGS = -static
149test_time_LDFLAGS = -static
150test_timing_wheel_LDFLAGS = -static
Dave Barach8e8f98c2017-02-03 11:58:53 -0500151test_tw_timer_LDFLAGS = -static
Damjan Marion7cd468a2016-12-19 23:05:39 +0100152test_vec_LDFLAGS = -static
153test_zvec_LDFLAGS = -static
154
155# noinst_PROGRAMS += test_vhash
156# test_vhash_SOURCES = vppinfra/test_vhash.c vppinfra/vhash.c
157# test_vhash_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
158# test_vhash_LDADD = libvppinfra.la
159# test_vhash_LDFLAGS = -static
160
161nobase_include_HEADERS = \
162 vppinfra/asm_mips.h \
163 vppinfra/asm_x86.h \
164 vppinfra/bihash_8_8.h \
Dave Barach68b0fb02017-02-28 15:15:56 -0500165 vppinfra/bihash_16_8.h \
Damjan Marion7cd468a2016-12-19 23:05:39 +0100166 vppinfra/bihash_24_8.h \
Dave Barach68b0fb02017-02-28 15:15:56 -0500167 vppinfra/bihash_48_8.h \
Damjan Marion7cd468a2016-12-19 23:05:39 +0100168 vppinfra/bihash_template.h \
169 vppinfra/bihash_template.c \
170 vppinfra/bitmap.h \
171 vppinfra/bitops.h \
172 vppinfra/byte_order.h \
173 vppinfra/cache.h \
174 vppinfra/clib.h \
Klement Sekera58eb8662017-06-09 06:06:49 +0200175 vppinfra/clib_error.h \
Damjan Marion7cd468a2016-12-19 23:05:39 +0100176 vppinfra/cpu.h \
Damjan Marion0f68c792017-04-26 13:05:05 +0200177 vppinfra/crc32.h \
Damjan Marion7cd468a2016-12-19 23:05:39 +0100178 vppinfra/dlist.h \
179 vppinfra/elf.h \
180 vppinfra/elf_clib.h \
181 vppinfra/elog.h \
182 vppinfra/fheap.h \
183 vppinfra/error.h \
184 vppinfra/error_bootstrap.h \
185 vppinfra/fifo.h \
186 vppinfra/format.h \
187 vppinfra/graph.h \
188 vppinfra/hash.h \
189 vppinfra/heap.h \
Damjan Marion1927da22017-03-27 17:08:20 +0200190 vppinfra/lock.h \
Damjan Marion7cd468a2016-12-19 23:05:39 +0100191 vppinfra/longjmp.h \
192 vppinfra/macros.h \
193 vppinfra/math.h \
194 vppinfra/md5.h \
195 vppinfra/mem.h \
196 vppinfra/memcpy_sse3.h \
197 vppinfra/memcpy_avx.h \
198 vppinfra/mhash.h \
199 vppinfra/mheap.h \
200 vppinfra/mheap_bootstrap.h \
201 vppinfra/os.h \
202 vppinfra/pipeline.h \
203 vppinfra/pool.h \
204 vppinfra/ptclosure.h \
205 vppinfra/random.h \
206 vppinfra/random_buffer.h \
207 vppinfra/random_isaac.h \
208 vppinfra/serialize.h \
209 vppinfra/slist.h \
210 vppinfra/smp.h \
211 vppinfra/socket.h \
212 vppinfra/sparse_vec.h \
213 vppinfra/string.h \
214 vppinfra/time.h \
215 vppinfra/timing_wheel.h \
216 vppinfra/timer.h \
Dave Barach8e8f98c2017-02-03 11:58:53 -0500217 vppinfra/tw_timer_2t_1w_2048sl.h \
218 vppinfra/tw_timer_16t_2w_512sl.h \
Dave Barach68b0fb02017-02-28 15:15:56 -0500219 vppinfra/tw_timer_16t_1w_2048sl.h \
Dave Barach4af9ba12017-06-07 15:18:23 -0400220 vppinfra/tw_timer_4t_3w_256sl.h \
221 vppinfra/tw_timer_1t_3w_1024sl_ov.h \
Dave Barach8e8f98c2017-02-03 11:58:53 -0500222 vppinfra/tw_timer_template.h \
Gabriel Ganne613c79f2017-02-15 11:37:53 +0100223 vppinfra/tw_timer_template.c \
Damjan Marion7cd468a2016-12-19 23:05:39 +0100224 vppinfra/types.h \
225 vppinfra/unix.h \
226 vppinfra/vec.h \
227 vppinfra/vec_bootstrap.h \
228 vppinfra/vector.h \
229 vppinfra/vector_altivec.h \
230 vppinfra/vector_funcs.h \
231 vppinfra/vector_iwmmxt.h \
232 vppinfra/vector_neon.h \
233 vppinfra/vector_sse2.h \
234 vppinfra/valgrind.h \
235 vppinfra/vm_unix.h \
236 vppinfra/xxhash.h \
237 vppinfra/xy.h \
238 vppinfra/zvec.h
239
240CLIB_CORE = \
241 vppinfra/asm_x86.c \
242 vppinfra/backtrace.c \
243 vppinfra/bihash_8_8.h \
244 vppinfra/bihash_24_8.h \
245 vppinfra/bihash_template.h \
246 vppinfra/cpu.c \
247 vppinfra/elf.c \
248 vppinfra/elog.c \
249 vppinfra/error.c \
250 vppinfra/fifo.c \
251 vppinfra/fheap.c \
252 vppinfra/format.c \
Dave Barachb7f1faa2017-08-29 11:43:37 -0400253 vppinfra/pool.c \
Damjan Marion7cd468a2016-12-19 23:05:39 +0100254 vppinfra/graph.c \
255 vppinfra/hash.c \
256 vppinfra/heap.c \
257 vppinfra/longjmp.S \
258 vppinfra/macros.c \
259 vppinfra/mhash.c \
260 vppinfra/mheap.c \
261 vppinfra/md5.c \
262 vppinfra/mem_mheap.c \
263 vppinfra/ptclosure.c \
264 vppinfra/random.c \
265 vppinfra/random_buffer.c \
266 vppinfra/random_isaac.c \
267 vppinfra/serialize.c \
268 vppinfra/slist.c \
269 vppinfra/std-formats.c \
270 vppinfra/string.c \
271 vppinfra/time.c \
272 vppinfra/timing_wheel.c \
Dave Barach8e8f98c2017-02-03 11:58:53 -0500273 vppinfra/tw_timer_template.h \
274 vppinfra/tw_timer_2t_1w_2048sl.h \
275 vppinfra/tw_timer_2t_1w_2048sl.c \
276 vppinfra/tw_timer_16t_2w_512sl.h \
277 vppinfra/tw_timer_16t_2w_512sl.c \
Dave Barach68b0fb02017-02-28 15:15:56 -0500278 vppinfra/tw_timer_16t_1w_2048sl.h \
279 vppinfra/tw_timer_16t_1w_2048sl.c \
Dave Barach4af9ba12017-06-07 15:18:23 -0400280 vppinfra/tw_timer_4t_3w_256sl.h \
281 vppinfra/tw_timer_4t_3w_256sl.c \
282 vppinfra/tw_timer_1t_3w_1024sl_ov.h \
283 vppinfra/tw_timer_1t_3w_1024sl_ov.c \
Damjan Marion7cd468a2016-12-19 23:05:39 +0100284 vppinfra/unformat.c \
285 vppinfra/vec.c \
286 vppinfra/vector.c \
287 vppinfra/zvec.c
288
289# Core plus Unix additions
290libvppinfra_la_SOURCES = \
291 $(CLIB_CORE) \
292 vppinfra/elf_clib.c \
293 vppinfra/socket.c \
294 vppinfra/timer.c \
295 vppinfra/unix-formats.c \
296 vppinfra/unix-misc.c
297
298bin_PROGRAMS = elftool
299
300elftool_SOURCES = tools/elftool/elftool.c
301elftool_CPPFLAGS = $(AM_CPPFLAGS)
302elftool_LDADD = libvppinfra.la -lpthread -lrt -lm
303
304# vi:syntax=automake