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