1 # Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014 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)
13 lib_libopenvswitch_la_LIBADD += ${PTHREAD_LIBS}
16 lib_libopenvswitch_la_LDFLAGS = -release $(VERSION)
18 lib_libopenvswitch_la_SOURCES = \
52 lib/daemon-private.h \
67 lib/dynamic-string.c \
68 lib/dynamic-string.h \
98 lib/learning-switch.c \
99 lib/learning-switch.h \
108 lib/mcast-snooping.c \
109 lib/mcast-snooping.h \
117 lib/netdev-provider.h \
143 lib/ofp-version-opt.h \
144 lib/ofp-version-opt.c \
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-pthreads.h \
156 lib/ovs-atomic-x86_64.h \
166 lib/ovsdb-idl-provider.h \
211 lib/stream-provider.h \
241 lib/vconn-provider.h \
257 lib_libopenvswitch_la_SOURCES += \
258 lib/daemon-windows.c \
260 lib/getrusage-windows.c \
261 lib/latch-windows.c \
262 lib/route-table-stub.c \
264 lib/stream-fd-windows.c
266 lib_libopenvswitch_la_SOURCES += \
271 lib/socket-util-unix.c \
272 lib/stream-fd-unix.c \
280 nodist_lib_libopenvswitch_la_SOURCES = \
282 CLEANFILES += $(nodist_lib_libopenvswitch_la_SOURCES)
284 lib_LTLIBRARIES += lib/libsflow.la
285 lib_libsflow_la_LDFLAGS = -release $(VERSION)
286 lib_libsflow_la_SOURCES = \
290 lib/sflow_sampler.c \
293 lib_libsflow_la_CPPFLAGS = $(AM_CPPFLAGS)
294 lib_libsflow_la_CFLAGS = $(AM_CFLAGS)
296 lib_libsflow_la_CFLAGS += -Wno-unused
298 if HAVE_WNO_UNUSED_PARAMETER
299 lib_libsflow_la_CFLAGS += -Wno-unused-parameter
303 lib_libopenvswitch_la_SOURCES += \
308 lib/netlink-notifier.c \
309 lib/netlink-notifier.h \
310 lib/netlink-protocol.h \
311 lib/netlink-socket.c \
312 lib/netlink-socket.h \
315 lib/rtnetlink-link.c \
316 lib/rtnetlink-link.h \
322 lib_libopenvswitch_la_SOURCES += \
328 lib_libopenvswitch_la_SOURCES += \
329 lib/netlink-notifier.c \
330 lib/netlink-notifier.h \
331 lib/netlink-protocol.h \
332 lib/netlink-socket.c \
337 lib_libopenvswitch_la_SOURCES += lib/async-append-aio.c
339 lib_libopenvswitch_la_SOURCES += lib/async-append-null.c
343 lib_libopenvswitch_la_SOURCES += \
344 lib/route-table-stub.c
348 lib_libopenvswitch_la_SOURCES += \
352 lib/route-table-bsd.c
356 lib_libopenvswitch_la_SOURCES += lib/stream-ssl.c
357 nodist_lib_libopenvswitch_la_SOURCES += lib/dhparams.c
358 lib/dhparams.c: lib/dh1024.pem lib/dh2048.pem lib/dh4096.pem
359 (echo '#include "lib/dhparams.h"' && \
360 openssl dhparam -C -in $(srcdir)/lib/dh1024.pem -noout && \
361 openssl dhparam -C -in $(srcdir)/lib/dh2048.pem -noout && \
362 openssl dhparam -C -in $(srcdir)/lib/dh4096.pem -noout) \
363 | sed 's/\(get_dh[0-9]*\)()/\1(void)/' > lib/dhparams.c.tmp
364 mv lib/dhparams.c.tmp lib/dhparams.c
366 lib_libopenvswitch_la_SOURCES += lib/stream-nossl.c
378 lib/coverage-unixctl.man \
382 lib/memory-unixctl.man \
383 lib/ofp-version.man \
386 lib/service-syn.man \
387 lib/ssl-bootstrap.man \
388 lib/ssl-bootstrap-syn.man \
389 lib/ssl-peer-ca-cert.man \
394 lib/unixctl-syn.man \
395 lib/vconn-active.man \
396 lib/vconn-passive.man \
397 lib/vlog-unixctl.man \
403 $(srcdir)/lib/vswitch-idl.c \
404 $(srcdir)/lib/vswitch-idl.h \
405 $(srcdir)/lib/vswitch-idl.ovsidl \
406 $(srcdir)/lib/vtep-idl.c \
407 $(srcdir)/lib/vtep-idl.h \
408 $(srcdir)/lib/vtep-idl.ovsidl
410 EXTRA_DIST += $(srcdir)/lib/vswitch-idl.ann
411 VSWITCH_IDL_FILES = \
412 $(srcdir)/vswitchd/vswitch.ovsschema \
413 $(srcdir)/lib/vswitch-idl.ann
414 $(srcdir)/lib/vswitch-idl.ovsidl: $(VSWITCH_IDL_FILES)
415 $(OVSDB_IDLC) annotate $(VSWITCH_IDL_FILES) > $@.tmp
418 EXTRA_DIST += $(srcdir)/lib/vtep-idl.ann
420 $(srcdir)/vtep/vtep.ovsschema \
421 $(srcdir)/lib/vtep-idl.ann
422 $(srcdir)/lib/vtep-idl.ovsidl: $(VTEP_IDL_FILES)
423 $(OVSDB_IDLC) annotate $(VTEP_IDL_FILES) > $@.tmp
426 lib/dirs.c: lib/dirs.c.in Makefile
427 ($(ro_c) && sed < $(srcdir)/lib/dirs.c.in \
428 -e 's,[@]srcdir[@],$(srcdir),g' \
429 -e 's,[@]LOGDIR[@],"$(LOGDIR)",g' \
430 -e 's,[@]RUNDIR[@],"$(RUNDIR)",g' \
431 -e 's,[@]DBDIR[@],"$(DBDIR)",g' \
432 -e 's,[@]bindir[@],"$(bindir)",g' \
433 -e 's,[@]sysconfdir[@],"$(sysconfdir)",g' \
434 -e 's,[@]pkgdatadir[@],"$(pkgdatadir)",g') \
436 mv lib/dirs.c.tmp lib/dirs.c
438 lib/ofp-actions.inc1: $(srcdir)/build-aux/extract-ofp-actions lib/ofp-actions.c
439 $(run_python) $^ --prototypes > $@.tmp && mv $@.tmp $@
440 lib/ofp-actions.inc2: $(srcdir)/build-aux/extract-ofp-actions lib/ofp-actions.c
441 $(run_python) $^ --definitions > $@.tmp && mv $@.tmp $@
442 lib/ofp-actions.lo: lib/ofp-actions.inc1 lib/ofp-actions.inc2
443 CLEANFILES += lib/ofp-actions.inc1 lib/ofp-actions.inc2
444 EXTRA_DIST += build-aux/extract-ofp-actions lib/ofp-errors.inc
446 $(srcdir)/lib/ofp-errors.inc: \
447 lib/ofp-errors.h include/openflow/openflow-common.h \
448 $(srcdir)/build-aux/extract-ofp-errors
449 $(run_python) $(srcdir)/build-aux/extract-ofp-errors \
450 $(srcdir)/lib/ofp-errors.h \
451 $(srcdir)/include/openflow/openflow-common.h > $@.tmp
453 $(srcdir)/lib/ofp-errors.c: $(srcdir)/lib/ofp-errors.inc
454 EXTRA_DIST += build-aux/extract-ofp-errors lib/ofp-errors.inc
456 $(srcdir)/lib/ofp-msgs.inc: \
457 lib/ofp-msgs.h $(srcdir)/build-aux/extract-ofp-msgs
458 $(run_python) $(srcdir)/build-aux/extract-ofp-msgs \
459 $(srcdir)/lib/ofp-msgs.h $@ > $@.tmp && mv $@.tmp $@
460 $(srcdir)/lib/ofp-msgs.c: $(srcdir)/lib/ofp-msgs.inc
461 EXTRA_DIST += build-aux/extract-ofp-msgs lib/ofp-msgs.inc
463 INSTALL_DATA_LOCAL += lib-install-data-local
464 lib-install-data-local:
465 $(MKDIR_P) $(DESTDIR)$(RUNDIR)
466 $(MKDIR_P) $(DESTDIR)$(PKIDIR)
467 $(MKDIR_P) $(DESTDIR)$(LOGDIR)
468 $(MKDIR_P) $(DESTDIR)$(DBDIR)