lib/rculist: New RCU-iterator, single-writer doubly-linked list.
[cascardo/ovs.git] / lib / automake.mk
1 # Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc.
2 #
3 # Copying and distribution of this file, with or without modification,
4 # are permitted in any medium without royalty provided the copyright
5 # notice and this notice are preserved.  This file is offered as-is,
6 # without warranty of any kind.
7
8 lib_LTLIBRARIES += lib/libopenvswitch.la
9
10 lib_libopenvswitch_la_LIBADD = $(SSL_LIBS)
11
12 if WIN32
13 lib_libopenvswitch_la_LIBADD += ${PTHREAD_LIBS}
14 endif
15
16 lib_libopenvswitch_la_LDFLAGS = -release $(VERSION)
17
18 lib_libopenvswitch_la_SOURCES = \
19         lib/aes128.c \
20         lib/aes128.h \
21         lib/async-append.h \
22         lib/backtrace.c \
23         lib/backtrace.h \
24         lib/bfd.c \
25         lib/bfd.h \
26         lib/bitmap.h \
27         lib/bundle.c \
28         lib/bundle.h \
29         lib/byte-order.h \
30         lib/byteq.c \
31         lib/byteq.h \
32         lib/cfm.c \
33         lib/cfm.h \
34         lib/classifier.c \
35         lib/classifier.h \
36         lib/classifier-private.h \
37         lib/cmap.c \
38         lib/cmap.h \
39         lib/command-line.c \
40         lib/command-line.h \
41         lib/compiler.h \
42         lib/connectivity.c \
43         lib/connectivity.h \
44         lib/coverage.c \
45         lib/coverage.h \
46         lib/crc32c.c \
47         lib/crc32c.h \
48         lib/csum.c \
49         lib/csum.h \
50         lib/daemon.c \
51         lib/daemon.h \
52         lib/daemon-private.h \
53         lib/dhcp.h \
54         lib/dummy.c \
55         lib/dummy.h \
56         lib/dhparams.h \
57         lib/dirs.h \
58         lib/dpctl.c \
59         lib/dpctl.h \
60         lib/dpif-netdev.c \
61         lib/dpif-netdev.h \
62         lib/dpif-provider.h \
63         lib/dpif.c \
64         lib/dpif.h \
65         lib/heap.c \
66         lib/heap.h \
67         lib/dynamic-string.c \
68         lib/dynamic-string.h \
69         lib/entropy.c \
70         lib/entropy.h \
71         lib/fat-rwlock.c \
72         lib/fat-rwlock.h \
73         lib/fatal-signal.c \
74         lib/fatal-signal.h \
75         lib/flow.c \
76         lib/flow.h \
77         lib/guarded-list.c \
78         lib/guarded-list.h \
79         lib/hash.c \
80         lib/hash.h \
81         lib/hindex.c \
82         lib/hindex.h \
83         lib/hmap.c \
84         lib/hmap.h \
85         lib/hmapx.c \
86         lib/hmapx.h \
87         lib/jhash.c \
88         lib/jhash.h \
89         lib/json.c \
90         lib/json.h \
91         lib/jsonrpc.c \
92         lib/jsonrpc.h \
93         lib/lacp.c \
94         lib/lacp.h \
95         lib/latch.h \
96         lib/learn.c \
97         lib/learn.h \
98         lib/learning-switch.c \
99         lib/learning-switch.h \
100         lib/list.c \
101         lib/list.h \
102         lib/lockfile.c \
103         lib/lockfile.h \
104         lib/mac-learning.c \
105         lib/mac-learning.h \
106         lib/match.c \
107         lib/match.h \
108         lib/mcast-snooping.c \
109         lib/mcast-snooping.h \
110         lib/memory.c \
111         lib/memory.h \
112         lib/meta-flow.c \
113         lib/meta-flow.h \
114         lib/multipath.c \
115         lib/multipath.h \
116         lib/netdev-dummy.c \
117         lib/netdev-provider.h \
118         lib/netdev-vport.c \
119         lib/netdev-vport.h \
120         lib/netdev.c \
121         lib/netdev.h \
122         lib/netflow.h \
123         lib/netlink.c \
124         lib/netlink.h \
125         lib/nx-match.c \
126         lib/nx-match.h \
127         lib/odp-execute.c \
128         lib/odp-execute.h \
129         lib/odp-util.c \
130         lib/odp-util.h \
131         lib/ofp-actions.c \
132         lib/ofp-actions.h \
133         lib/ofp-errors.c \
134         lib/ofp-errors.h \
135         lib/ofp-msgs.c \
136         lib/ofp-msgs.h \
137         lib/ofp-parse.c \
138         lib/ofp-parse.h \
139         lib/ofp-print.c \
140         lib/ofp-print.h \
141         lib/ofp-util.c \
142         lib/ofp-util.h \
143         lib/ofp-version-opt.h \
144         lib/ofp-version-opt.c \
145         lib/ofpbuf.c \
146         lib/ofpbuf.h \
147         lib/ovs-atomic-c11.h \
148         lib/ovs-atomic-clang.h \
149         lib/ovs-atomic-flag-gcc4.7+.h \
150         lib/ovs-atomic-gcc4+.h \
151         lib/ovs-atomic-gcc4.7+.h \
152         lib/ovs-atomic-i586.h \
153         lib/ovs-atomic-locked.c \
154         lib/ovs-atomic-locked.h \
155         lib/ovs-atomic-msvc.h \
156         lib/ovs-atomic-pthreads.h \
157         lib/ovs-atomic-x86_64.h \
158         lib/ovs-atomic.h \
159         lib/ovs-rcu.c \
160         lib/ovs-rcu.h \
161         lib/ovs-thread.c \
162         lib/ovs-thread.h \
163         lib/ovsdb-data.c \
164         lib/ovsdb-data.h \
165         lib/ovsdb-error.c \
166         lib/ovsdb-error.h \
167         lib/ovsdb-idl-provider.h \
168         lib/ovsdb-idl.c \
169         lib/ovsdb-idl.h \
170         lib/ovsdb-parser.c \
171         lib/ovsdb-parser.h \
172         lib/ovsdb-types.c \
173         lib/ovsdb-types.h \
174         lib/packet-dpif.c \
175         lib/packet-dpif.h \
176         lib/packets.c \
177         lib/packets.h \
178         lib/pcap-file.c \
179         lib/pcap-file.h \
180         lib/poll-loop.c \
181         lib/poll-loop.h \
182         lib/process.c \
183         lib/process.h \
184         lib/pvector.c \
185         lib/pvector.h \
186         lib/random.c \
187         lib/random.h \
188         lib/rconn.c \
189         lib/rconn.h \
190         lib/rculist.c \
191         lib/rculist.h \
192         lib/reconnect.c \
193         lib/reconnect.h \
194         lib/rstp.c \
195         lib/rstp.h \
196         lib/rstp-common.h \
197         lib/rstp-state-machines.c \
198         lib/rstp-state-machines.h \
199         lib/sat-math.h \
200         lib/seq.c \
201         lib/seq.h \
202         lib/sha1.c \
203         lib/sha1.h \
204         lib/shash.c \
205         lib/shash.h \
206         lib/simap.c \
207         lib/simap.h \
208         lib/smap.c \
209         lib/smap.h \
210         lib/socket-util.c \
211         lib/socket-util.h \
212         lib/sort.c \
213         lib/sort.h \
214         lib/sset.c \
215         lib/sset.h \
216         lib/stp.c \
217         lib/stp.h \
218         lib/stream-fd.c \
219         lib/stream-fd.h \
220         lib/stream-provider.h \
221         lib/stream-ssl.h \
222         lib/stream-tcp.c \
223         lib/stream.c \
224         lib/stream.h \
225         lib/stdio.c \
226         lib/string.c \
227         lib/svec.c \
228         lib/svec.h \
229         lib/table.c \
230         lib/table.h \
231         lib/tag.c \
232         lib/tag.h \
233         lib/timer.c \
234         lib/timer.h \
235         lib/timeval.c \
236         lib/timeval.h \
237         lib/token-bucket.c \
238         lib/token-bucket.h \
239         lib/type-props.h \
240         lib/unaligned.h \
241         lib/unicode.c \
242         lib/unicode.h \
243         lib/unixctl.c \
244         lib/unixctl.h \
245         lib/util.c \
246         lib/util.h \
247         lib/uuid.c \
248         lib/uuid.h \
249         lib/valgrind.h \
250         lib/vconn-provider.h \
251         lib/vconn-stream.c \
252         lib/vconn.c \
253         lib/vconn.h \
254         lib/vlan-bitmap.c \
255         lib/vlan-bitmap.h \
256         lib/vlandev.c \
257         lib/vlandev.h \
258         lib/vlog.c \
259         lib/vlog.h \
260         lib/vswitch-idl.c \
261         lib/vswitch-idl.h \
262         lib/vtep-idl.c \
263         lib/vtep-idl.h
264
265 if WIN32
266 lib_libopenvswitch_la_SOURCES += \
267         lib/daemon-windows.c \
268         lib/getopt_long.c \
269         lib/getrusage-windows.c \
270         lib/latch-windows.c \
271         lib/route-table-stub.c \
272         lib/strsep.c
273 else
274 lib_libopenvswitch_la_SOURCES += \
275         lib/daemon-unix.c \
276         lib/latch-unix.c \
277         lib/signals.c \
278         lib/signals.h \
279         lib/socket-util-unix.c \
280         lib/stream-unix.c
281 endif
282
283 EXTRA_DIST += \
284         lib/stdio.h.in \
285         lib/string.h.in
286
287 nodist_lib_libopenvswitch_la_SOURCES = \
288         lib/dirs.c
289 CLEANFILES += $(nodist_lib_libopenvswitch_la_SOURCES)
290
291 lib_LTLIBRARIES += lib/libsflow.la
292 lib_libsflow_la_LDFLAGS = -release $(VERSION)
293 lib_libsflow_la_SOURCES = \
294         lib/sflow_api.h \
295         lib/sflow.h \
296         lib/sflow_agent.c \
297         lib/sflow_sampler.c \
298         lib/sflow_poller.c \
299         lib/sflow_receiver.c
300 lib_libsflow_la_CPPFLAGS = $(AM_CPPFLAGS)
301 lib_libsflow_la_CFLAGS = $(AM_CFLAGS)
302 if HAVE_WNO_UNUSED
303 lib_libsflow_la_CFLAGS += -Wno-unused
304 endif
305 if HAVE_WNO_UNUSED_PARAMETER
306 lib_libsflow_la_CFLAGS += -Wno-unused-parameter
307 endif
308
309 if LINUX
310 lib_libopenvswitch_la_SOURCES += \
311         lib/dpif-netlink.c \
312         lib/dpif-netlink.h \
313         lib/netdev-linux.c \
314         lib/netdev-linux.h \
315         lib/netlink-notifier.c \
316         lib/netlink-notifier.h \
317         lib/netlink-protocol.h \
318         lib/netlink-socket.c \
319         lib/netlink-socket.h \
320         lib/ovs-numa.c \
321         lib/ovs-numa.h \
322         lib/rtnetlink-link.c \
323         lib/rtnetlink-link.h \
324         lib/route-table.c \
325         lib/route-table.h
326 endif
327
328 if DPDK_NETDEV
329 lib_libopenvswitch_la_SOURCES += \
330        lib/netdev-dpdk.c \
331        lib/netdev-dpdk.h
332 endif
333
334 if WIN32
335 lib_libopenvswitch_la_SOURCES += \
336         lib/dpif-netlink.c \
337         lib/dpif-netlink.h \
338         lib/netdev-windows.c \
339         lib/netlink-notifier.c \
340         lib/netlink-notifier.h \
341         lib/netlink-protocol.h \
342         lib/netlink-socket.c \
343         lib/netlink-socket.h
344 endif
345
346 if HAVE_POSIX_AIO
347 lib_libopenvswitch_la_SOURCES += lib/async-append-aio.c
348 else
349 lib_libopenvswitch_la_SOURCES += lib/async-append-null.c
350 endif
351
352 if ESX
353 lib_libopenvswitch_la_SOURCES += \
354         lib/route-table-stub.c
355 endif
356
357 if HAVE_IF_DL
358 lib_libopenvswitch_la_SOURCES += \
359         lib/netdev-bsd.c \
360         lib/rtbsd.c \
361         lib/rtbsd.h \
362         lib/route-table-bsd.c
363 endif
364
365 if HAVE_OPENSSL
366 lib_libopenvswitch_la_SOURCES += lib/stream-ssl.c
367 nodist_lib_libopenvswitch_la_SOURCES += lib/dhparams.c
368 lib/dhparams.c: lib/dh1024.pem lib/dh2048.pem lib/dh4096.pem
369         $(AM_V_GEN)(echo '#include "lib/dhparams.h"' &&                 \
370          openssl dhparam -C -in $(srcdir)/lib/dh1024.pem -noout &&      \
371          openssl dhparam -C -in $(srcdir)/lib/dh2048.pem -noout &&      \
372          openssl dhparam -C -in $(srcdir)/lib/dh4096.pem -noout)        \
373         | sed 's/\(get_dh[0-9]*\)()/\1(void)/' > lib/dhparams.c.tmp &&  \
374         mv lib/dhparams.c.tmp lib/dhparams.c
375 else
376 lib_libopenvswitch_la_SOURCES += lib/stream-nossl.c
377 endif
378
379 EXTRA_DIST += \
380         lib/dh1024.pem \
381         lib/dh2048.pem \
382         lib/dh4096.pem \
383         lib/dirs.c.in
384
385 MAN_FRAGMENTS += \
386         lib/common.man \
387         lib/common-syn.man \
388         lib/coverage-unixctl.man \
389         lib/daemon.man \
390         lib/daemon-syn.man \
391         lib/dpctl.man \
392         lib/memory-unixctl.man \
393         lib/ofp-version.man \
394         lib/ovs.tmac \
395         lib/service.man \
396         lib/service-syn.man \
397         lib/ssl-bootstrap.man \
398         lib/ssl-bootstrap-syn.man \
399         lib/ssl-peer-ca-cert.man \
400         lib/ssl.man \
401         lib/ssl-syn.man \
402         lib/table.man \
403         lib/unixctl.man \
404         lib/unixctl-syn.man \
405         lib/vconn-active.man \
406         lib/vconn-passive.man \
407         lib/vlog-unixctl.man \
408         lib/vlog-syn.man \
409         lib/vlog.man
410
411 # vswitch IDL
412 OVSIDL_BUILT += \
413         $(srcdir)/lib/vswitch-idl.c \
414         $(srcdir)/lib/vswitch-idl.h \
415         $(srcdir)/lib/vswitch-idl.ovsidl \
416         $(srcdir)/lib/vtep-idl.c \
417         $(srcdir)/lib/vtep-idl.h \
418         $(srcdir)/lib/vtep-idl.ovsidl
419
420 EXTRA_DIST += $(srcdir)/lib/vswitch-idl.ann
421 VSWITCH_IDL_FILES = \
422         $(srcdir)/vswitchd/vswitch.ovsschema \
423         $(srcdir)/lib/vswitch-idl.ann
424 $(srcdir)/lib/vswitch-idl.ovsidl: $(VSWITCH_IDL_FILES)
425         $(AM_V_GEN)$(OVSDB_IDLC) annotate $(VSWITCH_IDL_FILES) > $@.tmp && \
426         mv $@.tmp $@
427
428 EXTRA_DIST += $(srcdir)/lib/vtep-idl.ann
429 VTEP_IDL_FILES = \
430         $(srcdir)/vtep/vtep.ovsschema \
431         $(srcdir)/lib/vtep-idl.ann
432 $(srcdir)/lib/vtep-idl.ovsidl: $(VTEP_IDL_FILES)
433         $(AM_V_GEN)$(OVSDB_IDLC) annotate $(VTEP_IDL_FILES) > $@.tmp && \
434         mv $@.tmp $@
435
436 lib/dirs.c: lib/dirs.c.in Makefile
437         $(AM_V_GEN)($(ro_c) && sed < $(srcdir)/lib/dirs.c.in \
438                 -e 's,[@]srcdir[@],$(srcdir),g' \
439                 -e 's,[@]LOGDIR[@],"$(LOGDIR)",g' \
440                 -e 's,[@]RUNDIR[@],"$(RUNDIR)",g' \
441                 -e 's,[@]DBDIR[@],"$(DBDIR)",g' \
442                 -e 's,[@]bindir[@],"$(bindir)",g' \
443                 -e 's,[@]sysconfdir[@],"$(sysconfdir)",g' \
444                 -e 's,[@]pkgdatadir[@],"$(pkgdatadir)",g') \
445              > lib/dirs.c.tmp && \
446         mv lib/dirs.c.tmp lib/dirs.c
447
448 lib/meta-flow.inc: $(srcdir)/build-aux/extract-ofp-fields lib/meta-flow.h
449         $(AM_V_GEN)$(run_python) $^ --meta-flow > $@.tmp && mv $@.tmp $@
450 lib/meta-flow.lo: lib/meta-flow.inc
451 lib/nx-match.inc: $(srcdir)/build-aux/extract-ofp-fields lib/meta-flow.h
452         $(AM_V_GEN)$(run_python) $^ --nx-match > $@.tmp && mv $@.tmp $@
453 lib/nx-match.lo: lib/nx-match.inc
454 CLEANFILES += lib/meta-flow.inc lib/nx-match.inc
455 EXTRA_DIST += build-aux/extract-ofp-fields
456
457 lib/ofp-actions.inc1: $(srcdir)/build-aux/extract-ofp-actions lib/ofp-actions.c
458         $(AM_V_GEN)$(run_python) $^ --prototypes > $@.tmp && mv $@.tmp $@
459 lib/ofp-actions.inc2: $(srcdir)/build-aux/extract-ofp-actions lib/ofp-actions.c
460         $(AM_V_GEN)$(run_python) $^ --definitions > $@.tmp && mv $@.tmp $@
461 lib/ofp-actions.lo: lib/ofp-actions.inc1 lib/ofp-actions.inc2
462 CLEANFILES += lib/ofp-actions.inc1 lib/ofp-actions.inc2
463 EXTRA_DIST += build-aux/extract-ofp-actions
464
465 $(srcdir)/lib/ofp-errors.inc: \
466         lib/ofp-errors.h include/openflow/openflow-common.h \
467         $(srcdir)/build-aux/extract-ofp-errors
468         $(AM_V_GEN)$(run_python) $(srcdir)/build-aux/extract-ofp-errors \
469                 $(srcdir)/lib/ofp-errors.h \
470                 $(srcdir)/include/openflow/openflow-common.h > $@.tmp && \
471         mv $@.tmp $@
472 $(srcdir)/lib/ofp-errors.c: $(srcdir)/lib/ofp-errors.inc
473 EXTRA_DIST += build-aux/extract-ofp-errors lib/ofp-errors.inc
474
475 $(srcdir)/lib/ofp-msgs.inc: \
476         lib/ofp-msgs.h $(srcdir)/build-aux/extract-ofp-msgs
477         $(AM_V_GEN)$(run_python) $(srcdir)/build-aux/extract-ofp-msgs \
478                 $(srcdir)/lib/ofp-msgs.h $@ > $@.tmp && mv $@.tmp $@
479 $(srcdir)/lib/ofp-msgs.c: $(srcdir)/lib/ofp-msgs.inc
480 EXTRA_DIST += build-aux/extract-ofp-msgs lib/ofp-msgs.inc
481
482 INSTALL_DATA_LOCAL += lib-install-data-local
483 lib-install-data-local:
484         $(MKDIR_P) $(DESTDIR)$(RUNDIR)
485         $(MKDIR_P) $(DESTDIR)$(PKIDIR)
486         $(MKDIR_P) $(DESTDIR)$(LOGDIR)
487         $(MKDIR_P) $(DESTDIR)$(DBDIR)
488