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 = \
61 lib/dynamic-string.c \
62 lib/dynamic-string.h \
92 lib/learning-switch.c \
93 lib/learning-switch.h \
109 lib/netdev-provider.h \
136 lib/ofp-version-opt.h \
137 lib/ofp-version-opt.c \
140 lib/ovs-atomic-c11.h \
141 lib/ovs-atomic-clang.h \
142 lib/ovs-atomic-flag-gcc4.7+.h \
143 lib/ovs-atomic-gcc4+.h \
144 lib/ovs-atomic-gcc4.7+.h \
145 lib/ovs-atomic-locked.c \
146 lib/ovs-atomic-locked.h \
147 lib/ovs-atomic-pthreads.h \
157 lib/ovsdb-idl-provider.h \
198 lib/stream-provider.h \
228 lib/vconn-provider.h \
244 lib_libopenvswitch_la_SOURCES += \
245 lib/daemon-windows.c \
247 lib/getrusage-windows.c \
248 lib/latch-windows.c \
249 lib/route-table-stub.c \
251 lib/stream-fd-windows.c
253 lib_libopenvswitch_la_SOURCES += \
258 lib/stream-fd-unix.c \
266 nodist_lib_libopenvswitch_la_SOURCES = \
268 CLEANFILES += $(nodist_lib_libopenvswitch_la_SOURCES)
270 lib_LTLIBRARIES += lib/libsflow.la
271 lib_libsflow_la_LDFLAGS = -release $(VERSION)
272 lib_libsflow_la_SOURCES = \
276 lib/sflow_sampler.c \
279 lib_libsflow_la_CPPFLAGS = $(AM_CPPFLAGS)
280 lib_libsflow_la_CFLAGS = $(AM_CFLAGS)
282 lib_libsflow_la_CFLAGS += -Wno-unused
284 if HAVE_WNO_UNUSED_PARAMETER
285 lib_libsflow_la_CFLAGS += -Wno-unused-parameter
289 lib_libopenvswitch_la_SOURCES += \
294 lib/netlink-notifier.c \
295 lib/netlink-notifier.h \
296 lib/netlink-protocol.h \
297 lib/netlink-socket.c \
298 lib/netlink-socket.h \
299 lib/rtnetlink-link.c \
300 lib/rtnetlink-link.h \
306 lib_libopenvswitch_la_SOURCES += \
312 lib_libopenvswitch_la_SOURCES += lib/async-append-aio.c
314 lib_libopenvswitch_la_SOURCES += lib/async-append-null.c
318 lib_libopenvswitch_la_SOURCES += \
319 lib/route-table-stub.c
323 lib_libopenvswitch_la_SOURCES += \
327 lib/route-table-bsd.c
331 lib_libopenvswitch_la_SOURCES += lib/stream-ssl.c
332 nodist_lib_libopenvswitch_la_SOURCES += lib/dhparams.c
333 lib/dhparams.c: lib/dh1024.pem lib/dh2048.pem lib/dh4096.pem
334 (echo '#include "lib/dhparams.h"' && \
335 openssl dhparam -C -in $(srcdir)/lib/dh1024.pem -noout && \
336 openssl dhparam -C -in $(srcdir)/lib/dh2048.pem -noout && \
337 openssl dhparam -C -in $(srcdir)/lib/dh4096.pem -noout) \
338 | sed 's/\(get_dh[0-9]*\)()/\1(void)/' > lib/dhparams.c.tmp
339 mv lib/dhparams.c.tmp lib/dhparams.c
341 lib_libopenvswitch_la_SOURCES += lib/stream-nossl.c
353 lib/coverage-unixctl.man \
356 lib/memory-unixctl.man \
357 lib/ofp-version.man \
360 lib/service-syn.man \
361 lib/ssl-bootstrap.man \
362 lib/ssl-bootstrap-syn.man \
363 lib/ssl-peer-ca-cert.man \
368 lib/unixctl-syn.man \
369 lib/vconn-active.man \
370 lib/vconn-passive.man \
371 lib/vlog-unixctl.man \
377 $(srcdir)/lib/vswitch-idl.c \
378 $(srcdir)/lib/vswitch-idl.h \
379 $(srcdir)/lib/vswitch-idl.ovsidl \
380 $(srcdir)/lib/vtep-idl.c \
381 $(srcdir)/lib/vtep-idl.h \
382 $(srcdir)/lib/vtep-idl.ovsidl
384 EXTRA_DIST += $(srcdir)/lib/vswitch-idl.ann
385 VSWITCH_IDL_FILES = \
386 $(srcdir)/vswitchd/vswitch.ovsschema \
387 $(srcdir)/lib/vswitch-idl.ann
388 $(srcdir)/lib/vswitch-idl.ovsidl: $(VSWITCH_IDL_FILES)
389 $(OVSDB_IDLC) annotate $(VSWITCH_IDL_FILES) > $@.tmp
392 EXTRA_DIST += $(srcdir)/lib/vtep-idl.ann
394 $(srcdir)/vtep/vtep.ovsschema \
395 $(srcdir)/lib/vtep-idl.ann
396 $(srcdir)/lib/vtep-idl.ovsidl: $(VTEP_IDL_FILES)
397 $(OVSDB_IDLC) annotate $(VTEP_IDL_FILES) > $@.tmp
400 lib/dirs.c: lib/dirs.c.in Makefile
401 ($(ro_c) && sed < $(srcdir)/lib/dirs.c.in \
402 -e 's,[@]srcdir[@],$(srcdir),g' \
403 -e 's,[@]LOGDIR[@],"$(LOGDIR)",g' \
404 -e 's,[@]RUNDIR[@],"$(RUNDIR)",g' \
405 -e 's,[@]DBDIR[@],"$(DBDIR)",g' \
406 -e 's,[@]bindir[@],"$(bindir)",g' \
407 -e 's,[@]sysconfdir[@],"$(sysconfdir)",g' \
408 -e 's,[@]pkgdatadir[@],"$(pkgdatadir)",g') \
410 mv lib/dirs.c.tmp lib/dirs.c
412 $(srcdir)/lib/ofp-errors.inc: \
413 lib/ofp-errors.h include/openflow/openflow-common.h \
414 $(srcdir)/build-aux/extract-ofp-errors
415 $(run_python) $(srcdir)/build-aux/extract-ofp-errors \
416 $(srcdir)/lib/ofp-errors.h \
417 $(srcdir)/include/openflow/openflow-common.h > $@.tmp
419 $(srcdir)/lib/ofp-errors.c: $(srcdir)/lib/ofp-errors.inc
420 EXTRA_DIST += build-aux/extract-ofp-errors lib/ofp-errors.inc
422 $(srcdir)/lib/ofp-msgs.inc: \
423 lib/ofp-msgs.h $(srcdir)/build-aux/extract-ofp-msgs
424 $(run_python) $(srcdir)/build-aux/extract-ofp-msgs \
425 $(srcdir)/lib/ofp-msgs.h $@ > $@.tmp && mv $@.tmp $@
426 $(srcdir)/lib/ofp-msgs.c: $(srcdir)/lib/ofp-msgs.inc
427 EXTRA_DIST += build-aux/extract-ofp-msgs lib/ofp-msgs.inc
429 INSTALL_DATA_LOCAL += lib-install-data-local
430 lib-install-data-local:
431 $(MKDIR_P) $(DESTDIR)$(RUNDIR)
432 $(MKDIR_P) $(DESTDIR)$(PKIDIR)
433 $(MKDIR_P) $(DESTDIR)$(LOGDIR)
434 $(MKDIR_P) $(DESTDIR)$(DBDIR)