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