blob: d0a023e25d33c3285e1689322a709195853721e9 [file] [log] [blame]
Ed Warnickecb9cada2015-12-08 15:45:58 -07001# 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.
13AUTOMAKE_OPTIONS = foreign subdir-objects
14
Dave Barachb3d93da2016-08-03 14:34:38 -040015AM_CPPFLAGS = -Wall -Werror
Ed Warnickecb9cada2015-12-08 15:45:58 -070016
17if WITH_UNIX
18 lib_LTLIBRARIES = libvppinfra.la
19endif
20
21lib_LIBRARIES =
22
Dave Barachb3d93da2016-08-03 14:34:38 -040023TESTS =
Damjan Marionc47e9792016-04-11 13:34:36 +020024
25if ENABLE_TESTS
26TESTS += test_bihash_template \
Dave Barach034fccc2016-06-24 18:53:21 -040027 test_dlist \
Ed Warnickecb9cada2015-12-08 15:45:58 -070028 test_elog \
29 test_elf \
30 test_fifo \
31 test_format \
32 test_hash \
33 test_heap \
34 test_longjmp \
35 test_macros \
36 test_md5 \
37 test_mheap \
Ed Warnickecb9cada2015-12-08 15:45:58 -070038 test_pool_iterate \
Dave Barachd6534602016-06-14 18:38:02 -040039 test_ptclosure \
Ed Warnickecb9cada2015-12-08 15:45:58 -070040 test_random \
41 test_random_isaac \
42 test_serialize \
43 test_slist \
44 test_socket \
45 test_time \
46 test_timing_wheel \
47 test_vec \
48 test_zvec
Damjan Marionc47e9792016-04-11 13:34:36 +020049endif
Ed Warnickecb9cada2015-12-08 15:45:58 -070050
51noinst_PROGRAMS = $(TESTS)
52check_PROGRAMS = $(TESTS)
53
54test_bihash_template_SOURCES = vppinfra/test_bihash_template.c
Dave Barach034fccc2016-06-24 18:53:21 -040055test_dlist_SOURCES = vppinfra/test_dlist.c
Ed Warnickecb9cada2015-12-08 15:45:58 -070056test_elog_SOURCES = vppinfra/test_elog.c
57test_elf_SOURCES = vppinfra/test_elf.c
58test_fifo_SOURCES = vppinfra/test_fifo.c
59test_format_SOURCES = vppinfra/test_format.c
60test_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
Ed Warnickecb9cada2015-12-08 15:45:58 -070066test_pool_iterate_SOURCES = vppinfra/test_pool_iterate.c
Dave Barachd6534602016-06-14 18:38:02 -040067test_ptclosure_SOURCES = vppinfra/test_ptclosure.c
Ed Warnickecb9cada2015-12-08 15:45:58 -070068test_random_SOURCES = vppinfra/test_random.c
69test_random_isaac_SOURCES = vppinfra/test_random_isaac.c
70test_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
75test_vec_SOURCES = vppinfra/test_vec.c
76test_zvec_SOURCES = vppinfra/test_zvec.c
77
78# All unit tests use ASSERT for failure
79# So we'll need -DDEBUG to enable ASSERTs
80test_bihash_template_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
Dave Barach034fccc2016-06-24 18:53:21 -040081test_dlist_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
Ed Warnickecb9cada2015-12-08 15:45:58 -070082test_elog_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
83test_elf_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
84test_fifo_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
85test_format_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
86test_hash_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
87test_heap_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
88test_longjmp_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
89test_macros_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
90test_md5_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
91test_mheap_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
Ed Warnickecb9cada2015-12-08 15:45:58 -070092test_pool_iterate_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
Dave Barachd6534602016-06-14 18:38:02 -040093test_ptclosure_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
Ed Warnickecb9cada2015-12-08 15:45:58 -070094test_random_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
95test_random_isaac_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
96test_socket_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
97test_serialize_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
98test_slist_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
99test_time_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
100test_timing_wheel_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
101test_vec_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
102test_zvec_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
103
104test_bihash_template_LDADD = libvppinfra.la
Dave Barach034fccc2016-06-24 18:53:21 -0400105test_dlist_LDADD = libvppinfra.la
Ed Warnickecb9cada2015-12-08 15:45:58 -0700106test_elog_LDADD = libvppinfra.la
107test_elf_LDADD = libvppinfra.la
108test_fifo_LDADD = libvppinfra.la
109test_format_LDADD = libvppinfra.la
110test_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
Ed Warnickecb9cada2015-12-08 15:45:58 -0700116test_pool_iterate_LDADD = libvppinfra.la
Dave Barachd6534602016-06-14 18:38:02 -0400117test_ptclosure_LDADD = libvppinfra.la
Ed Warnickecb9cada2015-12-08 15:45:58 -0700118test_random_LDADD = libvppinfra.la
119test_random_isaac_LDADD = libvppinfra.la
120test_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
125test_vec_LDADD = libvppinfra.la
126test_zvec_LDADD = libvppinfra.la
127
128test_bihash_template_LDFLAGS = -static
Dave Barach034fccc2016-06-24 18:53:21 -0400129test_dlist_LDFLAGS = -static
Ed Warnickecb9cada2015-12-08 15:45:58 -0700130test_elog_LDFLAGS = -static
131test_elf_LDFLAGS = -static
132test_fifo_LDFLAGS = -static
133test_format_LDFLAGS = -static
134test_hash_LDFLAGS = -static
135test_heap_LDFLAGS = -static
136test_longjmp_LDFLAGS = -static
137test_macros_LDFLAGS = -static
138test_md5_LDFLAGS = -static
139test_mheap_LDFLAGS = -static
Ed Warnickecb9cada2015-12-08 15:45:58 -0700140test_pool_iterate_LDFLAGS = -static
Dave Barachd6534602016-06-14 18:38:02 -0400141test_ptclosure_LDFLAGS = -static
Ed Warnickecb9cada2015-12-08 15:45:58 -0700142test_random_LDFLAGS = -static
143test_random_isaac_LDFLAGS = -static
144test_serialize_LDFLAGS = -static
145test_slist_LDFLAGS = -static
146test_socket_LDFLAGS = -static
147test_time_LDFLAGS = -static
148test_timing_wheel_LDFLAGS = -static
149test_vec_LDFLAGS = -static
150test_zvec_LDFLAGS = -static
151
152# noinst_PROGRAMS += test_vhash
153# test_vhash_SOURCES = vppinfra/test_vhash.c vppinfra/vhash.c
154# test_vhash_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
155# test_vhash_LDADD = libvppinfra.la
156# test_vhash_LDFLAGS = -static
157
158nobase_include_HEADERS = \
159 vppinfra/asm_mips.h \
160 vppinfra/asm_x86.h \
161 vppinfra/bihash_8_8.h \
162 vppinfra/bihash_24_8.h \
163 vppinfra/bihash_template.h \
164 vppinfra/bihash_template.c \
165 vppinfra/bitmap.h \
166 vppinfra/bitops.h \
167 vppinfra/byte_order.h \
168 vppinfra/cache.h \
169 vppinfra/clib.h \
Damjan Marion522e4862016-03-04 12:44:14 +0100170 vppinfra/cpu.h \
Dave Barach034fccc2016-06-24 18:53:21 -0400171 vppinfra/dlist.h \
Ed Warnickecb9cada2015-12-08 15:45:58 -0700172 vppinfra/elf.h \
173 vppinfra/elf_clib.h \
174 vppinfra/elog.h \
175 vppinfra/fheap.h \
176 vppinfra/error.h \
177 vppinfra/error_bootstrap.h \
178 vppinfra/fifo.h \
179 vppinfra/format.h \
180 vppinfra/graph.h \
181 vppinfra/hash.h \
182 vppinfra/heap.h \
183 vppinfra/longjmp.h \
184 vppinfra/macros.h \
185 vppinfra/math.h \
186 vppinfra/md5.h \
187 vppinfra/mem.h \
Damjan Marionf1213b82016-03-13 02:22:06 +0100188 vppinfra/memcpy_sse3.h \
189 vppinfra/memcpy_avx.h \
Ed Warnickecb9cada2015-12-08 15:45:58 -0700190 vppinfra/mhash.h \
191 vppinfra/mheap.h \
192 vppinfra/mheap_bootstrap.h \
193 vppinfra/os.h \
Ed Warnickecb9cada2015-12-08 15:45:58 -0700194 vppinfra/pipeline.h \
195 vppinfra/pool.h \
Dave Barachd6534602016-06-14 18:38:02 -0400196 vppinfra/ptclosure.h \
Ed Warnickecb9cada2015-12-08 15:45:58 -0700197 vppinfra/random.h \
198 vppinfra/random_buffer.h \
199 vppinfra/random_isaac.h \
200 vppinfra/serialize.h \
201 vppinfra/slist.h \
202 vppinfra/smp.h \
Ed Warnickecb9cada2015-12-08 15:45:58 -0700203 vppinfra/socket.h \
204 vppinfra/sparse_vec.h \
205 vppinfra/string.h \
206 vppinfra/time.h \
207 vppinfra/timing_wheel.h \
208 vppinfra/timer.h \
209 vppinfra/types.h \
210 vppinfra/unix.h \
211 vppinfra/vec.h \
212 vppinfra/vec_bootstrap.h \
213 vppinfra/vector.h \
214 vppinfra/vector_altivec.h \
215 vppinfra/vector_funcs.h \
216 vppinfra/vector_iwmmxt.h \
217 vppinfra/vector_sse2.h \
218 vppinfra/valgrind.h \
219 vppinfra/vm_unix.h \
220 vppinfra/xxhash.h \
221 vppinfra/xy.h \
222 vppinfra/zvec.h
223
224CLIB_CORE = \
225 vppinfra/asm_x86.c \
226 vppinfra/backtrace.c \
Damjan Marion383740d2016-10-11 09:53:12 +0200227 vppinfra/bihash_8_8.h \
228 vppinfra/bihash_24_8.h \
229 vppinfra/bihash_template.h \
Damjan Marion522e4862016-03-04 12:44:14 +0100230 vppinfra/cpu.c \
Ed Warnickecb9cada2015-12-08 15:45:58 -0700231 vppinfra/elf.c \
232 vppinfra/elog.c \
233 vppinfra/error.c \
234 vppinfra/fifo.c \
235 vppinfra/fheap.c \
236 vppinfra/format.c \
237 vppinfra/graph.c \
238 vppinfra/hash.c \
239 vppinfra/heap.c \
240 vppinfra/longjmp.S \
241 vppinfra/macros.c \
242 vppinfra/mhash.c \
243 vppinfra/mheap.c \
244 vppinfra/md5.c \
245 vppinfra/mem_mheap.c \
Dave Barachd6534602016-06-14 18:38:02 -0400246 vppinfra/ptclosure.c \
Ed Warnickecb9cada2015-12-08 15:45:58 -0700247 vppinfra/random.c \
248 vppinfra/random_buffer.c \
249 vppinfra/random_isaac.c \
250 vppinfra/serialize.c \
251 vppinfra/slist.c \
Ed Warnickecb9cada2015-12-08 15:45:58 -0700252 vppinfra/std-formats.c \
253 vppinfra/string.c \
254 vppinfra/time.c \
255 vppinfra/timing_wheel.c \
256 vppinfra/unformat.c \
257 vppinfra/vec.c \
258 vppinfra/vector.c \
259 vppinfra/zvec.c
260
261# Core plus Unix additions
262libvppinfra_la_SOURCES = \
263 $(CLIB_CORE) \
264 vppinfra/elf_clib.c \
265 vppinfra/socket.c \
266 vppinfra/timer.c \
267 vppinfra/unix-formats.c \
268 vppinfra/unix-misc.c
Damjan Marion29b6af92015-12-13 21:17:07 +0100269
270bin_PROGRAMS = elftool
271
272elftool_SOURCES = tools/elftool.c
Dave Barachb3d93da2016-08-03 14:34:38 -0400273elftool_CPPFLAGS = $(AM_CPPFLAGS)
Damjan Marion29b6af92015-12-13 21:17:07 +0100274elftool_LDADD = libvppinfra.la -lpthread -lrt -lm