lib/pvector: Non-intrusive RCU priority vector.
[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.c \
27         lib/bitmap.h \
28         lib/bundle.c \
29         lib/bundle.h \
30         lib/byte-order.h \
31         lib/byteq.c \
32         lib/byteq.h \
33         lib/cfm.c \
34         lib/cfm.h \
35         lib/classifier.c \
36         lib/classifier.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/dpif-netdev.c \
59         lib/dpif-netdev.h \
60         lib/dpif-provider.h \
61         lib/dpif.c \
62         lib/dpif.h \
63         lib/heap.c \
64         lib/heap.h \
65         lib/dynamic-string.c \
66         lib/dynamic-string.h \
67         lib/entropy.c \
68         lib/entropy.h \
69         lib/fat-rwlock.c \
70         lib/fat-rwlock.h \
71         lib/fatal-signal.c \
72         lib/fatal-signal.h \
73         lib/flow.c \
74         lib/flow.h \
75         lib/guarded-list.c \
76         lib/guarded-list.h \
77         lib/hash.c \
78         lib/hash.h \
79         lib/hindex.c \
80         lib/hindex.h \
81         lib/hmap.c \
82         lib/hmap.h \
83         lib/hmapx.c \
84         lib/hmapx.h \
85         lib/jhash.c \
86         lib/jhash.h \
87         lib/json.c \
88         lib/json.h \
89         lib/jsonrpc.c \
90         lib/jsonrpc.h \
91         lib/lacp.c \
92         lib/lacp.h \
93         lib/latch.h \
94         lib/learn.c \
95         lib/learn.h \
96         lib/learning-switch.c \
97         lib/learning-switch.h \
98         lib/list.c \
99         lib/list.h \
100         lib/lockfile.c \
101         lib/lockfile.h \
102         lib/mac-learning.c \
103         lib/mac-learning.h \
104         lib/match.c \
105         lib/match.h \
106         lib/mcast-snooping.c \
107         lib/mcast-snooping.h \
108         lib/memory.c \
109         lib/memory.h \
110         lib/meta-flow.c \
111         lib/meta-flow.h \
112         lib/multipath.c \
113         lib/multipath.h \
114         lib/netdev-dummy.c \
115         lib/netdev-provider.h \
116         lib/netdev-vport.c \
117         lib/netdev-vport.h \
118         lib/netdev.c \
119         lib/netdev.h \
120         lib/netflow.h \
121         lib/netlink.c \
122         lib/netlink.h \
123         lib/nx-match.c \
124         lib/nx-match.h \
125         lib/odp-execute.c \
126         lib/odp-execute.h \
127         lib/odp-util.c \
128         lib/odp-util.h \
129         lib/ofp-actions.c \
130         lib/ofp-actions.h \
131         lib/ofp-errors.c \
132         lib/ofp-errors.h \
133         lib/ofp-msgs.c \
134         lib/ofp-msgs.h \
135         lib/ofp-parse.c \
136         lib/ofp-parse.h \
137         lib/ofp-print.c \
138         lib/ofp-print.h \
139         lib/ofp-util.c \
140         lib/ofp-util.def \
141         lib/ofp-util.h \
142         lib/ofp-version-opt.h \
143         lib/ofp-version-opt.c \
144         lib/ofpbuf.c \
145         lib/ofpbuf.h \
146         lib/ovs-atomic-c11.h \
147         lib/ovs-atomic-clang.h \
148         lib/ovs-atomic-flag-gcc4.7+.h \
149         lib/ovs-atomic-gcc4+.h \
150         lib/ovs-atomic-gcc4.7+.h \
151         lib/ovs-atomic-locked.c \
152         lib/ovs-atomic-locked.h \
153         lib/ovs-atomic-pthreads.h \
154         lib/ovs-atomic.h \
155         lib/ovs-rcu.c \
156         lib/ovs-rcu.h \
157         lib/ovs-thread.c \
158         lib/ovs-thread.h \
159         lib/ovsdb-data.c \
160         lib/ovsdb-data.h \
161         lib/ovsdb-error.c \
162         lib/ovsdb-error.h \
163         lib/ovsdb-idl-provider.h \
164         lib/ovsdb-idl.c \
165         lib/ovsdb-idl.h \
166         lib/ovsdb-parser.c \
167         lib/ovsdb-parser.h \
168         lib/ovsdb-types.c \
169         lib/ovsdb-types.h \
170         lib/packet-dpif.c \
171         lib/packet-dpif.h \
172         lib/packets.c \
173         lib/packets.h \
174         lib/pcap-file.c \
175         lib/pcap-file.h \
176         lib/poll-loop.c \
177         lib/poll-loop.h \
178         lib/process.c \
179         lib/process.h \
180         lib/pvector.c \
181         lib/pvector.h \
182         lib/random.c \
183         lib/random.h \
184         lib/rconn.c \
185         lib/rconn.h \
186         lib/reconnect.c \
187         lib/reconnect.h \
188         lib/sat-math.h \
189         lib/seq.c \
190         lib/seq.h \
191         lib/sha1.c \
192         lib/sha1.h \
193         lib/shash.c \
194         lib/shash.h \
195         lib/simap.c \
196         lib/simap.h \
197         lib/smap.c \
198         lib/smap.h \
199         lib/socket-util.c \
200         lib/socket-util.h \
201         lib/sort.c \
202         lib/sort.h \
203         lib/sset.c \
204         lib/sset.h \
205         lib/stp.c \
206         lib/stp.h \
207         lib/stream-fd.h \
208         lib/stream-provider.h \
209         lib/stream-ssl.h \
210         lib/stream-tcp.c \
211         lib/stream.c \
212         lib/stream.h \
213         lib/stdio.c \
214         lib/string.c \
215         lib/svec.c \
216         lib/svec.h \
217         lib/table.c \
218         lib/table.h \
219         lib/tag.c \
220         lib/tag.h \
221         lib/timer.c \
222         lib/timer.h \
223         lib/timeval.c \
224         lib/timeval.h \
225         lib/token-bucket.c \
226         lib/token-bucket.h \
227         lib/type-props.h \
228         lib/unaligned.h \
229         lib/unicode.c \
230         lib/unicode.h \
231         lib/unixctl.c \
232         lib/unixctl.h \
233         lib/util.c \
234         lib/util.h \
235         lib/uuid.c \
236         lib/uuid.h \
237         lib/valgrind.h \
238         lib/vconn-provider.h \
239         lib/vconn-stream.c \
240         lib/vconn.c \
241         lib/vconn.h \
242         lib/vlan-bitmap.c \
243         lib/vlan-bitmap.h \
244         lib/vlandev.c \
245         lib/vlandev.h \
246         lib/vlog.c \
247         lib/vlog.h \
248         lib/vswitch-idl.c \
249         lib/vswitch-idl.h \
250         lib/vtep-idl.c \
251         lib/vtep-idl.h
252
253 if WIN32
254 lib_libopenvswitch_la_SOURCES += \
255         lib/daemon-windows.c \
256         lib/getopt_long.c \
257         lib/getrusage-windows.c \
258         lib/latch-windows.c \
259         lib/route-table-stub.c \
260         lib/strsep.c \
261         lib/stream-fd-windows.c
262 else
263 lib_libopenvswitch_la_SOURCES += \
264         lib/daemon-unix.c \
265         lib/latch-unix.c \
266         lib/signals.c \
267         lib/signals.h \
268         lib/socket-util-unix.c \
269         lib/stream-fd-unix.c \
270         lib/stream-unix.c
271 endif
272
273 EXTRA_DIST += \
274         lib/stdio.h.in \
275         lib/string.h.in
276
277 nodist_lib_libopenvswitch_la_SOURCES = \
278         lib/dirs.c
279 CLEANFILES += $(nodist_lib_libopenvswitch_la_SOURCES)
280
281 lib_LTLIBRARIES += lib/libsflow.la
282 lib_libsflow_la_LDFLAGS = -release $(VERSION)
283 lib_libsflow_la_SOURCES = \
284         lib/sflow_api.h \
285         lib/sflow.h \
286         lib/sflow_agent.c \
287         lib/sflow_sampler.c \
288         lib/sflow_poller.c \
289         lib/sflow_receiver.c
290 lib_libsflow_la_CPPFLAGS = $(AM_CPPFLAGS)
291 lib_libsflow_la_CFLAGS = $(AM_CFLAGS)
292 if HAVE_WNO_UNUSED
293 lib_libsflow_la_CFLAGS += -Wno-unused
294 endif
295 if HAVE_WNO_UNUSED_PARAMETER
296 lib_libsflow_la_CFLAGS += -Wno-unused-parameter
297 endif
298
299 if LINUX
300 lib_libopenvswitch_la_SOURCES += \
301         lib/dpif-linux.c \
302         lib/dpif-linux.h \
303         lib/netdev-linux.c \
304         lib/netdev-linux.h \
305         lib/netlink-notifier.c \
306         lib/netlink-notifier.h \
307         lib/netlink-protocol.h \
308         lib/netlink-socket.c \
309         lib/netlink-socket.h \
310         lib/rtnetlink-link.c \
311         lib/rtnetlink-link.h \
312         lib/route-table.c \
313         lib/route-table.h
314 endif
315
316 if DPDK_NETDEV
317 lib_libopenvswitch_la_SOURCES += \
318        lib/netdev-dpdk.c \
319        lib/netdev-dpdk.h
320 endif
321
322 if HAVE_POSIX_AIO
323 lib_libopenvswitch_la_SOURCES += lib/async-append-aio.c
324 else
325 lib_libopenvswitch_la_SOURCES += lib/async-append-null.c
326 endif
327
328 if ESX
329 lib_libopenvswitch_la_SOURCES += \
330         lib/route-table-stub.c
331 endif
332
333 if HAVE_IF_DL
334 lib_libopenvswitch_la_SOURCES += \
335         lib/netdev-bsd.c \
336         lib/rtbsd.c \
337         lib/rtbsd.h \
338         lib/route-table-bsd.c
339 endif
340
341 if HAVE_OPENSSL
342 lib_libopenvswitch_la_SOURCES += lib/stream-ssl.c
343 nodist_lib_libopenvswitch_la_SOURCES += lib/dhparams.c
344 lib/dhparams.c: lib/dh1024.pem lib/dh2048.pem lib/dh4096.pem
345         (echo '#include "lib/dhparams.h"' &&                            \
346          openssl dhparam -C -in $(srcdir)/lib/dh1024.pem -noout &&      \
347          openssl dhparam -C -in $(srcdir)/lib/dh2048.pem -noout &&      \
348          openssl dhparam -C -in $(srcdir)/lib/dh4096.pem -noout)        \
349         | sed 's/\(get_dh[0-9]*\)()/\1(void)/' > lib/dhparams.c.tmp
350         mv lib/dhparams.c.tmp lib/dhparams.c
351 else
352 lib_libopenvswitch_la_SOURCES += lib/stream-nossl.c
353 endif
354
355 EXTRA_DIST += \
356         lib/dh1024.pem \
357         lib/dh2048.pem \
358         lib/dh4096.pem \
359         lib/dirs.c.in
360
361 MAN_FRAGMENTS += \
362         lib/common.man \
363         lib/common-syn.man \
364         lib/coverage-unixctl.man \
365         lib/daemon.man \
366         lib/daemon-syn.man \
367         lib/memory-unixctl.man \
368         lib/ofp-version.man \
369         lib/ovs.tmac \
370         lib/service.man \
371         lib/service-syn.man \
372         lib/ssl-bootstrap.man \
373         lib/ssl-bootstrap-syn.man \
374         lib/ssl-peer-ca-cert.man \
375         lib/ssl.man \
376         lib/ssl-syn.man \
377         lib/table.man \
378         lib/unixctl.man \
379         lib/unixctl-syn.man \
380         lib/vconn-active.man \
381         lib/vconn-passive.man \
382         lib/vlog-unixctl.man \
383         lib/vlog-syn.man \
384         lib/vlog.man
385
386 # vswitch IDL
387 OVSIDL_BUILT += \
388         $(srcdir)/lib/vswitch-idl.c \
389         $(srcdir)/lib/vswitch-idl.h \
390         $(srcdir)/lib/vswitch-idl.ovsidl \
391         $(srcdir)/lib/vtep-idl.c \
392         $(srcdir)/lib/vtep-idl.h \
393         $(srcdir)/lib/vtep-idl.ovsidl
394
395 EXTRA_DIST += $(srcdir)/lib/vswitch-idl.ann
396 VSWITCH_IDL_FILES = \
397         $(srcdir)/vswitchd/vswitch.ovsschema \
398         $(srcdir)/lib/vswitch-idl.ann
399 $(srcdir)/lib/vswitch-idl.ovsidl: $(VSWITCH_IDL_FILES)
400         $(OVSDB_IDLC) annotate $(VSWITCH_IDL_FILES) > $@.tmp
401         mv $@.tmp $@
402
403 EXTRA_DIST += $(srcdir)/lib/vtep-idl.ann
404 VTEP_IDL_FILES = \
405         $(srcdir)/vtep/vtep.ovsschema \
406         $(srcdir)/lib/vtep-idl.ann
407 $(srcdir)/lib/vtep-idl.ovsidl: $(VTEP_IDL_FILES)
408         $(OVSDB_IDLC) annotate $(VTEP_IDL_FILES) > $@.tmp
409         mv $@.tmp $@
410
411 lib/dirs.c: lib/dirs.c.in Makefile
412         ($(ro_c) && sed < $(srcdir)/lib/dirs.c.in \
413                 -e 's,[@]srcdir[@],$(srcdir),g' \
414                 -e 's,[@]LOGDIR[@],"$(LOGDIR)",g' \
415                 -e 's,[@]RUNDIR[@],"$(RUNDIR)",g' \
416                 -e 's,[@]DBDIR[@],"$(DBDIR)",g' \
417                 -e 's,[@]bindir[@],"$(bindir)",g' \
418                 -e 's,[@]sysconfdir[@],"$(sysconfdir)",g' \
419                 -e 's,[@]pkgdatadir[@],"$(pkgdatadir)",g') \
420              > lib/dirs.c.tmp
421         mv lib/dirs.c.tmp lib/dirs.c
422
423 $(srcdir)/lib/ofp-errors.inc: \
424         lib/ofp-errors.h include/openflow/openflow-common.h \
425         $(srcdir)/build-aux/extract-ofp-errors
426         $(run_python) $(srcdir)/build-aux/extract-ofp-errors \
427                 $(srcdir)/lib/ofp-errors.h \
428                 $(srcdir)/include/openflow/openflow-common.h > $@.tmp
429         mv $@.tmp $@
430 $(srcdir)/lib/ofp-errors.c: $(srcdir)/lib/ofp-errors.inc
431 EXTRA_DIST += build-aux/extract-ofp-errors lib/ofp-errors.inc
432
433 $(srcdir)/lib/ofp-msgs.inc: \
434         lib/ofp-msgs.h $(srcdir)/build-aux/extract-ofp-msgs
435         $(run_python) $(srcdir)/build-aux/extract-ofp-msgs \
436                 $(srcdir)/lib/ofp-msgs.h $@ > $@.tmp && mv $@.tmp $@
437 $(srcdir)/lib/ofp-msgs.c: $(srcdir)/lib/ofp-msgs.inc
438 EXTRA_DIST += build-aux/extract-ofp-msgs lib/ofp-msgs.inc
439
440 INSTALL_DATA_LOCAL += lib-install-data-local
441 lib-install-data-local:
442         $(MKDIR_P) $(DESTDIR)$(RUNDIR)
443         $(MKDIR_P) $(DESTDIR)$(PKIDIR)
444         $(MKDIR_P) $(DESTDIR)$(LOGDIR)
445         $(MKDIR_P) $(DESTDIR)$(DBDIR)
446