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 = \
50 lib/daemon-private.h \
63 lib/dynamic-string.c \
64 lib/dynamic-string.h \
94 lib/learning-switch.c \
95 lib/learning-switch.h \
111 lib/netdev-provider.h \
138 lib/ofp-version-opt.h \
139 lib/ofp-version-opt.c \
142 lib/ovs-atomic-c11.h \
143 lib/ovs-atomic-clang.h \
144 lib/ovs-atomic-flag-gcc4.7+.h \
145 lib/ovs-atomic-gcc4+.h \
146 lib/ovs-atomic-gcc4.7+.h \
147 lib/ovs-atomic-locked.c \
148 lib/ovs-atomic-locked.h \
149 lib/ovs-atomic-pthreads.h \
159 lib/ovsdb-idl-provider.h \
200 lib/stream-provider.h \
230 lib/vconn-provider.h \
246 lib_libopenvswitch_la_SOURCES += \
247 lib/daemon-windows.c \
249 lib/getrusage-windows.c \
250 lib/latch-windows.c \
251 lib/route-table-stub.c \
253 lib/stream-fd-windows.c
255 lib_libopenvswitch_la_SOURCES += \
260 lib/stream-fd-unix.c \
268 nodist_lib_libopenvswitch_la_SOURCES = \
270 CLEANFILES += $(nodist_lib_libopenvswitch_la_SOURCES)
272 lib_LTLIBRARIES += lib/libsflow.la
273 lib_libsflow_la_LDFLAGS = -release $(VERSION)
274 lib_libsflow_la_SOURCES = \
278 lib/sflow_sampler.c \
281 lib_libsflow_la_CPPFLAGS = $(AM_CPPFLAGS)
282 lib_libsflow_la_CFLAGS = $(AM_CFLAGS)
284 lib_libsflow_la_CFLAGS += -Wno-unused
286 if HAVE_WNO_UNUSED_PARAMETER
287 lib_libsflow_la_CFLAGS += -Wno-unused-parameter
291 lib_libopenvswitch_la_SOURCES += \
296 lib/netlink-notifier.c \
297 lib/netlink-notifier.h \
298 lib/netlink-protocol.h \
299 lib/netlink-socket.c \
300 lib/netlink-socket.h \
301 lib/rtnetlink-link.c \
302 lib/rtnetlink-link.h \
308 lib_libopenvswitch_la_SOURCES += \
314 lib_libopenvswitch_la_SOURCES += lib/async-append-aio.c
316 lib_libopenvswitch_la_SOURCES += lib/async-append-null.c
320 lib_libopenvswitch_la_SOURCES += \
321 lib/route-table-stub.c
325 lib_libopenvswitch_la_SOURCES += \
329 lib/route-table-bsd.c
333 lib_libopenvswitch_la_SOURCES += lib/stream-ssl.c
334 nodist_lib_libopenvswitch_la_SOURCES += lib/dhparams.c
335 lib/dhparams.c: lib/dh1024.pem lib/dh2048.pem lib/dh4096.pem
336 (echo '#include "lib/dhparams.h"' && \
337 openssl dhparam -C -in $(srcdir)/lib/dh1024.pem -noout && \
338 openssl dhparam -C -in $(srcdir)/lib/dh2048.pem -noout && \
339 openssl dhparam -C -in $(srcdir)/lib/dh4096.pem -noout) \
340 | sed 's/\(get_dh[0-9]*\)()/\1(void)/' > lib/dhparams.c.tmp
341 mv lib/dhparams.c.tmp lib/dhparams.c
343 lib_libopenvswitch_la_SOURCES += lib/stream-nossl.c
355 lib/coverage-unixctl.man \
358 lib/memory-unixctl.man \
359 lib/ofp-version.man \
362 lib/service-syn.man \
363 lib/ssl-bootstrap.man \
364 lib/ssl-bootstrap-syn.man \
365 lib/ssl-peer-ca-cert.man \
370 lib/unixctl-syn.man \
371 lib/vconn-active.man \
372 lib/vconn-passive.man \
373 lib/vlog-unixctl.man \
379 $(srcdir)/lib/vswitch-idl.c \
380 $(srcdir)/lib/vswitch-idl.h \
381 $(srcdir)/lib/vswitch-idl.ovsidl \
382 $(srcdir)/lib/vtep-idl.c \
383 $(srcdir)/lib/vtep-idl.h \
384 $(srcdir)/lib/vtep-idl.ovsidl
386 EXTRA_DIST += $(srcdir)/lib/vswitch-idl.ann
387 VSWITCH_IDL_FILES = \
388 $(srcdir)/vswitchd/vswitch.ovsschema \
389 $(srcdir)/lib/vswitch-idl.ann
390 $(srcdir)/lib/vswitch-idl.ovsidl: $(VSWITCH_IDL_FILES)
391 $(OVSDB_IDLC) annotate $(VSWITCH_IDL_FILES) > $@.tmp
394 EXTRA_DIST += $(srcdir)/lib/vtep-idl.ann
396 $(srcdir)/vtep/vtep.ovsschema \
397 $(srcdir)/lib/vtep-idl.ann
398 $(srcdir)/lib/vtep-idl.ovsidl: $(VTEP_IDL_FILES)
399 $(OVSDB_IDLC) annotate $(VTEP_IDL_FILES) > $@.tmp
402 lib/dirs.c: lib/dirs.c.in Makefile
403 ($(ro_c) && sed < $(srcdir)/lib/dirs.c.in \
404 -e 's,[@]srcdir[@],$(srcdir),g' \
405 -e 's,[@]LOGDIR[@],"$(LOGDIR)",g' \
406 -e 's,[@]RUNDIR[@],"$(RUNDIR)",g' \
407 -e 's,[@]DBDIR[@],"$(DBDIR)",g' \
408 -e 's,[@]bindir[@],"$(bindir)",g' \
409 -e 's,[@]sysconfdir[@],"$(sysconfdir)",g' \
410 -e 's,[@]pkgdatadir[@],"$(pkgdatadir)",g') \
412 mv lib/dirs.c.tmp lib/dirs.c
414 $(srcdir)/lib/ofp-errors.inc: \
415 lib/ofp-errors.h include/openflow/openflow-common.h \
416 $(srcdir)/build-aux/extract-ofp-errors
417 $(run_python) $(srcdir)/build-aux/extract-ofp-errors \
418 $(srcdir)/lib/ofp-errors.h \
419 $(srcdir)/include/openflow/openflow-common.h > $@.tmp
421 $(srcdir)/lib/ofp-errors.c: $(srcdir)/lib/ofp-errors.inc
422 EXTRA_DIST += build-aux/extract-ofp-errors lib/ofp-errors.inc
424 $(srcdir)/lib/ofp-msgs.inc: \
425 lib/ofp-msgs.h $(srcdir)/build-aux/extract-ofp-msgs
426 $(run_python) $(srcdir)/build-aux/extract-ofp-msgs \
427 $(srcdir)/lib/ofp-msgs.h $@ > $@.tmp && mv $@.tmp $@
428 $(srcdir)/lib/ofp-msgs.c: $(srcdir)/lib/ofp-msgs.inc
429 EXTRA_DIST += build-aux/extract-ofp-msgs lib/ofp-msgs.inc
431 INSTALL_DATA_LOCAL += lib-install-data-local
432 lib-install-data-local:
433 $(MKDIR_P) $(DESTDIR)$(RUNDIR)
434 $(MKDIR_P) $(DESTDIR)$(PKIDIR)
435 $(MKDIR_P) $(DESTDIR)$(LOGDIR)
436 $(MKDIR_P) $(DESTDIR)$(DBDIR)