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)
11 lib_libopenvswitch_la_LDFLAGS = -release $(VERSION)
13 lib_libopenvswitch_la_SOURCES = \
55 lib/dynamic-string.c \
56 lib/dynamic-string.h \
86 lib/learning-switch.c \
87 lib/learning-switch.h \
103 lib/netdev-provider.h \
130 lib/ofp-version-opt.h \
131 lib/ofp-version-opt.c \
134 lib/ovs-atomic-c11.h \
135 lib/ovs-atomic-clang.h \
136 lib/ovs-atomic-flag-gcc4.7+.h \
137 lib/ovs-atomic-gcc4+.c \
138 lib/ovs-atomic-gcc4+.h \
139 lib/ovs-atomic-gcc4.7+.h \
140 lib/ovs-atomic-pthreads.c \
141 lib/ovs-atomic-pthreads.h \
149 lib/ovsdb-idl-provider.h \
190 lib/stream-provider.h \
220 lib/vconn-provider.h \
236 lib_libopenvswitch_la_SOURCES += \
237 lib/daemon-windows.c \
239 lib/latch-windows.c \
240 lib/stream-fd-windows.c
242 lib_libopenvswitch_la_SOURCES += \
247 lib/stream-fd-unix.c \
255 nodist_lib_libopenvswitch_la_SOURCES = \
257 CLEANFILES += $(nodist_lib_libopenvswitch_la_SOURCES)
259 lib_LTLIBRARIES += lib/libsflow.la
260 lib_libsflow_la_LDFLAGS = -release $(VERSION)
261 lib_libsflow_la_SOURCES = \
265 lib/sflow_sampler.c \
268 lib_libsflow_la_CPPFLAGS = $(AM_CPPFLAGS)
269 lib_libsflow_la_CFLAGS = $(AM_CFLAGS)
271 lib_libsflow_la_CFLAGS += -Wno-unused
273 if HAVE_WNO_UNUSED_PARAMETER
274 lib_libsflow_la_CFLAGS += -Wno-unused-parameter
278 lib_libopenvswitch_la_SOURCES += \
283 lib/netlink-notifier.c \
284 lib/netlink-notifier.h \
285 lib/netlink-protocol.h \
286 lib/netlink-socket.c \
287 lib/netlink-socket.h \
288 lib/rtnetlink-link.c \
289 lib/rtnetlink-link.h \
295 lib_libopenvswitch_la_SOURCES += lib/async-append-aio.c
297 lib_libopenvswitch_la_SOURCES += lib/async-append-null.c
301 lib_libopenvswitch_la_SOURCES += \
302 lib/route-table-stub.c
306 lib_libopenvswitch_la_SOURCES += \
310 lib/route-table-bsd.c
314 lib_libopenvswitch_la_SOURCES += lib/stream-ssl.c
315 nodist_lib_libopenvswitch_la_SOURCES += lib/dhparams.c
316 lib/dhparams.c: lib/dh1024.pem lib/dh2048.pem lib/dh4096.pem
317 (echo '#include "lib/dhparams.h"' && \
318 openssl dhparam -C -in $(srcdir)/lib/dh1024.pem -noout && \
319 openssl dhparam -C -in $(srcdir)/lib/dh2048.pem -noout && \
320 openssl dhparam -C -in $(srcdir)/lib/dh4096.pem -noout) \
321 | sed 's/\(get_dh[0-9]*\)()/\1(void)/' > lib/dhparams.c.tmp
322 mv lib/dhparams.c.tmp lib/dhparams.c
324 lib_libopenvswitch_la_SOURCES += lib/stream-nossl.c
336 lib/coverage-unixctl.man \
339 lib/memory-unixctl.man \
340 lib/ofp-version.man \
343 lib/service-syn.man \
344 lib/ssl-bootstrap.man \
345 lib/ssl-bootstrap-syn.man \
346 lib/ssl-peer-ca-cert.man \
351 lib/unixctl-syn.man \
352 lib/vconn-active.man \
353 lib/vconn-passive.man \
354 lib/vlog-unixctl.man \
360 $(srcdir)/lib/vswitch-idl.c \
361 $(srcdir)/lib/vswitch-idl.h \
362 $(srcdir)/lib/vswitch-idl.ovsidl \
363 $(srcdir)/lib/vtep-idl.c \
364 $(srcdir)/lib/vtep-idl.h \
365 $(srcdir)/lib/vtep-idl.ovsidl
367 EXTRA_DIST += $(srcdir)/lib/vswitch-idl.ann
368 VSWITCH_IDL_FILES = \
369 $(srcdir)/vswitchd/vswitch.ovsschema \
370 $(srcdir)/lib/vswitch-idl.ann
371 $(srcdir)/lib/vswitch-idl.ovsidl: $(VSWITCH_IDL_FILES)
372 $(OVSDB_IDLC) annotate $(VSWITCH_IDL_FILES) > $@.tmp
375 EXTRA_DIST += $(srcdir)/lib/vtep-idl.ann
377 $(srcdir)/vtep/vtep.ovsschema \
378 $(srcdir)/lib/vtep-idl.ann
379 $(srcdir)/lib/vtep-idl.ovsidl: $(VTEP_IDL_FILES)
380 $(OVSDB_IDLC) annotate $(VTEP_IDL_FILES) > $@.tmp
383 lib/dirs.c: lib/dirs.c.in Makefile
384 ($(ro_c) && sed < $(srcdir)/lib/dirs.c.in \
385 -e 's,[@]srcdir[@],$(srcdir),g' \
386 -e 's,[@]LOGDIR[@],"$(LOGDIR)",g' \
387 -e 's,[@]RUNDIR[@],"$(RUNDIR)",g' \
388 -e 's,[@]DBDIR[@],"$(DBDIR)",g' \
389 -e 's,[@]bindir[@],"$(bindir)",g' \
390 -e 's,[@]sysconfdir[@],"$(sysconfdir)",g' \
391 -e 's,[@]pkgdatadir[@],"$(pkgdatadir)",g') \
393 mv lib/dirs.c.tmp lib/dirs.c
395 $(srcdir)/lib/ofp-errors.inc: \
396 lib/ofp-errors.h include/openflow/openflow-common.h \
397 $(srcdir)/build-aux/extract-ofp-errors
398 $(run_python) $(srcdir)/build-aux/extract-ofp-errors \
399 $(srcdir)/lib/ofp-errors.h \
400 $(srcdir)/include/openflow/openflow-common.h > $@.tmp
402 $(srcdir)/lib/ofp-errors.c: $(srcdir)/lib/ofp-errors.inc
403 EXTRA_DIST += build-aux/extract-ofp-errors lib/ofp-errors.inc
405 $(srcdir)/lib/ofp-msgs.inc: \
406 lib/ofp-msgs.h $(srcdir)/build-aux/extract-ofp-msgs
407 $(run_python) $(srcdir)/build-aux/extract-ofp-msgs \
408 $(srcdir)/lib/ofp-msgs.h $@ > $@.tmp && mv $@.tmp $@
409 $(srcdir)/lib/ofp-msgs.c: $(srcdir)/lib/ofp-msgs.inc
410 EXTRA_DIST += build-aux/extract-ofp-msgs lib/ofp-msgs.inc
412 INSTALL_DATA_LOCAL += lib-install-data-local
413 lib-install-data-local:
414 $(MKDIR_P) $(DESTDIR)$(RUNDIR)
415 $(MKDIR_P) $(DESTDIR)$(PKIDIR)
416 $(MKDIR_P) $(DESTDIR)$(LOGDIR)
417 $(MKDIR_P) $(DESTDIR)$(DBDIR)