1 # Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016 Nicira, Inc.
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.
8 lib_LTLIBRARIES += lib/libopenvswitch.la
10 lib_libopenvswitch_la_LIBADD = $(SSL_LIBS)
11 lib_libopenvswitch_la_LIBADD += $(CAPNG_LDADD)
14 lib_libopenvswitch_la_LIBADD += ${PTHREAD_LIBS}
17 lib_libopenvswitch_la_LDFLAGS = \
18 -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
19 -Wl,--version-script=$(top_builddir)/lib/libopenvswitch.sym \
22 lib_libopenvswitch_la_SOURCES = \
40 lib/classifier-private.h \
58 lib/daemon-private.h \
77 lib/dynamic-string.c \
78 lib/dynamic-string.h \
111 lib/learning-switch.c \
112 lib/learning-switch.h \
120 lib/mcast-snooping.c \
121 lib/mcast-snooping.h \
129 lib/netdev-provider.h \
157 lib/ofp-version-opt.h \
158 lib/ofp-version-opt.c \
161 lib/ovs-atomic-c11.h \
162 lib/ovs-atomic-clang.h \
163 lib/ovs-atomic-flag-gcc4.7+.h \
164 lib/ovs-atomic-gcc4+.h \
165 lib/ovs-atomic-gcc4.7+.h \
166 lib/ovs-atomic-i586.h \
167 lib/ovs-atomic-locked.c \
168 lib/ovs-atomic-locked.h \
169 lib/ovs-atomic-msvc.h \
170 lib/ovs-atomic-pthreads.h \
171 lib/ovs-atomic-x86_64.h \
185 lib/ovsdb-idl-provider.h \
216 lib/rstp-state-machines.c \
217 lib/rstp-state-machines.h \
239 lib/stream-provider.h \
248 lib/syslog-direct.c \
249 lib/syslog-direct.h \
252 lib/syslog-provider.h \
259 lib/tnl-neigh-cache.c \
260 lib/tnl-neigh-cache.h \
277 lib/vconn-provider.h \
285 lib/lldp/aa-structs.h \
287 lib/lldp/lldp-const.h \
288 lib/lldp/lldp-tlv.h \
291 lib/lldp/lldpd-structs.c \
292 lib/lldp/lldpd-structs.h
295 lib_libopenvswitch_la_SOURCES += \
296 lib/daemon-windows.c \
298 lib/getrusage-windows.c \
299 lib/latch-windows.c \
300 lib/route-table-stub.c \
301 lib/if-notifier-stub.c \
304 lib_libopenvswitch_la_SOURCES += \
309 lib/socket-util-unix.c \
317 nodist_lib_libopenvswitch_la_SOURCES = \
321 CLEANFILES += $(nodist_lib_libopenvswitch_la_SOURCES)
323 lib_LTLIBRARIES += lib/libsflow.la
324 lib_libsflow_la_LDFLAGS = \
325 -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
326 -Wl,--version-script=$(top_builddir)/lib/libsflow.sym \
328 lib_libsflow_la_SOURCES = \
332 lib/sflow_sampler.c \
335 lib_libsflow_la_CPPFLAGS = $(AM_CPPFLAGS)
336 lib_libsflow_la_CFLAGS = $(AM_CFLAGS)
338 lib_libsflow_la_CFLAGS += -Wno-unused
340 if HAVE_WNO_UNUSED_PARAMETER
341 lib_libsflow_la_CFLAGS += -Wno-unused-parameter
345 lib_libopenvswitch_la_SOURCES += \
352 lib/netlink-conntrack.c \
353 lib/netlink-conntrack.h \
354 lib/netlink-notifier.c \
355 lib/netlink-notifier.h \
356 lib/netlink-protocol.h \
357 lib/netlink-socket.c \
358 lib/netlink-socket.h \
368 lib_libopenvswitch_la_SOURCES += \
374 lib_libopenvswitch_la_SOURCES += \
377 lib/netdev-windows.c \
378 lib/netlink-notifier.c \
379 lib/netlink-notifier.h \
380 lib/netlink-protocol.h \
381 lib/netlink-socket.c \
386 lib_libopenvswitch_la_SOURCES += lib/async-append-aio.c
388 lib_libopenvswitch_la_SOURCES += lib/async-append-null.c
392 lib_libopenvswitch_la_SOURCES += \
393 lib/route-table-stub.c \
394 lib/if-notifier-stub.c
398 lib_libopenvswitch_la_SOURCES += \
399 lib/if-notifier-bsd.c \
403 lib/route-table-bsd.c
407 lib_libopenvswitch_la_SOURCES += lib/stream-ssl.c
408 nodist_lib_libopenvswitch_la_SOURCES += lib/dhparams.c
409 lib/dhparams.c: lib/dh1024.pem lib/dh2048.pem lib/dh4096.pem
410 $(AM_V_GEN)(echo '#include "lib/dhparams.h"' && \
411 openssl dhparam -C -in $(srcdir)/lib/dh1024.pem -noout && \
412 openssl dhparam -C -in $(srcdir)/lib/dh2048.pem -noout && \
413 openssl dhparam -C -in $(srcdir)/lib/dh4096.pem -noout) \
414 | sed 's/\(get_dh[0-9]*\)()/\1(void)/' > lib/dhparams.c.tmp && \
415 mv lib/dhparams.c.tmp lib/dhparams.c
417 lib_libopenvswitch_la_SOURCES += lib/stream-nossl.c
421 $(srcdir)/lib/libopenvswitch.pc \
422 $(srcdir)/lib/libsflow.pc
434 lib/coverage-unixctl.man \
437 lib/db-ctl-base.man \
439 lib/memory-unixctl.man \
440 lib/ofp-version.man \
443 lib/service-syn.man \
444 lib/ssl-bootstrap.man \
445 lib/ssl-bootstrap-syn.man \
446 lib/ssl-peer-ca-cert.man \
447 lib/ssl-peer-ca-cert-syn.man \
452 lib/unixctl-syn.man \
453 lib/vconn-active.man \
454 lib/vconn-passive.man \
455 lib/vlog-unixctl.man \
460 OVSIDL_BUILT += lib/vswitch-idl.c lib/vswitch-idl.h lib/vswitch-idl.ovsidl
462 EXTRA_DIST += lib/vswitch-idl.ann
463 lib/vswitch-idl.ovsidl: vswitchd/vswitch.ovsschema lib/vswitch-idl.ann
464 $(AM_V_GEN)$(OVSDB_IDLC) annotate $(srcdir)/vswitchd/vswitch.ovsschema $(srcdir)/lib/vswitch-idl.ann > $@.tmp && mv $@.tmp $@
466 lib/dirs.c: lib/dirs.c.in Makefile
467 $(AM_V_GEN)($(ro_c) && sed < $(srcdir)/lib/dirs.c.in \
468 -e 's,[@]srcdir[@],$(srcdir),g' \
469 -e 's,[@]LOGDIR[@],"$(LOGDIR)",g' \
470 -e 's,[@]RUNDIR[@],"$(RUNDIR)",g' \
471 -e 's,[@]DBDIR[@],"$(DBDIR)",g' \
472 -e 's,[@]bindir[@],"$(bindir)",g' \
473 -e 's,[@]sysconfdir[@],"$(sysconfdir)",g' \
474 -e 's,[@]pkgdatadir[@],"$(pkgdatadir)",g') \
475 > lib/dirs.c.tmp && \
476 mv lib/dirs.c.tmp lib/dirs.c
478 lib/meta-flow.inc: $(srcdir)/build-aux/extract-ofp-fields lib/meta-flow.h
479 $(AM_V_GEN)$(run_python) $^ --meta-flow > $@.tmp && mv $@.tmp $@
480 lib/meta-flow.lo: lib/meta-flow.inc
481 lib/nx-match.inc: $(srcdir)/build-aux/extract-ofp-fields lib/meta-flow.h
482 $(AM_V_GEN)$(run_python) $^ --nx-match > $@.tmp && mv $@.tmp $@
483 lib/nx-match.lo: lib/nx-match.inc
484 CLEANFILES += lib/meta-flow.inc lib/nx-match.inc
485 EXTRA_DIST += build-aux/extract-ofp-fields
487 lib/ofp-actions.inc1: $(srcdir)/build-aux/extract-ofp-actions lib/ofp-actions.c
488 $(AM_V_GEN)$(run_python) $^ --prototypes > $@.tmp && mv $@.tmp $@
489 lib/ofp-actions.inc2: $(srcdir)/build-aux/extract-ofp-actions lib/ofp-actions.c
490 $(AM_V_GEN)$(run_python) $^ --definitions > $@.tmp && mv $@.tmp $@
491 lib/ofp-actions.lo: lib/ofp-actions.inc1 lib/ofp-actions.inc2
492 CLEANFILES += lib/ofp-actions.inc1 lib/ofp-actions.inc2
493 EXTRA_DIST += build-aux/extract-ofp-actions
495 lib/ofp-errors.inc: lib/ofp-errors.h include/openflow/openflow-common.h \
496 $(srcdir)/build-aux/extract-ofp-errors
497 $(AM_V_GEN)$(run_python) $(srcdir)/build-aux/extract-ofp-errors \
498 $(srcdir)/lib/ofp-errors.h \
499 $(srcdir)/include/openflow/openflow-common.h > $@.tmp && \
501 lib/ofp-errors.lo: lib/ofp-errors.inc
502 CLEANFILES += lib/ofp-errors.inc
503 EXTRA_DIST += build-aux/extract-ofp-errors
505 lib/ofp-msgs.inc: lib/ofp-msgs.h $(srcdir)/build-aux/extract-ofp-msgs
506 $(AM_V_GEN)$(run_python) $(srcdir)/build-aux/extract-ofp-msgs \
507 $(srcdir)/lib/ofp-msgs.h $@ > $@.tmp && mv $@.tmp $@
508 lib/ofp-msgs.lo: lib/ofp-msgs.inc
509 CLEANFILES += lib/ofp-msgs.inc
510 EXTRA_DIST += build-aux/extract-ofp-msgs
512 INSTALL_DATA_LOCAL += lib-install-data-local
513 lib-install-data-local:
514 $(MKDIR_P) $(DESTDIR)$(RUNDIR)
515 $(MKDIR_P) $(DESTDIR)$(PKIDIR)
516 $(MKDIR_P) $(DESTDIR)$(LOGDIR)
517 $(MKDIR_P) $(DESTDIR)$(DBDIR)