Move java api to extras/
[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_bihash_vec88 \
21            test_cuckoo_bihash \
22            test_cuckoo_template\
23            test_dlist \
24            test_elf \
25            test_elog \
26            test_fifo \
27            test_flowhash_template \
28            test_format \
29            test_fpool \
30            test_hash \
31            test_heap \
32            test_longjmp \
33            test_macros \
34            test_maplog \
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_time_range \
45            test_timing_wheel \
46            test_tw_timer \
47            test_valloc \
48            test_vec \
49            test_zvec
50 endif
51
52 noinst_PROGRAMS = $(TESTS)
53 check_PROGRAMS  = $(TESTS)
54
55 test_bihash_template_SOURCES = vppinfra/test_bihash_template.c
56 test_bihash_vec88_SOURCES = vppinfra/test_bihash_vec88.c
57 test_cuckoo_template_SOURCES = vppinfra/test_cuckoo_template.c
58 test_cuckoo_bihash_SOURCES = vppinfra/test_cuckoo_bihash.c
59 test_dlist_SOURCES = vppinfra/test_dlist.c
60 test_elf_SOURCES = vppinfra/test_elf.c
61 test_elog_SOURCES = vppinfra/test_elog.c
62 test_fifo_SOURCES = vppinfra/test_fifo.c
63 test_flowhash_template_SOURCES = vppinfra/test_flowhash_template.c
64 test_format_SOURCES = vppinfra/test_format.c
65 test_fpool_SOURCES = vppinfra/test_fpool.c
66 test_hash_SOURCES = vppinfra/test_hash.c
67 test_heap_SOURCES = vppinfra/test_heap.c
68 test_longjmp_SOURCES = vppinfra/test_longjmp.c
69 test_macros_SOURCES = vppinfra/test_macros.c
70 test_maplog_SOURCES = vppinfra/test_maplog.c
71 test_mheap_SOURCES = vppinfra/test_mheap.c
72 test_pool_iterate_SOURCES = vppinfra/test_pool_iterate.c
73 test_ptclosure_SOURCES = vppinfra/test_ptclosure.c
74 test_random_isaac_SOURCES = vppinfra/test_random_isaac.c
75 test_random_SOURCES = vppinfra/test_random.c
76 test_serialize_SOURCES = vppinfra/test_serialize.c
77 test_slist_SOURCES = vppinfra/test_slist.c
78 test_socket_SOURCES = vppinfra/test_socket.c
79 test_time_SOURCES = vppinfra/test_time.c
80 test_time_range_SOURCES = vppinfra/test_time_range.c
81 test_timing_wheel_SOURCES = vppinfra/test_timing_wheel.c
82 test_tw_timer_SOURCES = vppinfra/test_tw_timer.c
83 test_valloc_SOURCES = vppinfra/test_valloc.c
84 test_vec_SOURCES = vppinfra/test_vec.c
85 test_zvec_SOURCES = vppinfra/test_zvec.c
86
87 # All unit tests use ASSERT for failure
88 # So we'll need -DDEBUG to enable ASSERTs
89 test_bihash_template_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
90 test_bihash_vec88_CPPFLAGS =    $(AM_CPPFLAGS) -DCLIB_DEBUG
91 test_cuckoo_template_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
92 test_cuckoo_bihash_CPPFLAGS =   $(AM_CPPFLAGS) -DCLIB_DEBUG
93 test_dlist_CPPFLAGS =   $(AM_CPPFLAGS) -DCLIB_DEBUG
94 test_elf_CPPFLAGS =     $(AM_CPPFLAGS) -DCLIB_DEBUG
95 test_elog_CPPFLAGS =    $(AM_CPPFLAGS) -DCLIB_DEBUG
96 test_fifo_CPPFLAGS =    $(AM_CPPFLAGS) -DCLIB_DEBUG
97 test_flowhash_template_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
98 test_format_CPPFLAGS =  $(AM_CPPFLAGS) -DCLIB_DEBUG
99 test_fpool_CPPFLAGS =   $(AM_CPPFLAGS) -DCLIB_DEBUG
100 test_hash_CPPFLAGS =    $(AM_CPPFLAGS) -DCLIB_DEBUG
101 test_heap_CPPFLAGS =    $(AM_CPPFLAGS) -DCLIB_DEBUG
102 test_longjmp_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
103 test_macros_CPPFLAGS =  $(AM_CPPFLAGS) -DCLIB_DEBUG
104 test_maplog_CPPFLAGS =  $(AM_CPPFLAGS) -DCLIB_DEBUG
105 test_mheap_CPPFLAGS =   $(AM_CPPFLAGS) -DCLIB_DEBUG
106 test_pool_iterate_CPPFLAGS =    $(AM_CPPFLAGS) -DCLIB_DEBUG
107 test_ptclosure_CPPFLAGS =       $(AM_CPPFLAGS) -DCLIB_DEBUG
108 test_random_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
109 test_random_isaac_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
110 test_serialize_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
111 test_slist_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
112 test_socket_CPPFLAGS =  $(AM_CPPFLAGS) -DCLIB_DEBUG
113 test_time_CPPFLAGS =    $(AM_CPPFLAGS) -DCLIB_DEBUG
114 test_timing_wheel_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
115 test_tw_timer_CPPFLAGS =        $(AM_CPPFLAGS) -DCLIB_DEBUG
116 test_valloc_CPPFLAGS =  $(AM_CPPFLAGS) -DCLIB_DEBUG
117 test_vec_CPPFLAGS =     $(AM_CPPFLAGS) -DCLIB_DEBUG
118 test_zvec_CPPFLAGS =    $(AM_CPPFLAGS) -DCLIB_DEBUG
119
120 test_bihash_template_LDADD =    libvppinfra.la
121 test_bihash_vec88_LDADD =       libvppinfra.la
122 test_cuckoo_template_LDADD =    libvppinfra.la
123 test_cuckoo_bihash_LDADD =      libvppinfra.la
124 test_dlist_LDADD =      libvppinfra.la
125 test_elf_LDADD =        libvppinfra.la
126 test_elog_LDADD =       libvppinfra.la
127 test_fifo_LDADD =       libvppinfra.la
128 test_flowhash_template_LDADD =  libvppinfra.la
129 test_format_LDADD =     libvppinfra.la
130 test_fpool_LDADD =      libvppinfra.la
131 test_hash_LDADD =       libvppinfra.la
132 test_heap_LDADD =       libvppinfra.la
133 test_longjmp_LDADD =    libvppinfra.la
134 test_macros_LDADD =     libvppinfra.la
135 test_maplog_LDADD =     libvppinfra.la
136 test_mheap_LDADD =      libvppinfra.la
137 test_pool_iterate_LDADD =       libvppinfra.la
138 test_ptclosure_LDADD =  libvppinfra.la
139 test_random_isaac_LDADD =       libvppinfra.la
140 test_random_LDADD =     libvppinfra.la
141 test_serialize_LDADD =  libvppinfra.la
142 test_slist_LDADD =      libvppinfra.la
143 test_socket_LDADD =     libvppinfra.la
144 test_time_LDADD =       libvppinfra.la -lm
145 test_time_range_LDADD = libvppinfra.la -lm
146 test_timing_wheel_LDADD =       libvppinfra.la -lm
147 test_tw_timer_LDADD =   libvppinfra.la
148 test_valloc_LDADD =     libvppinfra.la
149 test_vec_LDADD =        libvppinfra.la
150 test_zvec_LDADD =       libvppinfra.la
151
152 test_bihash_template_LDFLAGS = -static
153 test_bihash_vec88_LDFLAGS = -static
154 test_cuckoo_template_LDFLAGS = -static
155 test_cuckoo_bihash_LDFLAGS = -static -lpthread
156 test_dlist_LDFLAGS = -static
157 test_elf_LDFLAGS = -static
158 test_elog_LDFLAGS = -static
159 test_fifo_LDFLAGS = -static
160 test_flowhash_template_LDFLAGS = -static
161 test_format_LDFLAGS = -static
162 test_fpool_LDFLAGS = -static
163 test_hash_LDFLAGS = -static
164 test_heap_LDFLAGS = -static
165 test_longjmp_LDFLAGS = -static
166 test_macros_LDFLAGS = -static
167 test_maplog_LDFLAGS = -static
168 test_mheap_LDFLAGS = -static
169 test_pool_iterate_LDFLAGS = -static
170 test_ptclosure_LDFLAGS = -static
171 test_random_isaac_LDFLAGS = -static
172 test_random_LDFLAGS = -static
173 test_serialize_LDFLAGS = -static
174 test_slist_LDFLAGS = -static
175 test_socket_LDFLAGS = -static
176 test_time_LDFLAGS = -static
177 test_time_range_LDFLAGS = -static
178 test_timing_wheel_LDFLAGS = -static
179 test_tw_timer_LDFLAGS = -static
180 test_valloc_LDFLAGS = -static
181 test_vec_LDFLAGS = -static
182 test_zvec_LDFLAGS = -static
183
184 # noinst_PROGRAMS += test_vhash
185 # test_vhash_SOURCES = vppinfra/test_vhash.c vppinfra/vhash.c
186 # test_vhash_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
187 # test_vhash_LDADD = libvppinfra.la
188 # test_vhash_LDFLAGS = -static
189
190 nobase_include_HEADERS = \
191   vppinfra/asm_mips.h \
192   vppinfra/asm_x86.h \
193   vppinfra/bihash_8_8.h \
194   vppinfra/bihash_vec8_8.h \
195   vppinfra/bihash_16_8.h \
196   vppinfra/bihash_24_8.h \
197   vppinfra/bihash_40_8.h \
198   vppinfra/bihash_48_8.h \
199   vppinfra/bihash_template.h \
200   vppinfra/bihash_template.c \
201   vppinfra/bitmap.h \
202   vppinfra/bitops.h \
203   vppinfra/byte_order.h \
204   vppinfra/cache.h \
205   vppinfra/config.h \
206   vppinfra/clib.h \
207   vppinfra/clib_error.h \
208   vppinfra/cpu.h \
209   vppinfra/crc32.h \
210   vppinfra/lb_hash_hash.h \
211   vppinfra/dlist.h \
212   vppinfra/elf.h \
213   vppinfra/elf_clib.h \
214   vppinfra/elog.h \
215   vppinfra/fheap.h \
216   vppinfra/error.h \
217   vppinfra/error_bootstrap.h \
218   vppinfra/fifo.h \
219   vppinfra/file.h \
220   vppinfra/flowhash_template.h \
221   vppinfra/flowhash_8_8.h \
222   vppinfra/flowhash_24_16.h \
223   vppinfra/format.h \
224   vppinfra/graph.h \
225   vppinfra/hash.h \
226   vppinfra/heap.h \
227   vppinfra/linux/sysfs.h \
228   vppinfra/linux/syscall.h \
229   vppinfra/lock.h \
230   vppinfra/longjmp.h \
231   vppinfra/macros.h \
232   vppinfra/maplog.h \
233   vppinfra/math.h \
234   vppinfra/mem.h \
235   vppinfra/memcpy_sse3.h \
236   vppinfra/memcpy_avx2.h \
237   vppinfra/memcpy_avx512.h \
238   vppinfra/mhash.h \
239   vppinfra/mheap.h \
240   vppinfra/mheap_bootstrap.h \
241   vppinfra/os.h \
242   vppinfra/pipeline.h \
243   vppinfra/pool.h \
244   vppinfra/ptclosure.h \
245   vppinfra/random.h \
246   vppinfra/random_buffer.h \
247   vppinfra/random_isaac.h \
248   vppinfra/serialize.h \
249   vppinfra/slist.h \
250   vppinfra/smp.h \
251   vppinfra/socket.h \
252   vppinfra/sparse_vec.h \
253   vppinfra/string.h \
254   vppinfra/time.h \
255   vppinfra/time_range.h \
256   vppinfra/timing_wheel.h \
257   vppinfra/timer.h \
258   vppinfra/tw_timer_2t_1w_2048sl.h \
259   vppinfra/tw_timer_16t_2w_512sl.h \
260   vppinfra/tw_timer_16t_1w_2048sl.h \
261   vppinfra/tw_timer_4t_3w_256sl.h \
262   vppinfra/tw_timer_1t_3w_1024sl_ov.h \
263   vppinfra/tw_timer_template.h \
264   vppinfra/tw_timer_template.c \
265   vppinfra/types.h \
266   vppinfra/unix.h \
267   vppinfra/valloc.h \
268   vppinfra/vec.h \
269   vppinfra/vec_bootstrap.h \
270   vppinfra/vector.h \
271   vppinfra/vector_altivec.h \
272   vppinfra/vector_avx2.h \
273   vppinfra/vector_avx512.h \
274   vppinfra/vector_funcs.h \
275   vppinfra/vector_neon.h \
276   vppinfra/vector_sse42.h \
277   vppinfra/valgrind.h \
278   vppinfra/xxhash.h \
279   vppinfra/xy.h \
280   vppinfra/zvec.h
281
282 if ENABLE_DLMALLOC
283   nobase_include_HEADERS += \
284   vppinfra/dlmalloc.h
285 else
286   nobase_include_HEADERS +=  \
287   vppinfra/mheap_bootstrap.h 
288 endif
289
290 CLIB_CORE = \
291   vppinfra/asm_x86.c \
292   vppinfra/backtrace.c \
293   vppinfra/bihash_8_8.h \
294   vppinfra/bihash_vec8_8.h \
295   vppinfra/bihash_24_8.h \
296   vppinfra/bihash_template.h \
297   vppinfra/cpu.c \
298   vppinfra/elf.c \
299   vppinfra/elog.c \
300   vppinfra/error.c \
301   vppinfra/fifo.c \
302   vppinfra/fheap.c \
303   vppinfra/flowhash_8_8.h \
304   vppinfra/flowhash_24_16.h \
305   vppinfra/flowhash_template.h \
306   vppinfra/format.c \
307   vppinfra/pool.c \
308   vppinfra/graph.c \
309   vppinfra/hash.c \
310   vppinfra/heap.c \
311   vppinfra/longjmp.S \
312   vppinfra/macros.c \
313   vppinfra/mhash.c \
314   vppinfra/ptclosure.c \
315   vppinfra/random.c \
316   vppinfra/random_buffer.c \
317   vppinfra/random_isaac.c \
318   vppinfra/serialize.c \
319   vppinfra/slist.c \
320   vppinfra/std-formats.c \
321   vppinfra/string.c \
322   vppinfra/time.c \
323   vppinfra/time_range.c \
324   vppinfra/timing_wheel.c \
325   vppinfra/tw_timer_template.h \
326   vppinfra/tw_timer_2t_1w_2048sl.h \
327   vppinfra/tw_timer_2t_1w_2048sl.c \
328   vppinfra/tw_timer_16t_2w_512sl.h \
329   vppinfra/tw_timer_16t_2w_512sl.c \
330   vppinfra/tw_timer_16t_1w_2048sl.h \
331   vppinfra/tw_timer_16t_1w_2048sl.c \
332   vppinfra/tw_timer_4t_3w_256sl.h \
333   vppinfra/tw_timer_4t_3w_256sl.c \
334   vppinfra/tw_timer_1t_3w_1024sl_ov.h \
335   vppinfra/tw_timer_1t_3w_1024sl_ov.c \
336   vppinfra/unformat.c \
337   vppinfra/valloc.c \
338   vppinfra/vec.c \
339   vppinfra/vector.c \
340   vppinfra/zvec.c
341
342 if ENABLE_DLMALLOC
343   CLIB_CORE += \
344   vppinfra/mem_dlmalloc.c \
345   vppinfra/dlmalloc.c \
346   vppinfra/dlmalloc.h
347 else
348   CLIB_CORE += \
349   vppinfra/mheap.c \
350   vppinfra/mem_mheap.c 
351 endif
352
353 # Core plus Unix additions
354 libvppinfra_la_SOURCES =                        \
355   $(CLIB_CORE)                                  \
356   vppinfra/elf_clib.c                           \
357   vppinfra/linux/mem.c                          \
358   vppinfra/linux/sysfs.c                        \
359   vppinfra/maplog.c                             \
360   vppinfra/socket.c                             \
361   vppinfra/timer.c                              \
362   vppinfra/unix-formats.c                       \
363   vppinfra/unix-misc.c
364
365 bin_PROGRAMS = elftool
366
367 elftool_SOURCES = tools/elftool/elftool.c
368 elftool_CPPFLAGS = $(AM_CPPFLAGS)
369 elftool_LDADD = libvppinfra.la -lpthread -lrt -lm
370
371 # vi:syntax=automake